Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The playback get stuck after replay #979

Closed
yairans opened this issue Aug 20, 2017 · 29 comments
Closed

The playback get stuck after replay #979

yairans opened this issue Aug 20, 2017 · 29 comments
Assignees
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@yairans
Copy link

yairans commented Aug 20, 2017

Have you read the FAQ and checked for duplicate issues: Yes

Are you using the demo app or your own custom app: demo app

What browser and OS are you using: Chrome 60 on MacOS Sierra 10.12

What are the manifest and license server URIs:
https://qa-nginx-vod.dev.kaltura.com/dash/p/1091/sp/109100/serveFlavor/entryId/0_wifqaipd/v/2/flavorId/0_,m131krws,5407xm9j,xcrwyk2n,ep7yqavp,1xcr8gnf,kozg4x1x,njhnv6na,/forceproxy/true/name/a.mp4.urlset/manifest.mpd

What did you do?
Play -> seek to close to end -> play the rest until the end -> replay -> seek to close to end -> play the rest

What did you expect to happen?
The playback should continue until the end and then the play button should appear

What actually happened?
The player get stuck at ~12.20 position

@joeyparrish
Copy link
Member

@yairans, what version of Shaka Player are you using? Can you reproduce with the latest code from master?

@yairans
Copy link
Author

yairans commented Aug 23, 2017

@joeyparrish
I'm using the latest demo app version 2.1.7-debug.
I can reproduce it also with the latest of master.
Thanks.

@joeyparrish joeyparrish added type: bug Something isn't working correctly and removed needs triage labels Aug 31, 2017
@joeyparrish joeyparrish added this to the v2.3.0 milestone Aug 31, 2017
@joeyparrish
Copy link
Member

Thank you for the detailed steps to reproduce. This was very helpful.

In my repro, I load the content, seek to 12 minutes (video.currentTime = 12 * 60), play to the end, then click play again, seek to 12 minutes again, and it does indeed get stuck at 12:20.

@joeyparrish joeyparrish self-assigned this Aug 31, 2017
@joeyparrish
Copy link
Member

When playback gets stuck, the state of streaming is:

mediaStates = shakaDemo.localPlayer_.streamingEngine_.mediaStates_
{audio: {}, video: {}, text: {}}
video.duration
741.08111
video.currentTime
740.634431
video.duration - video.currentTime
0.44667900000001737
mediaStates.audio.lastSegmentReference.endTime
744
mediaStates.video.lastSegmentReference.endTime
744
mediaStates.text.lastSegmentReference.endTime
741.081
mediaStates.audio.lastSegmentReference.updateTimer
undefined
mediaStates.audio.updateTimer
null
mediaStates.video.updateTimer
null
mediaStates.text.updateTimer
3047

We're stuck 0.44 seconds before the end of the stream, video and audio segments extend past the end of the presentation, text fills the duration exactly, and text is still trying to update for some reason.

@joeyparrish
Copy link
Member

Even clearer indication:

mediaStates.text.endOfStream
false
mediaStates.video.endOfStream
true
mediaStates.audio.endOfStream
true

@joeyparrish
Copy link
Member

If I artificially increase the text stream duration slightly (+1 second), the problem does not occur. Not a fix, just another data point.

@joeyparrish
Copy link
Member

Seems to be cause by a fudge factor introduced in c2dc1d8. The extra value added to the append window, combined with your video & audio segments extending past the nominal presentation duration, results in the video duration increasing slightly after the first end-of-stream event. After this, the text stream is no longer long enough to fill the duration.

This hack was introduced to avoid tiny, tiny gaps in multi-period playbacks, which should no longer be needed now that we have gap jumping.

joeyparrish added a commit that referenced this issue Sep 1, 2017
This hack is no longer needed to avoid gaps, since we now have a
gap-jumping implementation in the player.

The fudge factor was causing rounding errors in presentation duration
after an end-of-stream event, which could lead to playback hangs in
certain content.

