Open hoanganhtuan95ptit opened 6 years ago
You need to make sure that your devices are registered in the Google Cast Developer console.
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?
You need to make sure the Cast SDK is initialized before your fragment instance is created.
@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.
@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?
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.
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.
Make sure you have the latest version of Google Play services installed.
@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?
I also have the same problem on Android, cast icon is missing. But its working on ios
I have the same problem and they mention that it is not necessary to register the app in google console any help?
@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?
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.
The button will only appear once the receiver device is detected in the same network. You can see the same behavior on youtube app.
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...
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.
I have run project , and getting same issue cast icon is missing. Can anyone please help me to explain why this is so ?
I run into this issue only in Fragment
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