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

Add ability to intercept network requests to add additional query params or headers #148

Closed
priyajeet opened this issue Aug 4, 2015 · 6 comments
Assignees
Labels
flag: good first issue This might be a relatively easy issue; good for new contributors status: archived Archived and locked; will not be updated type: enhancement New feature or request

Comments

@priyajeet
Copy link

...or provide the ability to add additional query params or optional headers to the Player / VideoSource constructor

...or re-use the query params provided on the MPD url for network requests to the content segments.

Use case: When serving an mpd file /foo/bar.mpd?foo=bar, requests that go out to fetch the mp4 segments should also have ?foo=bar. This is useful in providing some context, auth tokens etc if needed when the MPD file is static but the content requires some additional information based on who is trying to fetch it.

Something similar is accomplished in dash.js by overriding MediaPlayer.dependencies.RequestModifierExtensions

More info: https://groups.google.com/forum/#!topic/shaka-player-users/kmT_-eVn1ZM

Thanks

@gerwinbrunner
Copy link

We would need the same. It would be awesome to have a callback for each video and being able to change the url completely for each video before loading it actually.

We are thinking of dynamically generate temporary (secure) S3 url which work for 15min per video.

@tdrews tdrews added type: enhancement New feature or request flag: good first issue This might be a relatively easy issue; good for new contributors labels Aug 4, 2015
@TheModMaker TheModMaker self-assigned this Aug 20, 2015
@tdrews
Copy link
Contributor

tdrews commented Aug 24, 2015

@priyajeet from #162 wrote

Thanks for getting this implemented. One thing I did notice was that the MPD fetching bypasses the request callback. Wouldn't requesting the MPD also go through the callback for consistancy?

By-design the API only modifies segment request URLs and headers.

For live-content, the server can specify the next MPD update URL via the <Location> element.
Do you require modifying the MPD update URLs (for live-content) client-side as well?

@priyajeet
Copy link
Author

If the contents of the MPD are being fetched from /foo/bar/baz.mpd, and the server expects some authentication headers in that request, then yeah one would need the MPD url to also go through the same interceptor. This is just for getting the static MPD. Basically anything leaving the domain of the dash library needs to be intercepted by the app before it hits the server.

@joeyparrish
Copy link
Member

@tdrews, it seems the idea is that we have a static manifest, but the server has some front-end that does authentication based on headers or parameters before serving the static content.

Seems as reasonable as the rest of the feature request, so re-opening.

@sridhard
Copy link

Hi @joeyparrish ,

Is this feature not available for the latest V2 player

@joeyparrish
Copy link
Member

@sridhard, it is definitely available and has been implemented for some time now. (This issue has been closed for over one year.)

Since you already filled a new issue for help using this feature (#531), let's discuss there. Please don't spread our conversation over multiple issues.

@shaka-project shaka-project locked and limited conversation to collaborators Mar 22, 2018
@shaka-bot shaka-bot added the status: archived Archived and locked; will not be updated label Apr 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
flag: good first issue This might be a relatively easy issue; good for new contributors status: archived Archived and locked; will not be updated type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants