googlecast / CastVideos-android

Reference Android Sender w/ Framework API: CastVideos-android application shows how to cast videos from an Android device that is fully compliant with the Cast Design Checklist.
Apache License 2.0
345 stars 183 forks source link

Cast icon not showing #57

Open hoanganhtuan95ptit opened 6 years ago

hoanganhtuan95ptit commented 6 years ago

I have run your project in Release, but it did not show the cast icon. Can anyone explain to me why this is so ?, and is there a way to solve this problem? Thank you so much

NoRulesJustFeels commented 6 years ago

You need to make sure that your devices are registered in the Google Cast Developer console.

rjkolli7 commented 6 years ago

As I have tested, CastVideos-Android demo which is working perfect. Cast button is Showing on ActionBar and playing over TV everything is perfect.

But when I have integrated it in my app, Cast button is not showing on ActionBar. As per the debugging what I found is, CastListener is not calling in my project which is calling in CastVideos-Android demo.

FYI: I have registered my device in the Google Cast Developer console. And I am inflating Cast button menu in fragment as I have another menu to show in my activity with different options.

What might be the issue? What I have missed?

NoRulesJustFeels commented 6 years ago

You need to make sure the Cast SDK is initialized before your fragment instance is created.

rjkolli7 commented 6 years ago

@entertailion Yes thanks it is working now. But for that I have to move Cast SDK initialisation code (CastStateListener, CastButtonFactory.setUpMediaRouteButton() and IntroductoryOverlay initialisations and) to FragmentActivity.

But Here I have a question: I have video inside the fragment so inside the fragment I am initialising the Cast SDK, so if my fragment instance is created then only I can initialise the Cast SDK.

Questions is, If I do not have any Cast SDK related callbacks or initialisations in the FragmentActivity. So in this scenario how can I initialise the Cast SDK? How can I get call backs to the CastStateListener? How can I get the CastSession?

I hope if this repo have fragment demo it would be helpful for developers.

harshiddhmania commented 6 years ago

@entertailion, I am also not seeing the cast icon on my Sender App. So do i need to register the device on which Sender App is running? Google Cast Developer console registration is required for receiver app or device, right?

NoRulesJustFeels commented 6 years ago

The Google Cast Console is for registering your cast devices (not sender devices). If you are still experiencing discovery issues, try to toggle airplane mode off and then on again.

aman01894 commented 6 years ago

I have run your project , but cast icon is missing. Can anyone please help me to explain why this is so ?, and is there a way to solve this problem? Thank you in advance.

NoRulesJustFeels commented 6 years ago

Make sure you have the latest version of Google Play services installed.

sorrybeman commented 5 years ago

@entertailion Yes thanks it is working now. But for that I have to move Cast SDK initialisation code (CastStateListener, CastButtonFactory.setUpMediaRouteButton() and IntroductoryOverlay initialisations and) to FragmentActivity.

But Here I have a question: I have video inside the fragment so inside the fragment I am initialising the Cast SDK, so if my fragment instance is created then only I can initialise the Cast SDK.

Questions is, If I do not have any Cast SDK related callbacks or initialisations in the FragmentActivity. So in this scenario how can I initialise the Cast SDK? How can I get call backs to the CastStateListener? How can I get the CastSession?

I hope if this repo have fragment demo it would be helpful for developers.

I have encountered the same problem, how do you solve it?

rangav commented 5 years ago

I also have the same problem on Android, cast icon is missing. But its working on ios

enaamr commented 5 years ago

I have the same problem and they mention that it is not necessary to register the app in google console any help?

Jiyupeng334 commented 5 years ago

@entertailion Is it necessary to register?CastMediaControlIntent.DEFAULT_MEDIA_RECEIVER_APPLICATION_ID doesn't work. Do I need a can be connected device to display the icon?

Purvik commented 5 years ago

Facing the same problem here with code of one of the Google Cast Codelab final app. In screenshot they are displaying it clearly but in our app, it's not there.

AdeelTariq commented 5 years ago

The button will only appear once the receiver device is detected in the same network. You can see the same behavior on youtube app.

GeekAashish commented 3 years ago

I am using your Google Chrome cast video demo but I can not see the cast icon in the demo app

https://github.com/googlecast/CastVideos-android

I am using the same wifi on both my mobile device and Mi TV

I am using the latest version of Android studio with updated dependency.

I am able to cast a YouTube app on my Mi TV. I can see the cast icon in the youtube app but not in the demo app.

Please solve this issue ASAP I want to implement this feature in my client app. Before implementation, I want to check the demo of how it works...

fmatosqg commented 3 years ago

I had same problem with v19 of play-services-cast-framework and when downgraded to 18 it worked. I can't use v20 yet because of some issues with android:foregroundServiceType, I'll deal with that later or never at all.

Ram81455 commented 3 years ago

I have run project , and getting same issue cast icon is missing. Can anyone please help me to explain why this is so ?

hannesa2 commented 2 years ago

I run into this issue only in Fragment