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

Support Cast default media receiver app ID #10

Open
martinms-usc opened this issue Feb 3, 2021 · 0 comments
Open

Support Cast default media receiver app ID #10

martinms-usc opened this issue Feb 3, 2021 · 0 comments

Comments

@martinms-usc
Copy link

martinms-usc commented Feb 3, 2021

At this point CastProvider does not default to using the DEFAULT_MEDIA_RECEIVER_APP_ID included with the cast framework when initializing CastContext via cast.framework.CastContext.getInstance().setOptions().

It is not possible to pass this as a prop to the component since that component is both loading the SDK chrome.cast as well as initializing context with the receiverApplicationId. An undefined receiverApplicationId will error, and chrome.cast.media cannot be referenced by the parent of the component that loads it.

Suggested changes to CastProvider:

const defaultId = window.chrome.cast?.media?.DEFAULT_MEDIA_RECEIVER_APP_ID;
window.cast.framework.CastContext.getInstance().setOptions({
   receiverApplicationId: receiverApplicationId || defaultId,
   resumeSavedSession,
   autoJoinPolicy,
   language
});

documentation: https://developers.google.com/cast/docs/chrome_sender/integrate#initialization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant