Does android mediaplayer supports HLS audio streams?

久未见 提交于 2019-12-10 18:37:48

问题


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.

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

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


回答1:


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

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:

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

  • cause devices to crash (Android 3.0, Honeycomb)

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

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

I've found some possible solutions:

  • https://developer.jwplayer.com/sdk/android/docs/developer-guide/

  • 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

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

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



来源:https://stackoverflow.com/questions/36833636/does-android-mediaplayer-supports-hls-audio-streams

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!