Closes #979

Change-Id: I719813c8da8da08e1ebfb6daf7f6857757e7d228
@joeyparrish
Copy link
Member

The fix is in master now and will be cherry-picked to v2.2.2.

@OrenMe
Copy link
Contributor

OrenMe commented Sep 24, 2017

Hi @joeyparrish, do you know when 2.2.2 will be tagged? seems like nothing has been added to 2.2.x branch since this fix so hoping you can tag a patch version.
Thanks.

@joeyparrish
Copy link
Member

@OrenMe, I'm working on it now, and I hope to release this week. We had a small problem that prevented us from doing a release sooner, and that was fixed yesterday in 3a91c46.

@OrenMe
Copy link
Contributor

OrenMe commented Sep 27, 2017

Thanks @joeyparrish

@yairans
Copy link
Author

yairans commented Oct 8, 2017

@joeyparrish Please reopen.
Still reproduced on Edge/IE11.

@joeyparrish joeyparrish reopened this Oct 8, 2017
@joeyparrish
Copy link
Member

Reopened. We'll try to look into it again.

@joeyparrish joeyparrish removed their assignment Oct 8, 2017
@joeyparrish joeyparrish self-assigned this Dec 4, 2017
@joeyparrish
Copy link
Member

We have decided to limit seeking to duration. When a user seeks to a time >= duration (or selects a playback start time >= duration), we will seek to some fixed distance before the duration instead.

This seems to be the only consistent cross-browser solution, and it is consistent with behavior we have seen in other applications.

@OrenMe
Copy link
Contributor

OrenMe commented Dec 4, 2017

Hi @joeyparrish, I'm not sure I follow how this is related to the issue?

@joeyparrish
Copy link
Member

Sorry, I believe this is related to #1014, but I could be wrong. I expect my fix for #1014 will fix this as well.
I'll be verifying my assumptions soon, and I will report back.

@joeyparrish
Copy link
Member

joeyparrish commented Dec 4, 2017

[UPDATE]: Nightly repro URL fixed

I was wrong. The two issues are unrelated.

I am unable to reproduce this issue on Chrome or IE with the latest nightly build:
https://nightly-dot-shaka-player-demo.appspot.com/demo/#asset=https://qa-nginx-vod.dev.kaltura.com/dash/p/1091/sp/109100/serveFlavor/entryId/0_wifqaipd/v/2/flavorId/0_,m131krws,5407xm9j,xcrwyk2n,ep7yqavp,1xcr8gnf,kozg4x1x,njhnv6na,/forceproxy/true/name/a.mp4.urlset/manifest.mpd;lang=en-US;play

In both cases, I start the video, seek to around 11:30, let it play to the end (12:21), then click play again, let it start over at 0, seek to around 11:30, then let it play to the end again. On both Chrome and IE, the video reaches the end (12:21).

I find that on Chrome, when the video reaches the end state, the demo controls show the giant "play" button over the video frame. On IE, the demo controls remain in a "playing" state. To replay the video on Chrome, I click the giant play button. To replay the video on IE, I first click the "pause" button, then "play". This seems to be a bug in the demo controls on IE. I will investigate this.

In the mean time, please confirm that the original bug (stuck at 12:20) has already been fixed.

@joeyparrish
Copy link
Member

I fixed the video controls bug and pushed an update to the nightly build on appspot. Please take a look and confirm. Thanks!

joeyparrish added a commit that referenced this issue Dec 4, 2017
Closes #979

Change-Id: I4bd36e99e995be1e8ba7c0588910d2566921b357
@joeyparrish
Copy link
Member

The fix has been cherry-picked for v2.2.8.

@yairans
Copy link
Author

yairans commented Dec 5, 2017

@joeyparrish
Confirmed. it's working ok in the nightly link above (excluding the controls bug).
Thanks.

@yairans
Copy link
Author

