Orange-OpenSource / hasplayer.js

Http Adaptive Streaming javascript player based on HTML5 premium extensions (MSE/EME)
Other
198 stars 67 forks source link

Working with DVRWindow in MSS live stream #232

Closed IcoDeveloper closed 5 years ago

IcoDeveloper commented 6 years ago

When working witjh DVR Window in MSS live stream, I'm having some problems getting back to live position after pausing / repositioning: getDVRWindowRange does not update if the player is paused or if seek to a position within the DVR Window. I can get it to update to current status by calling refreshManifest(); once this finishes, it triggers an event manifestLoaded. Adding an EventListener to this event doesn't work for be because it's not specified in MediaPlayer.js in the list of public events. Is my workflow for getting back to live after seeking into the DVRWindow reosonable or should I do this some other way?

refreshManifest()
manifestLoadedEventReceiver:
 getDVRWindowRange()
seek to range.end   
bbert commented 6 years ago

In MSS DVR mode, if you do a pause or seek, the player with download the FragmentInfo segments to update DVR window. So, firstly you have to check (using devtools of your browser) if the FragmentInfo segments are successfully downloaded by the player.

IcoDeveloper commented 6 years ago

Just checked: Yes, the Fragmentinfo requests are going out:

Debug.js:94 [15:18:45.244][MssFragmentInfoController][audio] Load request  http://streamsrv.icomedias.com/encoders/BoardRoomA/live.isml/Events(2018_4_3_9_2_32)/QualityLevels(64000)/FragmentInfo(audio=94720000000) 
Debug.js:94 [15:18:45.249][MssFragmentInfoController][video] Load request  http://streamsrv.icomedias.com/encoders/BoardRoomA/live.isml/Events(2018_4_3_9_2_32)/QualityLevels(200000)/FragmentInfo(video=94729116666) 

However, I'm not seeing any changes to getDVRWindowRange()

bbert commented 6 years ago

Do you have a test stream so that we can check this issue?

IcoDeveloper commented 6 years ago

http://icostreaming.streaming.mediaservices.windows.net/d6d20089-230d-480e-96ed-0de539f12948/5749eca8-a9d0-40fd-a36f-3c53f60c25ef.ism/manifest is currently playing

IcoDeveloper commented 6 years ago

Sorry, actually works with the public address (via azure media services). same stream on Microsoft IIS w/ media extensions: http://streamsrv.icomedias.com/encoders/BoardRoomA/live.isml/manifest

bbert commented 6 years ago

I tested http://icostreaming.streaming.mediaservices.windows.net/d6d20089-230d-480e-96ed-0de539f12948/5749eca8-a9d0-40fd-a36f-3c53f60c25ef.ism/manifest and it works fine. DVRWindowRange is correctly updated when you do seek or pause. FYI information, in the Dash-IF sample webapp, the control bar is the browser default one, so it does not reflect DVR window range. You have to implement your control bar. But you still can anyway check in the console: mediaPlayer.getDVRWindowRange()

IcoDeveloper commented 6 years ago

I think I got it: <SmoothStreamingMedia MajorVersion="2" MinorVersion="2" Duration="0" TimeScale="10000000" IsLive="TRUE" LookAheadFragmentCount="2" DVRWindowLength="0" CanSeek="TRUE" CanPause="TRUE"> DVRWindowLength 0 means that DVR is available for the whole recording, i.e. unlimited. Check for manifest.timeShiftBufferDepth > 0 doesn't work and skips updating the window.

bbert commented 6 years ago

OK. Indeed we had not yet considered infinite DVR window. It does not seem actually supported.

IcoDeveloper commented 6 years ago

I've prepared a patch that allows DVR Window Range to be incremented for infinite size; it uses the "CanSeek" Property from the manifest to differentiate no DVR Window vs. infinite DVR Window.

bbert commented 6 years ago

Hi, Have you checked my review on your PR? Let us know.

IcoDeveloper commented 6 years ago

