仅在Android MediaPlayer上播放HLS音频流

时间:2016-07-15 01:25:18

标签: android cordova audio hls m3u8

我正在使用cordova媒体插件播放仅音频HLS流。 HLS流将作为视频元素在Chrome浏览器中播放,但不会在MediaPlayer类中播放。这是我的logcat的输出:

07-14 21:19:04.905   780  1346 I MediaFocusControl:  AudioFocus  requestAudioFocus() from android.media.AudioManager@4bf937corg.apache.cordova.media.AudioHandler$1@269c405 req=1flags=0x0
07-14 21:19:04.905   197  5274 I LiveSession: onConnect http://<suppressed>
07-14 21:19:05.193   197  5274 I LiveSession: #### Starting Bandwidth Switch: -1 => 0
07-14 21:19:05.473   197  5275 I ESQueue : found AAC codec config (48000 Hz, 2 channels)
07-14 21:19:05.643   197  5275 W PlaylistFetcher: MPEG2 Transport stream does not contain video data.
07-14 21:19:05.789   197  5273 D NuPlayerDriver: notifyListener_l(0xb363dba0), (200, 802, 0)
07-14 21:19:05.789  2057  2076 W MediaPlayer: info/warning (802, 0)
07-14 21:19:05.789  2057  2171 D MediaPlayer: setSubtitleAnchor in MediaPlayer
07-14 21:19:05.924   197  5275 W PlaylistFetcher: MPEG2 Transport stream does not contain video data.
07-14 21:19:06.141   197  5275 W PlaylistFetcher: MPEG2 Transport stream does not contain video data.
07-14 21:19:06.194   197  5273 W NuPlayer: Unknown video size, reporting 0x0!
07-14 21:19:06.194   197  5273 D NuPlayerDriver: notifyListener_l(0xb363dba0), (5, 0, 0)
07-14 21:19:06.194   197  5273 D NuPlayerDriver: notifyListener_l(0xb363dba0), (200, 801, 0)
07-14 21:19:06.194   197  5273 D NuPlayerDriver: notifyListener_l(0xb363dba0), (1, 0, 0)
07-14 21:19:06.194  2057  2075 W MediaPlayer: info/warning (801, 0)
07-14 21:19:06.195   197   197 E MediaPlayerService: getDuration returned -2147483648
07-14 21:19:06.195  2057  2171 W MediaPlayer: Stream has no duration and is therefore not seekable.
07-14 21:19:06.195  2057  2171 E MediaPlayer: error (-2147483648, 0)
07-14 21:19:06.195  2057  2171 D AudioPlayer: Send a onStatus update for the new seek
07-14 21:19:06.196  2057  2171 E MediaPlayer: start called in state 0
07-14 21:19:06.196  2057  2171 E MediaPlayer: error (-38, 0)
07-14 21:19:06.196  2057  2171 E MediaPlayer: Attempt to call getDuration without a valid mediaplayer
07-14 21:19:06.196  2057  2171 E MediaPlayer: error (-38, 0)
07-14 21:19:06.197  2057  2171 E MediaPlayer: Error (-2147483648,0)
07-14 21:19:06.197  2057  2171 D AudioPlayer: on completion is calling stopped
07-14 21:19:06.197  2057  2171 E MediaPlayer: Error (-38,0)
07-14 21:19:06.197  2057  2171 D AudioPlayer: on completion is calling stopped
07-14 21:19:06.197  2057  2171 E MediaPlayer: Error (-38,0)
07-14 21:19:06.200  2057  2171 D AudioPlayer: on completion is calling stopped
07-14 21:19:06.495   197  5275 W PlaylistFetcher: MPEG2 Transport stream does not contain video data.
07-14 21:19:13.306   197  5275 W PlaylistFetcher: MPEG2 Transport stream does not contain video data.
07-14 21:19:13.651   197  5275 W PlaylistFetcher: MPEG2 Transport stream does not contain video data.
07-14 21:19:17.576   197  5275 W PlaylistFetcher: MPEG2 Transport stream does not contain video data.
07-14 21:19:24.198   197  5275 W PlaylistFetcher: MPEG2 Transport stream does not contain video data.

通过cordova媒体插件播放mp3会有效。我正在尝试播放的特定流端点可以在http://api.badkitty.co/api/audio-stream/monstercat找到。那不是流本身,流的位置是从那里获得的。我无法更改流出的m3u8文件。

0 个答案:

没有答案
相关问题