Skip navigation
Currently Being Moderated

OSMF with HTTP stream seeking is resetting start index...

Aug 23, 2012 3:06 AM

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

 
Replies
  • Currently Being Moderated
    Mar 25, 2013 5:07 AM   in reply to Gaius Coffey

    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!

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 26, 2013 9:59 AM   in reply to ignatev_me

    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!

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 11, 2013 1:01 PM   in reply to Gaius Coffey

    Works for me three!!! Thanks dude!

    Made my day.

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 31, 2013 3:23 AM   in reply to Phogelius

    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!

     
    |
    Mark as:
  • Currently Being Moderated
    Oct 31, 2013 3:42 AM   in reply to Jens Chr
     
    |
    Mark as:
  • Currently Being Moderated
    Oct 31, 2013 5:13 AM   in reply to Phogelius

    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

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points