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

#t=0 anchor link no longer starts playback of live stream automatically if "calcFromSegmentTimeline" set to true #3813

Closed
5 tasks done
tomraut opened this issue Nov 17, 2021 · 13 comments
Assignees
Labels
Milestone

Comments

@tomraut
Copy link

tomraut commented Nov 17, 2021

Environment
Steps to reproduce

Start playing mentioned stream. Player loads but user needs to either toggle pause => play or tickle the timeline in order for stream to start to actually play.

Observed behavior

This happens only with dash.js v4.1.0. I've tested the same using v3.2.2 and there everything works without any issues.

@dsilhavy
Copy link
Collaborator

@tomraut can you please check if your problem is fixed here: #3815 . The changes should be available in the nightly build soon: http://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html

@dsilhavy dsilhavy self-assigned this Nov 17, 2021
@tomraut
Copy link
Author

tomraut commented Nov 18, 2021

@dsilhavy yep, seems to be fixed! Awesome!

@tomraut
Copy link
Author

tomraut commented Nov 18, 2021

@dsilhavy I may have been too fast to give you test result. When testing with another stream, it is still not fixed. Not sure if ?t= parameter has something to do with this.

Following kind of stream still requires user to tickle timeline:
https://mtv-live-simulcast.cdn.katsomo.fi/live/E6USP/E6USP.isml/E6USP.mpd?t=2021-11-18T06%3A07%3A00.000Z-2021-11-18T07%3A24%3A47.000Z#t=0

@dsilhavy
Copy link
Collaborator

I cant check this stream seems to be DRM protected. Does it start when you omit the t parameter?

@tomraut
Copy link
Author

tomraut commented Nov 18, 2021

@dsilhavy I've done some debugging and I think reason for this not working in our player is this code:

const currentTime = getNormalizedTime();
const actualTime = getActualPresentationTime(currentTime, mediaType);
const timeChanged = (!isNaN(actualTime) && actualTime !== currentTime);
if (timeChanged && !isSeeking() && (isStalled() || playbackStalled || videoModel.getReadyState() === 1)) {
logger.debug(`UpdateCurrentTime: Seek to actual time: ${actualTime} from currentTime: ${currentTime}`);
seek(actualTime);
}

When testing same stream (https://mtv-live-simulcast.cdn.katsomo.fi/live/E39USP/E39USP.isml/E39USP.mpd?t=2021-11-18T09%3A00%3A00.000Z-2021-11-18T10%3A34%3A58.000Z#t=0) using reference player and DEBUG logging enabled, I see that it logs this row:
[5938][PlaybackController] UpdateCurrentTime: Seek to actual time: 1637226011.6115 from currentTime: 1637226011.2625

But with DEBUG logging enabled in our player, this is not logged. I've added console logging and re-built dash.js locally and found out that when started same stream in our player, both

const currentTime = getNormalizedTime();
const actualTime = getActualPresentationTime(currentTime, mediaType);

gets exactly same value (1637226055.04) so it never goes inside if clause to execute seek(actualTime);

I'm not sure why on reference page those values get 0.3490 difference but in our player difference is 0.

@tomraut
Copy link
Author

tomraut commented Nov 19, 2021

@dsilhavy If I test our player with stream without ?t parameter (https://mtv-live-simulcast.cdn.katsomo.fi/live/E39USP/E39USP.isml/E39USP.mpd#t=0), I see that updateCurrentTime is called several times before eventually DVRWindow.start changes and it proceeds to if clause applying seek and stream starts:

*** currentTime:  1637294656.64 DVRWindow: {start: 1637294656.64, end: 1637301856.64}
*** currentTime:  1637294656.64 DVRWindow: {start: 1637294656.64, end: 1637301856.64}
*** currentTime:  1637294656.64 DVRWindow: {start: 1637294656.64, end: 1637301856.64}
*** currentTime:  1637294656.64 DVRWindow: {start: 1637294660.48, end: 1637301860.48}
[4997][PlaybackController] UpdateCurrentTime: Seek to actual time: 1637294660.48 from currentTime: 1637294656.64 

So it seems to me that when there is a ?t parameter in the manifest URL, DVRWindow.start is locked to that moment exactly and logic in updateCurrentTime method no longer works as it relies on the fact that at some point in dynamic streams currentTime differs from DVRWindow.start.

@dsilhavy
Copy link
Collaborator

  • If you omit #t there should be no seek coming from updateCurrentTime. However, startup might take a while if you don't adjust the live delay or enable calcFromSegmentTimeline
  • In my tests on nightly https://reference.dashif.org/dash.js/nightly/samples/dash-if-reference-player/index.html the stream starts every time event if I limit the available bandwidth in the network panel (in case there is no ?t in the URL)
  • Adding ?t to the url should have no effect on dash.js itself

@tomraut
Copy link
Author

tomraut commented Nov 19, 2021

@dsilhavy if I toggle "Calculate segment availability from timeline" ON when using reference player, then stream https://mtv-live-simulcast.cdn.katsomo.fi/live/E39USP/E39USP.isml/E39USP.mpd?t=2021-11-19T09%3A00%3A00.000Z-2021-11-19T10%3A34%3A58.000Z#t=0 does not start and I have to tickle timeline also with reference player in order to start playback.

Should this be considered a bug or a feature?

@dsilhavy
Copy link
Collaborator

Looks like a timing issue, would need to check this in detail. It starts after some time though even without manually seeking.

@tomraut tomraut changed the title #t=0 anchor link no longer starts playback of live stream automatically #t=0 anchor link no longer starts playback of live stream automatically if "calcFromSegmentTimeline" set to true Nov 22, 2021
@dsilhavy dsilhavy added this to the 4.2.1 milestone Dec 8, 2021
@dsilhavy
Copy link
Collaborator

@tomraut Can you confirm that #3833 fixes the issue? I applied a minor offset to not interfere with MSE seekable range. It looked good in my tests.

@dsilhavy
Copy link
Collaborator

Fixed in #3833

@tomraut
Copy link
Author

tomraut commented Dec 20, 2021

@dsilhavy I see you already closed this one, but just to confirm: I've tested your fix and it works for me as well in our setup. Thank you very much!

@dsilhavy
Copy link
Collaborator

@tomraut Thank you for verifying

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants