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

Expose PresentationTimeline segment availability duration through Player #2711

Closed
Stansbridge opened this issue Jul 4, 2020 · 7 comments · Fixed by #6075
Closed

Expose PresentationTimeline segment availability duration through Player #2711

Stansbridge opened this issue Jul 4, 2020 · 7 comments · Fixed by #6075
Assignees
Labels
priority: P3 Useful but not urgent status: archived Archived and locked; will not be updated type: enhancement New feature or request
Milestone

Comments

@Stansbridge
Copy link
Contributor

Stansbridge commented Jul 4, 2020

Have you read the Tutorials?
Mostly :-)

Have you read the FAQ and checked for duplicate open issues?
I have done a solid search

What version of Shaka Player are you using?
2.5.5 - precompiled NPM package

Please ask your question
I'd like to access the MPD timeShiftBufferDepth value which is stored inside PresentationTimeline.segmentAvailabilityDuration_.

There doesn't appear to me to be an idiomatic way to retrieve this value without either:
a) re-implementing the current DashParser as a plugin with a custom escape-hatch or event emission
b) maintaining a fork of Shaka to expose this value as an external

I have figured I can actually almost retrieve this, if I was really determined, by reversing the logic within Shaka source (please forgive me):

const { presentationTimeline } = player.getManifest();
presentationTimeline.setUserSeekStart(-Infinity);
const start = presentationTimeline.getSegmentAvailabilityStart();
const end = presentationTimeline.getSegmentAvailabilityEnd();
const timeShiftBufferDepth = end - start

I'm hoping there is something nicer that isn't using getManifest() which has clearly begun a deprecation process. Thanks!

@Stansbridge Stansbridge added the type: question A question from the community label Jul 4, 2020
@TheModMaker
Copy link
Contributor

Why would you need this value? The main reason I would think you'd want this is to determine the seek range. In this case, you can use player.seekRange() to get the seekable ranges and can use the difference to find the size. This will approximately be that value, but accounts for things like recently started live streams.

@Stansbridge
Copy link
Contributor Author

Stansbridge commented Jul 6, 2020

Thanks @TheModMaker

The main reason I would think you'd want this is to determine the seek range

Yes, correct. In most cases we are happily using player.seekRange().

We would like to access the value of PresentationTimeline.segmentAvailabilityDuration_ to understand what the future expected duration of a stream will be. We maintain long DVR windows and it is valuable for us to know the manifest value in advance. Specifically for our particular use case, we need this value to ensure our UI is rendering correctly in certain edge cases.

@joeyparrish
Copy link
Member

What do you mean about the "future duration" of a stream? How does what you want differ from player.seekRange()?

@shaka-bot
Copy link
Collaborator

@Stansbridge Does this answer all your questions? Can we close the issue?

@shaka-bot shaka-bot added the status: waiting on response Waiting on a response from the reporter(s) of the issue label Aug 25, 2020
@shaka-bot
Copy link
Collaborator

Closing due to inactivity. If this is still an issue for you or if you have further questions, you can ask us to reopen or have the bot reopen it by including @shaka-bot reopen in a comment.

@shaka-bot shaka-bot removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label Sep 1, 2020
@Stansbridge
Copy link
Contributor Author

@joeyparrish

What do you mean about the "future duration" of a stream?

Sorry for the ambiguity - We would like to access the value of PresentationTimeline.segmentAvailabilityDuration_ to estimate the future dvr window length.

How does what you want differ from player.seekRange()?
This accounts only for the current range of time that seeking is allowed.

For example:

If a stream has been live for 10 minutes with a tsbd value set to PT3H we could expect player.seekRange() to provide a dvr window of 600 seconds but the internal value of PresentationTimeline.segmentAvailabilityDuration_ to be 10800.

Access to this value is really useful to us. If the Shaka team disagrees then we will continue using our workaround. Thank you!

@joeyparrish
Copy link
Member

Ah, I see. You want to know the full DVR window, but there may not yet be enough content to fill it. That's very reasonable. I'll reopen this as a feature request.

@joeyparrish joeyparrish reopened this Sep 9, 2020
@joeyparrish joeyparrish added type: enhancement New feature or request and removed type: question A question from the community labels Sep 9, 2020
@joeyparrish joeyparrish changed the title Retrieving timeShiftBufferDepth value Expose PresentationTimeline segment availability duration through Player Sep 9, 2020
@shaka-bot shaka-bot added this to the Backlog milestone Sep 9, 2020
@joeyparrish joeyparrish added the priority: P3 Useful but not urgent label Oct 4, 2021
@avelad avelad modified the milestones: Backlog, v5.0 Jan 10, 2024
@avelad avelad self-assigned this Jan 10, 2024
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Mar 10, 2024
@shaka-project shaka-project locked as resolved and limited conversation to collaborators Mar 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
priority: P3 Useful but not urgent status: archived Archived and locked; will not be updated type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants