CastVideos-android | Reference Android Sender w/ Framework API | Android library
kandi X-RAY | CastVideos-android Summary
kandi X-RAY | CastVideos-android Summary
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.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Initializes the video view
- Toggles playback state
- Show a queue popup
- Setup callbacks that will be called when playing the video view
- Called when the view is created
- Called when a container is clicked
- Called when an upcoming item is played
- Called when a new item is bound to a queue view
- Updates the play button image resource
- This is called when the menu item is created
- Initializes the cast context
- Called when an item is selected
- Creates the menu item to be called when the menu item is created
- Resume the playback location
- Build queue
- Called when a menu item is selected
- Resume the cast session
- Called when media is suspended
- Called when the activity is created
- Called when an options item is selected
- Cancel playback
- Called when a media item is clicked
- Initializes the view created by the dialog
- Called when the configuration changes
- OnBindViewHolder onBindViewHolder
- Rebuilds the queue item
CastVideos-android Key Features
CastVideos-android Examples and Code Snippets
Community Discussions
Trending Discussions on CastVideos-android
QUESTION
The pause button in the Cast Dialog doesn't seem to be working. I noticed the same issue with the CastVideos-android sample app. Has anyone worked around this?
...ANSWER
Answered 2017-Feb-21 at 07:54I had the exactly same issue, I worked around by making classess extending MediaRouteDialogFactory, MediaRouteControllerDialogFragment, and MediaRouteControllerDialog.
QUESTION
I just recently started working with the Cast SDK and while following the guide to setting it up (found here: https://developers.google.com/cast/docs/android_sender_integrate). I integrated the cast button onto my example app, however for some reason it does not look like how it's suppose (?) to look?
For example, my app's cast dialogue: My example app Picture
vs an example app that follows the design standards (https://github.com/googlecast/CastVideos-android): CastVideos-Android Picture
If you notice, the CastVideos-Android one has a back-shadow associated with the dialogue and can be dismissed by pressing anywhere on the screen.
Here is all of my code since it's a very basic implementation (I wrote it in Kotlin):
MainActivity class:
...ANSWER
Answered 2017-Dec-07 at 22:46Updating support library version to 27.0.2 in project gradle should fix the issue.
QUESTION
Having trouble with the cast dialog and a custom receiver. Media is cast and playing, the cast dialog shows the pause icon and hitting pause causes the cast framework to send a message to the receiver which comes through to cast.receiver.MediaManager.onPause()
. From there I pause my custom player and call MediaManager.broadcastStatus()
which results in the sender's cast dialog button switching from the pause icon to the play icon. However, pressing the play button does nothing. Debugging the Android client I see that MediaSessionCompatApi21.onPause()
and .onPlay()
are called upon pressing the button but only pause is sending anything to the receiver. Any idea why the framework is not causing the cast.receiver.MediaManager.onPlay()
function to be called on the receiver?
This happens with support:7.25.2 / play-services:10.2.0
or support:7.24.4 / play-services:9.4.0
. I'm clearly not understanding something basic..
Another possibly related thing I noticed somewhat randomly, both on my app and the CastVideos-android app, is that commenting out the mediarouter compile line in the gradle file results in a runnable build but the cast dialog pause function is broken too. Everything else cast related works fine though. Painfully confusing..
UPDATE: I ran CastVideos-android app against my custom receiver (not playing any media but simulating the messaging) and the play/pause works fine. Starting to believe this is a build issue..
...ANSWER
Answered 2017-Feb-26 at 17:13Looking more closely at the latest CastVideos-android sample solved the problem. Given a dummy MediaInfo instance X, I was calling
_remoteMediaClient.load(X);
Seemed pretty reasonable but it wasn't working for the cast dialog play problem. Using MediaQueueItem (from looking at the latest CastVideos-android version) fixed it...
MediaQueueItem qi = new MediaQueueItem.Builder(X).setAutoplay(true).setPreloadTime(20).build();
MediaQueueItem[] qa = new MediaQueueItem[]{qi}; _remoteMediaClient.queueLoad(qa,0,MediaStatus.REPEAT_MODE_REPEAT_OFF, null);
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install CastVideos-android
[Optional] Register an application on the Developers Console http://cast.google.com/publish. The easiest would be to use the Styled Media Receiver option. You will get an App ID when you finish registering your application. This project uses a published Application ID that can be used to run the app without using your own ID but if you need to do any console debugging, you would need to have your own ID.
Import the project into Android Studio or use gradle to build the project.
Compile and deploy to your Android device.
This sample includes a published app id in the res/values/strings.xml file so the project can be built and run without a need to register an app id. If you want to use your own receiver (which is required if you need to debug the receiver), update "app_id" in that file with your own app id.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page