yairans commented Feb 11, 2018

@joeyparrish
please reopen this issue.
Reproduced on ie11+win8 with v2.3.2.
Regression from v2.2.8

@yairans
Copy link
Author

yairans commented Feb 12, 2018

@joeyparrish
Actually it reproduced with v2.2.8 as well
console.log

@joeyparrish joeyparrish reopened this Feb 12, 2018
@joeyparrish
Copy link
Member

We'll take a look. Thanks!

@joeyparrish joeyparrish modified the milestones: v2.3.0, v2.4.0 Feb 12, 2018
@joeyparrish joeyparrish added needs triage and removed type: bug Something isn't working correctly labels Feb 12, 2018
@joeyparrish
Copy link
Member

joeyparrish commented Feb 28, 2018

Repro Steps:

  1. Open https://shaka-player-demo.appspot.com/demo/#asset=https://qa-nginx-vod.dev.kaltura.com/dash/p/1091/sp/109100/serveFlavor/entryId/0_wifqaipd/v/2/flavorId/0_,m131krws,5407xm9j,xcrwyk2n,ep7yqavp,1xcr8gnf,kozg4x1x,njhnv6na,/forceproxy/true/name/a.mp4.urlset/manifest.mpd;lang=en-US;build=uncompiled;play
  2. Seek close to the end (11:50)
  3. Play to the end (12:21)
  4. Hit the giant "play" button to replay
  5. Seek close to the end again (11:50)
  6. Play to the end (12:21)

At step 4, in v2.3.2 on IE 11 specifically, the giant play arrow does not show up. Investigation shows that the arrow only shows when the video is paused. On IE, video.ended == true, but video.paused == false, which is not the way other browsers behave. Normally, video.ended implies video.paused.

As a fix, we will have to check both video.ended and video.paused. Note that this only affects our custom controls in the demo app, and nothing is broken in the Shaka Player library itself.

@joeyparrish joeyparrish added type: bug Something isn't working correctly and removed needs triage labels Feb 28, 2018
@joeyparrish joeyparrish added this to the v2.4.0 milestone Feb 28, 2018
@joeyparrish
Copy link
Member

After fixing the issue in the demo controls at step 4, another issue surfaces, and the video gets stuck in a buffering state at 12:20, as in the original issue. Not sure about the cause yet.

@joeyparrish
Copy link
Member

After the first playback ends, MediaSource on IE 11 grows the duration from 741.081 to 741.081111. This rounding error is causing the buffering at the end of replay.

@joeyparrish
Copy link
Member

The chain of bad data goes from MediaSourceEngine.getDuration() to PresentationTimeline.setDuration() to PresentationTimeline.getDuration() to StreamingEngine.update_(), which prevents a call to MediaSourceEngine.endOfStream(), which affects the state of MediaSourceEngine.ended(), which affects PlayheadObserver's buffering state calculations.

@joeyparrish
Copy link
Member

We should be able to fix this in v2.3.3.

joeyparrish added a commit that referenced this issue Mar 1, 2018
This fixes both IE ended states in the demo controls and in streaming.

If StreamingEngine increases the duration of PresentationTimeline to
match MediaSource's duration, this can cause buffering at the end of
a replay by inhibiting a call to endOfStream().

Backported to v2.3.x

Closes #979

Change-Id: I6770edb69597198dee3ae1b96df31756bbf4b391
@joeyparrish
Copy link
Member

Cherry-picked for v2.3.3.

yairans added a commit to kaltura/playkit-js-dash that referenced this issue Mar 7, 2018
upgrade shaka to 2.3.3 for shaka-project/shaka-player#979 fix
fix shaka v2.3.3 text tracks issue (hidden text tracks not handled see shaka-project/shaka-player#1058) by custom text displayer
@shaka-project shaka-project locked and limited conversation to collaborators Apr 30, 2018
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Projects
None yet
Development

No branches or pull requests

4 participants