Copy link to clipboard
Copied
Hi,
I have built an OSMF player that allows users to seek to where they were when resuming, but also to scrub back to the beginning.
EG:
A stream is 1 minute long.
User starts play at 25 seconds.
User can scrub back to 5 seconds or forward to 55 seconds.
This works perfectly with RTMP - TimeTrait reports correctly and video displays correctly.
EG:
Start at 25 seconds, TimeTrait reports: duration = 60, current position = 25 and displaying video is 25.
Seek to 5 seconds rewinds to current duration = 60, position = 5, displaying video is 5.
But...
With HTTP streams...
Start at 25 seconds. TimeTrait reports: duration = 60, current position = 25 and displaying video is 50.
Seek to 5 seconds rewinds to before the start of the stream and gives me a media complete... end of stream.
Start at 30 seconds, TimeTrait reports duration = 60, current position = 30 and displaying video is 60 so gives me a media complete... end of stream.
It is pretty clear that what is happening is that HTTP stream seeking is resetting my start index to the seek point, as if I had started play with:
NetStream.play(seekPoint);
Rather than:
NetStream.play();
NetStream.seek(seekPoint);
This, I hasten to add, is a horrendous issue from my client's point of view as it effectively means I cannot allow resume of content.
Does anybody have any ideas, workarounds?
G
After digging into OSMF code i've found a SOLUTION:
First, ensure that you have the latest OSMF source inside your project.
For now it's 2.0.71 (org.osmf.utils.Version).
Navigate to org.osmf.net.httpstreaming.HTTPNetStream
and make some changes:
1. Change line # 1441
_initialTime = _dvrInfo != null ? _dvrInfo.startTime : currentTime;
to
_initialTime = _dvrInfo != null ? _dvrInfo.startTime : (_seekTime > 0 ? _playStart : currentTime);
2. Change line # 1496
_initialTime = currentTime
to
...
_initialTime = _seekTi
Copy link to clipboard
Copied
After digging into OSMF code i've found a SOLUTION:
First, ensure that you have the latest OSMF source inside your project.
For now it's 2.0.71 (org.osmf.utils.Version).
Navigate to org.osmf.net.httpstreaming.HTTPNetStream
and make some changes:
1. Change line # 1441
_initialTime = _dvrInfo != null ? _dvrInfo.startTime : currentTime;
to
_initialTime = _dvrInfo != null ? _dvrInfo.startTime : (_seekTime > 0 ? _playStart : currentTime);
2. Change line # 1496
_initialTime = currentTime
to
_initialTime = _seekTime > 0 ? _playStart : currentTime
That's it!
Now you can listen to MediaPlayerCapabilityChangeEvent.CAN_SEEK_CHANGE event
and seek immediately.
By the way: if you'll find any bugs related to this change feel free to post them here!
Copy link to clipboard
Copied
Thanks, ignatev_me
G
Copy link to clipboard
Copied
Just downloaded the latest sources from opensourcemediaframework.com - made the changes in org.osmf.net.httpstreaming.HTTPNetStream in lines #1399 and #1454 and it worked. Great!
Copy link to clipboard
Copied
Works for me, too.
Copy link to clipboard
Copied
Works for me three!!! Thanks dude!
Made my day.
Copy link to clipboard
Copied
Hi all,
opensourcemediaframework.com is now gone and it looks like Adobe is gone in regards to OSMF as well. http://www.osmf.org is dead also, so so much for Open Source I guess. Too bad I trusted Adobe and too bad for my client that built a business model based on Adobe technology 😕
Anyone knows where I can find source code from versions beyone 2.0? Like the 2.0.71 version mentioned above in this thread?
Thanks!
Copy link to clipboard
Copied
Try http://osmf.org/
Copy link to clipboard
Copied
Sure, but did you look at that site? Tons of dead links and the SourceForge repo was last updated for the 2.0 launch almost 1.5 years ago. In other words - not a single bug fix in two years?
I've found a couple Github repositories that seem to have taken over where Adobe dropped the ball though. Will try my luck there.
J
Copy link to clipboard
Copied
Hi,
I have changed as mention above in HttpNetStream.as class but still it is not working. Can you please advise how it is working at your end?
Best regards,
Copy link to clipboard
Copied
Hi,
Workflow is this;
1. Set up the OSMF project as a separate,shared coding library.
2. Delete the reference to the OSMF .swc that is used by default when you select an SDK.
3. Use the OSMF project as a project dependency
4. You should now be using the library you downloaded in place of the SWC from the SDK and you should be able to stop on break points etc.
G
Copy link to clipboard
Copied
Hi,
Thanks a lot for your kind support. I have tried that but I can't see that HttpNetStream.as class not executing.
Can you please advise why HttpNetStream.as class not working? Do I need to extends it? If yes, then please advise me how to extends this class.
Best regards,
Sunil Kumar
Copy link to clipboard
Copied
Sorry for delay, no, don't extend - OSMF won't see extended class as the classes in use are referenced explicitly in the code.
The most probable issue is that you are using the pre-compiled OSMF library and not your imported library.
G