我正在将chromecast集成到我的应用程序中。当我建立媒体信息时
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
...
}
.....
.....
.....
}
R.drawable.play_movie_card_no_film
)的默认图像。我尝试了类似下面的操作,但是它不起作用
val img_uri = Uri.parse("android.resource://${context!!.packageName.toString()}/drawable/play_movie_card_no_film");
movieMetadata.addImage(WebImage(img_uri))
任何人都知道在集成movieMetadata
的同时如何将本地图像设置为chromecast