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
how to pass drawable image to MediaMetadata in chromecast #90
I'm integrating chromecast into my application. when i'm building media info
private fun buildMediaInfo(video_url: String?): MediaInfo? {
try {
val movieMetadata = MediaMetadata(MediaMetadata.MEDIA_TYPE_MOVIE)
movieMetadata.putString(MediaMetadata.KEY_SUBTITLE, sub_title)
movieMetadata.putString(MediaMetadata.KEY_TITLE, title)
if (image_url != null) {
movieMetadata.addImage(WebImage(Uri.parse(getSignedUrl(image_url))));
} else {
...
// need to implement
...
}
.....
.....
.....
}
here for so many videos thumbnail was not there in server.
So, when there is no thumbnail, inside else condition i need to display default image from drawabe(R.drawable.play_movie_card_no_film).
i tried something like below but it is not working
val img_uri = Uri.parse("android.resource://${context!!.packageName.toString()}/drawable/play_movie_card_no_film");
movieMetadata.addImage(WebImage(img_uri))
anyone know how to set local image into movieMetadata while integrating chromecast
I'm integrating chromecast into my application. when i'm building media info
R.drawable.play_movie_card_no_film
).i tried something like below but it is not working
anyone know how to set local image into
movieMetadata
while integratingchromecast