No, haven't seen that. Just checked again and I don't see any reviews on the PR

bbert commented 6 years ago

Please look at "Files changed": https://github.com/Orange-OpenSource/hasplayer.js/pull/233/files/e945bc202939111fffc630cb4ced48e76f6ad653

IcoDeveloper commented 6 years ago

Sorry, Still don't see anything. No Comments or review show up for me. hasplayer_screenshot1 hasplayer_screenshot2

bbert commented 6 years ago

Sorry, my fault, you should see it now

vitalist82 commented 5 years ago

Hello, for following live manifests, the fix above doesn't work because of the missing canSeek attribute and duration equal to 0: https://dcblivedazn.akamaized.net/sjigh39hytuv193u4n6068wke/tv.ism/Manifest?outlet=dazn-italy&channel=3043&h=c3ecf9c8c8f5b97802e2fd300c2e547b&plang=en https://m2a-dazntest-origin-pool1a.m2amedia.services/channel9002/stream.isml/Manifest

Do you think this is something to be solved on the player level, or should such manifest not be considered as live as it has duration?

vitalist82 commented 5 years ago

From specification it looks that live manifests should have duration set to 0 when it isn't known in advance: https://msdn.microsoft.com/en-us/library/ee673438%28v=vs.90%29.aspx?f=255&MSPPError=-2147217396

bbert commented 5 years ago

The manifests you provided are live manifests (IsLive="TRUE" and Duration="0"). So the player handles these streams as live streams.

vitalist82 commented 5 years ago

@bbert but manifest.timeShiftBufferDepth is 0 and DVR window is never updated.

bbert commented 5 years ago

@vitalist82 sorry but I am not sure I understood your problem. How would you like the player to behave with the manifests you provided?

vitalist82 commented 5 years ago

@bbert I'd expect, that the player updates DVR window periodically, so that player.getDVRWindowRange() returns an updated value and after seeking back in the stream and playing for some time it is possible to return back to live position. Current behavior is that after seeking back to a position close to live edge, the player throws 'MediaPlayer.seek(): seek value outside available time range'.

bbert commented 5 years ago

OK, so it has nothing to do with CanSeek parameter. I notice that DVRWindowLength field is missing only in the manifest https://dcblivedazn.akamaized.net/sjigh39hytuv193u4n6068wke/tv.ism/Manifest?outlet=dazn-italy&channel=3043&h=c3ecf9c8c8f5b97802e2fd300c2e547b&plang=en But I can't play this manifest since the stream is protected/encrypted. Can you provide the licenser url?

vitalist82 commented 5 years ago

The authentication token is sent in the body of the LA request, so the URL won't suffice. The other manifest is a test one, which doesn't use encryption. If you need access to the encrypted stream, I can create a temporary account for you on our staging environment and potentially whitelist your IP.

bbert commented 5 years ago

@vitalist82 Indeed, there is an issue when DVRWindowLength field is missing for live streams. Although CanSeek field is missing. Therefore I confirm the DVR window range is never updated. But what do you expect for the value of DVRWindowLength in this case: Infinity? or segment timeline length?

According to the MSDN specification (https://msdn.microsoft.com/en-us/library/ff469578.aspx), if the DVRWindowLength field is omitted for a live presentation or set to 0, the DVR window is effectively infinite.

vitalist82 commented 5 years ago

@bbert I think we can stick to the specification and have DVRWindowLength set to Infinity. The main issue in our case was, that after making a seek call to a position close to the end of the stream the player throws an error. This will be resolved after DVR window range will be updated.

bbert commented 5 years ago

OK, so the change is very minor. I will do a new PR.

bbert commented 5 years ago

@vitalist82 Can you try PR #240 and let me know if it solves your issue?

vitalist82 commented 5 years ago

@bbert it resolves the issue in IE11/Edge. I am going to check with SkyQ STB.

vitalist82 commented 5 years ago

On SkyQ STB the issue is resolved as well with your PR.