Android Mediaplayer是否支持HLS音频流? [英] Does android mediaplayer supports HLS audio streams?

查看:425
本文介绍了Android Mediaplayer是否支持HLS音频流?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已经开发了一个播放mp4音频流的应用程序. 现在我们要用HLS流(.m3u8)作为IOS替换那些mp4流 对播放HLS流具有开箱即用的支持. 现在,我们尝试使用android 5.1和6.0设备播放视频流,并且它似乎具有本地android媒体播放器的HLS支持.

we have already developed an application which plays mp4 audio streams. Now we want to replace those mp4 streams with HLS streams(.m3u8) as IOS has out of the box support for playing HLS streams. Now we have tried playing streams with android 5.1 and 6.0 devices and it appears to have HLS support with native android media player.

但是在一些4.4版本的设备上,我们看到媒体播放器在执行诸如seek()等操作时变得无响应.

But on some of the 4.4 version devices we saw mediaplayer became unresponsive while doing operations like seek() etc.

任何人都可以确认本机android mediaplayer是否完全支持HLS流(.m3u8)吗?

Can anyone confirm whether native android mediaplayer has full support for HLS streams (.m3u8) ?

推荐答案

我遇到了同样的问题,但就我而言,我需要播放视频.

I have the same problem but in my case I need to play video.

尽管更新版本的Android OS的性能往往会更好一些,但Android碎片化仍然是一个问题,并且取决于Android版本,HLS可能会:

Though newer versions of the Android OS tend to perform somewhat better, Android fragmentation is still a problem and depending on the Android version, HLS may:

    完全不支持
  • (Android 2.3,Gingerbread)

  • not be supported at all (Android 2.3, Gingerbread)

导致设备崩溃(Android 3.0,Honeycomb)

cause devices to crash (Android 3.0, Honeycomb)

在全屏(Android 4.0,Ice Cream Sandwich)中,查找功能不足,图像失真并完全重新启动视频

lack seeking ability, feature distorted images, and restart videos completely when in fullscreen (Android 4.0, Ice Cream Sandwich)

缺乏搜索能力,并在全屏(Android 4.1,Jelly Bean)中抛出错误并崩溃

lack seeking ability, and throw an error and crash when in fullscreen (Android 4.1, Jelly Bean)

我找到了一些可能的解决方案:

I've found some possible solutions:

http://docs.brightcove.com/en/perform/mobile-sdks/hls-player/guides/hls-limitations.html

http://superpowered .com/http-live-streaming-hls-android-audio-ios-hls-android-example

http://google.github.io/ExoPlayer/guide.html #hls

最后,我使用Android 4.1中的ExoPlayer和早期版本中的MediaPlayer.

Finally Im using ExoPlayer from Android 4.1 and MediaPlayer in previous versions.

等级依赖性: 编译'com.google.android.exoplayer:exoplayer:r1.4.2'

Gradle dependency: compile 'com.google.android.exoplayer:exoplayer:r1.4.2'

这篇关于Android Mediaplayer是否支持HLS音频流?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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