ChromeCast无法播放.m3u8格式的HLS [英] ChromeCast doesnt play HLS in .m3u8 format

查看:186
本文介绍了ChromeCast无法播放.m3u8格式的HLS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

应用程序中集成了chromecast。一切正常,除了不能播放.m3u8格式的实时流URL,而是播放电影的.m3u8格式url。我这样做是为了将网址设置为chromecast。

Integrated chromecast in the app. Everything works fine except it does not play live streaming url which is in .m3u8 format but plays .m3u8 format url for movies. I am doing this to set url to chromecast.

return new MediaInfo.Builder(url)
            .setStreamType(MediaInfo.STREAM_TYPE_LIVE)
            .setContentType("videos/mp4")
            .setMetadata(movieMetadata)
            .setStreamDuration(mVideoView.getDuration())
            .build();


推荐答案

根据google Cast示例,显示了所需的MIME类型在json文件
https://commondatastorage.googleapis.com /gtv-videos-bucket/CastVideos/f.json

According to google Cast Samples, needed MIME Types are shown in json file https://commondatastorage.googleapis.com/gtv-videos-bucket/CastVideos/f.json

{
    "type": "hls",
    "mime": "application/x-mpegurl",
},
{
    "type": "dash",
    "mime": "application/dash+xml",
},
{
    "type": "mp4",
    "mime": "videos/mp4",
}

这篇关于ChromeCast无法播放.m3u8格式的HLS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