MediaPlayer打开M3U播放列表

时间:2016-02-19 01:37:05

标签: java android media-player android-mediaplayer m3u

我尝试创建一个MediaPlayer。 首先,我在其上添加了一个本地MP3文件(在原始目录上)

final MediaPlayer mp = MediaPlayer.create(MainActivity.this,R.raw.local_track_1);
mp.start();

一切正常,现在我尝试加载M3U播放列表

final MediaPlayer mp = MediaPlayer.create(MainActivity.this,R.raw.playlist1_local_simple);
mp.start();

但现在我得到以下错误:

02-19 02:34:54.046 4743-4743/net.test.m3uclient E/MediaPlayer-JNI: QCMediaPlayer mediaplayer NOT present
02-19 02:34:54.066 4743-4763/net.test.m3uclient E/MediaPlayer: error (1, -2147483648)
02-19 02:34:54.067 4743-4743/net.test.m3uclient D/MediaPlayer: create failed:

java.io.IOException: Prepare failed.: status=0x1
at android.media.MediaPlayer._prepare(Native Method)
at android.media.MediaPlayer.prepare(MediaPlayer.java:1154)
at android.media.MediaPlayer.create(MediaPlayer.java:933)
at android.media.MediaPlayer.create(MediaPlayer.java:904)
at net.test.m3uclient.MainActivity.onCreate(MainActivity.java:28)
at android.app.Activity.performCreate(Activity.java:6088)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2307)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.access$900(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1322)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5300)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)

02-19 02:34:54.106 4743-4743/net.test.m3uclient D/AppTracker: App Event: start
02-19 02:34:54.123 4743-4786/net.test.m3uclient D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
02-19 02:34:54.125 4743-4743/net.test.m3uclient D/Atlas: Validating map...
02-19 02:34:54.130 4743-4759/net.test.m3uclient W/MediaPlayer-JNI: MediaPlayer finalized without being released

M3U的内容简单:

local_track_1.mp3

的信息: 如果我使用Simple or Extended M3U File,则无关紧要,错误是相同的

0 个答案:

没有答案