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

Fix seekable range on VOD HLS streams with minimum timestamp #1602

Closed

Conversation

mikrohard
Copy link

I noticed that some of our VOD HLS streams don't start playback from 0 position when using shaka player. What is more you can't even seek to 0 position. After some debugging I found out that seekable range isn't correct (e.g. for one content the range was from 4200 seconds to 2700 seconds, 2700 seconds was the duration of the content and shaka player immediately seeked to this position & only played a few seconds before the end). I noticed that presentation timelines first segment start time is set before segments are offset back to 0 in hls parser. Calling notifySegments after applying the offset instead of before fixes this issue for me. One warning at this point... we just started using shaka player & I'm not familiar with the codebase... which means that I'm not sure if this can affect anything else.

… HLS segments. This fixes seek range on HLS VOD streams where minimum timestamp isn't zero.
@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

@mikrohard
Copy link
Author

I signed it!

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

@mikrohard
Copy link
Author

I signed it!

@googlebot
Copy link

CLAs look good, thanks!

@TheModMaker
Copy link
Contributor

Thanks for finding this. But I don't think this is the correct fix. notifySegments_ uses a stored array of segments, which may not be edited by offsetting the segments (and if it is, we shouldn't assume it). I think a better fix would be to add an offset method to PresentationTimeline to adjust the timeline like we adjust the segments. Also please update the tests and ensure this is handled by a test (e.g. editing the sets maxFirstSegmentTime test from test/hls/hls_parser_unit.js).

Or if you would prefer, I could implement this instead.

@mikrohard
Copy link
Author

It would be probably best if you do it because you know better how & why it works as it does. If I add the offset to the PresentationTimeline to fix the seek range it would actually break the sets maxFirstSegmentTime test (where you expect the getSeekRangeStart to be greater than 0... but this exactly is the root issue I'm trying to fix).

@joeyparrish
Copy link
Member

Fix released in v2.5.0-beta2.

@mseeley mseeley mentioned this pull request Feb 7, 2019
joeyparrish pushed a commit that referenced this pull request Feb 8, 2019
Closes #1602

Change-Id: Ibe39f71c47f39235ac3815cb0f5bb49482f4fd53
@joeyparrish
Copy link
Member

Cherry-picked to v2.4.x for release in v2.4.7.

@joeyparrish joeyparrish added the type: bug Something isn't working correctly label Feb 8, 2019
@joeyparrish joeyparrish added this to the v2.5 milestone Feb 8, 2019
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 25, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 25, 2023
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

Successfully merging this pull request may close these issues.

4 participants