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

[appID] Use Default Media Receiver when setting appID to 'default' #12

Open
youzi opened this issue Nov 26, 2015 · 2 comments
Open

[appID] Use Default Media Receiver when setting appID to 'default' #12

youzi opened this issue Nov 26, 2015 · 2 comments

Comments

@youzi
Copy link
Contributor

youzi commented Nov 26, 2015

When passing 'default'as the appID, I'd like the plugin to use the default media receiver app id, which differs per platform. This will enable us to test easily our sender apps without registering new applications/receivers.

From the docs: https://developers.google.com/cast/docs/receiver_apps :

Default Media Receiver

A third option available is the Default Media Receiver. This is a pre-built receiver application hosted by Google that is designed for streaming your audio and video content. It does not require you to register with the Google Cast SDK Developer Console, but you cannot customize any of the UI in the Default Media Receiver.

Instead of registering with the developer console to receive an app ID, you can use the Default Media Receiver with the default app ID:

For Android apps: CastMediaControlIntent.DEFAULT_MEDIA_RECEIVER_APPLICATION_ID
For Chrome apps: chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID
For iOS apps: kGCKMediaDefaultReceiverApplicationID
From your sender app, you start the Default Media Receiver app on the Cast device and then use it to load the URL to your media.

So for web use: chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID
For android use: CastMediaControlIntent.DEFAULT_MEDIA_RECEIVER_APPLICATION_ID
And for iOS use: kGCKMediaDefaultReceiverApplicationID

/cc @vigour-io/native

@renancarvalho
Copy link
Contributor

I know how to do it! I'll do it tomorrow :)

@shawninder
Copy link
Contributor

I guess we have two choices:

  1. Each platform could have a static var with the appropriate id + a simple check if (appId === 'default') { appdId = defaultId } in its native code.
  2. The alternative being to handle this in the js, meaning the js side would need to know the ids of each platform (not a big problem either).

I guess I have a slight preference for #1 (one less if), but I can't really give convincing arguments either way...

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

No branches or pull requests

3 participants