简体   繁体   English

Android 是否支持 HLS 自适应比特率流媒体

[英]Does Android support HLS Adaptive Bitrate Streaming

I'm trying to implement adaptive bit-rate streaming in my app that automatically switch the quality depending on the connection speed.我正在尝试在我的应用程序中实现自适应比特率流,它会根据连接速度自动切换质量。 How could I achieve this.我怎么能做到这一点。 Is there is any third party library available for this.是否有任何第三方库可用于此。 does the default android video view support adaptive bit-rate streaming?默认的 android 视频视图是否支持自适应比特率流?

Android supports HLS, please have a look at the Android documentation about Supported Media Formats . Android 支持 HLS,请查看关于Supported Media Formats的 Android 文档。

There is also the ExoPlayer Open Source project, which supports MPEG-DASH and I think also HLS, which can be used to build native apps.还有ExoPlayer开源项目,它支持 MPEG-DASH,我认为还有 HLS,可用于构建本机应用程序。

If you want to use the webview (or support playback in the browser) you could also use web-based players, like the Bitmovin Adaptive Streaming Player , which also supports MPEG-DASH and HLS.如果您想使用 webview(或支持在浏览器中播放),您还可以使用基于网络的播放器,例如Bitmovin Adaptive Streaming Player ,它也支持 MPEG-DASH 和 HLS。

Android has a easy way to perform a player with Adaptative HLS Streaming. Android 有一种简单的方法可以使用自适应 HLS 流来执行播放器。 In this case Exoplayer has a many advantage to perform this.在这种情况下,Exoplayer 有很多优势来执行此操作。

If you use Android Studio you can begin with this example that use Exoplayer:如果您使用 Android Studio,您可以从这个使用 Exoplayer 的示例开始:

1-Download the project and extract. 1-下载项目并解压。

2-Build the entire project with Android Studio. 2-使用 Android Studio 构建整个项目。

3-Test with emulator or Device 3-使用模拟器或设备进行测试

Link to Android Project: https://drive.google.com/file/d/1GFXLqb8OdmWG-Kvu2DB4H3rZxv6E2v/view?usp=sharing Android 项目链接: https : //drive.google.com/file/d/1GFXLqb8OdmWG-Kvu2DB4H3rZxv6E2v/view?usp=sharing

4- Touch the button card and play online movie. 4-触摸按钮卡并播放在线电影。

I hope can help you!.希望能帮到你!。 Good luck祝你好运

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM