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

Shaka does not autoplay when the stream starts with a gap #2987

Closed
lemonwhale opened this issue Nov 13, 2020 · 16 comments
Closed

Shaka does not autoplay when the stream starts with a gap #2987

lemonwhale opened this issue Nov 13, 2020 · 16 comments
Assignees
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@lemonwhale
Copy link

lemonwhale commented Nov 13, 2020

Have you read the FAQ and checked for duplicate open issues?
Yes

What version of Shaka Player are you using?
3.0.5

Can you reproduce the issue with our latest release version?
Yes, 3.0.5 is the latest I can find

Can you reproduce the issue with the latest code from master?
Yes

Are you using the demo app or your own custom app?
Yes, both

If custom app, can you reproduce the issue using our demo app?
Yes

What browser and OS are you using?
Mac OS 10.15.6 and Chrome.

For embedded devices (smart TVs, etc.), what model and firmware version are you using?
n/a

What are the manifest and license server URIs?
manifest (not encrypted)
"https://lbs-usp-dash-live.cmore.se/group05/debug/live.isml/.mpd?t=2020-11-12T12%3A30%3A00.000-2020-11-12T12%3A45%3A00.000"

What did you do?
I start playing it in your demo player and in my own player respectively. Hence, we have jumpLargeGaps = true

What did you expect to happen?
I expect the stream to start playing in the demo player, since other streams we have autoplay in the very same player. If we press play the stream starts. In my own player, I notice that the "canplaythrough" event, is not dispatched, and we use this to enable video controls. So our own player is not possible to start.

What actually happened?
In the demo player, the stream had to be manually started. In my own player, the controls are never visible. If there is another event from shaka to indicate that the player is ready, I am happy to change canplaythrough to that event, to solve this issue.

@joeyparrish
Copy link
Member

@lemonwhale, I was just informed by email that this is working in dash.js. For comparison, and to help us debug, can you please try this stream in dash.js and Shaka Player and compare the buffered ranges presented in each?

const b = videoElement.buffered;
console.log('Buffered ranges: ' + b.length);
for (let i = 0; i < b.length; ++i) { console.log(b.start(i) + ' - ' + b.end(i)); }

@dirk-unified
Copy link

dirk-unified commented Jan 20, 2021

Hi Joey,

Two screenshots as I do not have player versions up where I easily can insert code, I hope this helps.

  • dashjs (with debug info / buffer length)

dashjs

  • shaka (which shows video length of 15:03, download of fragments but no play)

shaka

@joeyparrish
Copy link
Member

Can you run the following code in the JS console with both players? You don't need to insert code into the player itself. This will tell us what the buffered ranges are for the two players, which will help us understand the difference between them.

const b = videoElement.buffered;
console.log('Buffered ranges: ' + b.length);
for (let i = 0; i < b.length; ++i) { console.log(b.start(i) + ' - ' + b.end(i)); }

@dirk-unified
Copy link

dirk-unified commented Jan 21, 2021 via email

@joeyparrish
Copy link
Member

I should have been more specific about the video element. That's whatever the actual video element is, not a literal variable I expect to be predefined.

If there's only one video element on the page, this should do it:

const videoElement = document.querySelector('video');

@dirk-unified
Copy link

dirk-unified commented Jan 22, 2021 via email

@dirk-unified
Copy link

skaka2

Same happens in Dash.js,

dashjs2

@lemonwhale
Copy link
Author

Sorry for being absent in the conversation, been working on other stuff. Thanks both of you for looking at this. I will try the suggestion above.

@lemonwhale
Copy link
Author

For Shaka player:
Buffered ranges: 1
1.996 - 63.996

@lemonwhale
Copy link
Author

lemonwhale commented Jan 22, 2021

For Dash.js
Buffered ranges: 1
1.996 - 23.996
hence: I ran the log as quick after the start as possible.

@lemonwhale
Copy link
Author

@joeyparrish Did you see the logs above?

@dirk-unified
Copy link

Hi Joey, Any news on this?

@ismena
Copy link
Contributor

ismena commented Feb 11, 2021

Hi gentlemen, sorry for the delay!

@TheModMaker Can I drag you into this as a gap expert, if you have some time?

@dirk-unified @lemonwhale if both our gap experts are too busy (as in - if there's no news on this in the next few days), please feel free to ping me next week. It'll be a little slower as I'm not as familiar with our gap logic, but I'll do my best! :)

@joeyparrish
Copy link
Member

I believe I've found a bug in the GapJumpingController component that has been there since the beginning. I believe I have a fix that makes autoplay work correctly on this content.

In essence, we don't want to jump ahead while paused. But when playback starts, the video is automatically in a "paused" state. With autoplay set on the video, as soon as we jump ahead to the first buffered range, playback starts. So the fix is to allow jumping ahead if we're paused at time 0, but not paused elsewhere.

@joeyparrish joeyparrish added type: bug Something isn't working correctly and removed needs triage labels Feb 16, 2021
@shaka-bot shaka-bot added this to the v3.1 milestone Feb 16, 2021
@lemonwhale
Copy link
Author

Awesome. That sounds very promising. Any rough estimate when we can get this fix for test and production?

@joeyparrish
Copy link
Member

The fix got held up in code review, but it just landed in the master branch. I should be able to push out a v3.0.9 some time next week.

joeyparrish added a commit that referenced this issue Feb 25, 2021
If a VOD asset does not start at time 0, we should jump to the time at
which it does start.  Until we jump, even with autoplay set to true,
the video remains in a paused state.

Therefore we can't inhibit autoplay based on the paused state alone.
Instead, we should only inhibit autoplay if we're paused at a time
other than 0.  If we're paused at 0, we're trying to start playing, so
we should jump that initial gap to allow autoplay to work.

Closes #2987

Change-Id: Ie55ab0ec6662afcbd01e3c5e71b659aae84372b5
joeyparrish added a commit that referenced this issue Mar 10, 2021
If a VOD asset does not start at time 0, we should jump to the time at
which it does start.  Until we jump, even with autoplay set to true,
the video remains in a paused state.

Therefore we can't inhibit autoplay based on the paused state alone.
Instead, we should only inhibit autoplay if we're paused at a time
other than 0.  If we're paused at 0, we're trying to start playing, so
we should jump that initial gap to allow autoplay to work.

Closes #2987

Backported to v2.5.x

Change-Id: Ie55ab0ec6662afcbd01e3c5e71b659aae84372b5
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 21, 2021
@shaka-project shaka-project locked and limited conversation to collaborators Apr 21, 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

6 participants