我有一个HTTP链接列表,基本上是流媒体视频(HLS)的链接。我想知道是否有一种简单直接的方法可以从Android应用程序的HTTP链接列表中选择,并通过chromecast在电视上播放它们。
我已经查看了Google Cast github上的一些示例应用,但无法找到任何示例。
由于
答案 0 :(得分:0)
HLS support是的,所以,为了适应Android chromecast api方面的HLS / m3u8播放列表,您可以考虑将m3u8重新映射到MediaList/MediaInfo组合,然后使用chromecast ccl调用来播放mediainfo从新名单中输入......
详细制作新的列表条目并添加到列表中:
mediaList = new ArrayList<MediaInfo>();
JSONObject jsonObj = new VideoProvider().parseUrl(url);
JSONArray categories = jsonObj.getJSONArray(TAG_RESULTS);
if (null != categories) {
for (int i = 0; i < categories.length(); i++) {
JSONObject category = categories.getJSONObject(i);
String title = category.getString(TAG_MSG);
if(title.length() > 25) title = title.substring(0, 24);
String subTitle = category.getString(TAG_MSG);
JSONObject media3 = category.getJSONObject(TAG_MEDIA3);
String videoUrl = media3.getString(TAG_URL);
JSONObject media1 = category.getJSONObject(TAG_MEDIA1);
String bigImageurl = media1.getString(TAG_URL);
JSONObject media4 = category.getJSONObject(TAG_MEDIA4);
String imageurl = media4.getString(TAG_URL);
String studio = category.getJSONObject(TAG_CREATEDBY).getString(TAG_USERNAME);
mediaList.add(buildMediaInfo(title, studio, subTitle, videoUrl, imageurl,
bigImageurl));
}
以上提供了某种类型的“媒体包”,可以提供给ccl类VideoCastManager中 startCastControllerActivity(@Type)的众多调用类型之一
仔细查看该课程中的/ == VideoCastControllerActivity management === /部分。它可能会帮助你