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

SegmentReference.getUris doesn't appear in compiled bundle #3096

Closed
IbraheemNofal opened this issue Jan 13, 2021 · 5 comments
Closed

SegmentReference.getUris doesn't appear in compiled bundle #3096

IbraheemNofal opened this issue Jan 13, 2021 · 5 comments
Assignees
Labels
status: archived Archived and locked; will not be updated type: bug Something isn't working correctly
Milestone

Comments

@IbraheemNofal
Copy link

Have you read the Tutorials?
Yes

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

What version of Shaka Player are you using?
v3.0.6

Please ask your question
So I'm currently trying to get a list of segment URLS for the stream that's playing. I've managed to get a list of segments by using player.getManifest().variants[14]['video'].createSegmentIndex() and then using stream.segmentIndex. But even then, I've found no way of retrieving a list of segment URLS even though #1074 suggests that it should be possible using segment.createUris(). But, createUris() is deprecated now. Please note, that I'm currently testing this using the video and approach under basic usage, so it's a dash video stream, not a live stream. Ideally, I'd like to be able to do the same for both HLS and Dash, just so I can pre-warm the cache with segment Uris.

@IbraheemNofal IbraheemNofal added the type: question A question from the community label Jan 13, 2021
@michellezhuogg
Copy link
Contributor

Hello,

Would you please try:
stream.segmentIndex.references[0].getUris() ? Let us know if it works for you. Thank you!

@michellezhuogg michellezhuogg added the status: waiting on response Waiting on a response from the reporter(s) of the issue label Jan 28, 2021
@IbraheemNofal
Copy link
Author

IbraheemNofal commented Jan 31, 2021

Not working. I'm getting an error:

myapp.js:73 Uncaught (in promise) TypeError: Cannot read property '0' of undefined
at onSegmentCreated (myapp.js:73)

Here's what I'm doing:
player.getManifest().variants[14]['video'].createSegmentIndex().then(onSegmentCreated, onSegmentCreationFailed)

and then in the onSegmentCreated function:
var stream = player.getManifest().variants[14]['video']
var list = stream.segmentIndex
console.log(list.references[0].getUris())

@shaka-bot shaka-bot removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label Jan 31, 2021
@TheModMaker
Copy link
Contributor

Try: const references = Array.from(stream.segmentIndex); references[0].getUris();.

@IbraheemNofal
Copy link
Author

Not working. I'm now getting this error:

Uncaught (in promise) TypeError: references[0].getUris is not a function
at onSegmentCreated (myapp.js:75)

@TheModMaker
Copy link
Contributor

It looks like the getUris function isn't in the compiled bundle even though it is exported. We'll look into it.

@TheModMaker TheModMaker added type: bug Something isn't working correctly and removed type: question A question from the community labels Feb 22, 2021
@TheModMaker TheModMaker added this to the v3.1 milestone Feb 22, 2021
@TheModMaker TheModMaker changed the title Getting Segment URLS for Dash, HLS SegmentReference.getUris doesn't appear in compiled bundle Feb 22, 2021
@theodab theodab self-assigned this Feb 25, 2021
joeyparrish pushed a commit that referenced this issue Mar 12, 2021
Previously, SegmentReference.getUris was listed as public field,
but not actually exported. For an object that does not have externs,
there is no way to ensure that a member variable is not renamed.
So, instead, this CL makes an exported public getUris method, that
wraps the getUrisInner member variable. This allows for the method
to be exported, without having to make an extern for the class.

Closes #3096

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

5 participants