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

Changing manifest URI when initializating cast app #3595

Closed
ScripterYoda opened this issue Aug 23, 2021 · 7 comments
Closed

Changing manifest URI when initializating cast app #3595

ScripterYoda opened this issue Aug 23, 2021 · 7 comments
Labels
platform: Cast Issues affecting Cast devices priority: P4 Nice to have / wishful thinking status: archived Archived and locked; will not be updated status: will not implement The team chooses not to implement this enhancement type: enhancement New feature or request

Comments

@ScripterYoda
Copy link

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

What version of Shaka Player are you using?
3.1.0

Can you reproduce the issue with our latest release version?
Yes

Can you reproduce the issue with the latest code from master?
Yes

Are you using the demo app or your own custom app?
Custom

What did you do?
I want to have possibility to change manifest URI inside receiver app (our manifest have one codec assets so I want to VP9 manifest if possible and H264 manifest otherwise). Now, there is a contentIdCallback that I can pass while initializating CastReceiver.

What did you expect to happen?
I would expect that the contentIdCallback would always properly change url.

What actually happened?
contentIdCallback is only called with LOAD generic message but not with INIT shaka message or ASYNC CALL iwth load shaka message. Therefore, I have now no way to change my manifest URI.

@theodab
Copy link
Contributor

theodab commented Sep 16, 2021

If we did add something like this, contentIdCallback would not be the right place to put it. That is meant to turn contentId values into URIs, not URIs into other URIs. Changing it might break other peoples apps.
We could add a separate callback for this, I suppose?

In the meantime, though... you might be able to solve this problem with a custom network scheme plugin. Like, you could call player.load with a synthetic URI that contains the real URI, then have a custom scheme plugin redirect the request to the correct URI.
So the scheme plugin would look something like:

shaka.net.NetworkingEngine.registerScheme('fake', (uri, request, requestType, progressUpdated, headersReceived) => {
  const realUri = uri.split('fake:')[1];
  const finalUri = realUri; // TODO: Determine which codec asset URI to load.
  // I don't remember offhand if Chromecasts support the Fetch API, so use XHR to be safe.
  return shaka.net.HttpXHRPlugin.parse(finalUri, request, requestType, progressUpdated, headersReceived);
});

Then you'd just append fake: to the start of the URI you want to load, and let this scheme plugin determine the actual asset to load.

@theodab theodab added type: enhancement New feature or request priority: P4 Nice to have / wishful thinking and removed needs triage labels Sep 16, 2021
@shaka-bot shaka-bot added this to the Backlog milestone Sep 16, 2021
@joeyparrish
Copy link
Member

If you are happy manipulating the URI in a scheme plugin, I would make one tweak to @theodab's recommendation. Instead of calling directly into shaka.net.HttpXHRPlugin, I would recommend modifying the request object's uris field and then calling NetworkingEngine.request(). That way, you are not hard-coding the name of a plugin that may someday be deprecated.

If this solution doesn't work for you or it is too cumbersome, we could offer a new callback.

@ProtoScott
Copy link

Hey @joeyparrish we would be really interested in getting a callback prior to the initialisation of the shaka player.

Our desire would be to modify the config object to include a max resolution for certain chromecasts which we would do on initialisation. Or other things like changing the DRM url.

@joeyparrish
Copy link
Member

We already set the max resolution to 1080p or 4k based on the device and display capabilities on ChromeCast. This is done in CastReceiver by calling Player.setMaxHardwareResolution. You can this yourself at any time after the CastReceiver constructor to change the maximum. You can also use a request filter on the receiver-side Player to change the manifest or DRM URLs.

@ProtoScott
Copy link

We already set the max resolution to 1080p or 4k based on the device and display capabilities on ChromeCast. This is done in CastReceiver by calling Player.setMaxHardwareResolution. You can this yourself at any time after the CastReceiver constructor to change the maximum. You can also use a request filter on the receiver-side Player to change the manifest or DRM URLs.

So setting the max hardware resolution / setting up a request filter would be fine, but it's unclear (or possibly not possible) to send custom data as part of the chromecast setup where we can make a decision to set these?

The use case here is that some old chromecasts say they support 4K but their performance causes visual artifacts, for this we want to override the default behaviour and limit to 1080p but only for people that choose the option because they are experiencing a problem.

@avelad avelad added the platform: Cast Issues affecting Cast devices label May 25, 2022
@avelad
Copy link
Member

avelad commented May 25, 2022

@joeyparrish I'm not sure we want to support this, since we want to do #4214 in the future

@joeyparrish
Copy link
Member

Yes, obsolete now. Thanks!

@joeyparrish joeyparrish added the status: will not implement The team chooses not to implement this enhancement label May 25, 2022
@joeyparrish joeyparrish removed this from the Backlog milestone May 25, 2022
@github-actions github-actions bot added the status: archived Archived and locked; will not be updated label Jul 24, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform: Cast Issues affecting Cast devices priority: P4 Nice to have / wishful thinking status: archived Archived and locked; will not be updated status: will not implement The team chooses not to implement this enhancement type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants