0

I'm trying to cast the videos playing on Jwplayer in near by devices like Tv, Laptop etc.

i followed this tutorial https://developer.jwplayer.com/jwplayer/docs/android-enable-casting-to-chromecast-devices

then on below code

CastOptions castOptions = new CastOptions.Builder()
//                .setReceiverApplicationId(context.getString(R.string.app_id))
                .setLaunchOptions(launchOptions)
                .build();

I didn't get setReceiverApplicationId as i don't have such a id.

So, i went here How do you find your Google Cast App ID (app_id) in the 2017 Google Play Developer Console? and decided not to pay before testing.

Then on Jw docs it is mentioned setReceiverApplicationId() allows you to filter discovery results and to launch the receiver app when a cast session starts

Since i don't need filters i commented that line.

Now i got a cast icon on xml. but when I tap it nothing is happening.

Please someone tell me

  • Is app_id is necessary how to get it ?

  • How to test the chrome casting ?

Vikas Acharya
  • 3,550
  • 4
  • 19
  • 52

1 Answers1

0

You need to call setReceiverApplicationId, but you can use the default receiver ID without paying for a developer account.

For Android, your code should look like

CastOptions castOptions = new CastOptions.Builder()
                .setReceiverApplicationId(CastMediaControlIntent.DEFAULT_MEDIA_RECEIVER_APPLICATION_ID)
                .setLaunchOptions(launchOptions)
                .build();
Kalinda Pride
  • 315
  • 5
  • 9