Qihoo360 / RePlugin

RePlugin - A flexible, stable, easy-to-use Android Plug-in Framework
Apache License 2.0
7.27k stars 1.53k forks source link

插件无法播放音频 #390

Open Lua12138 opened 7 years ago

Lua12138 commented 7 years ago

问题详细描述 Detailed description of the problem

复现问题步骤 Steps to reproduce the problem

  1. 构造对象
        this.mediaPlayer = new MediaPlayer();
        this.mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
        this.mediaPlayer.setDataSource(uri); // 为本地的绝对路径,如/sdcard/abc/123.wav
        this.mediaPlayer.prepare();
  2. 调用播放方法
    this.mediaPlayer.start();
  3. 触发MediaPlayer的ErrorListener

what参数为MEDIA_ERROR_SERVER_DIED extra为0

  1. LOGCAT输出
    10-24 20:24:56.076 2617-2673/demo W/AudioSystem: AudioPolicyService server died!
    10-24 20:24:56.076 2617-2629/demo W/IMediaDeathNotifier: media server died
    10-24 20:24:56.076 2617-2673/demo W/AudioSystem: AudioFlinger server died!
    10-24 20:24:56.076 2617-2629/demo E/MediaPlayer: error (100, 0)
    10-24 20:24:56.076 2617-2629/demo E/MediaPlayer: error (100, 0)
    10-24 20:24:56.076 2617-2617/demo E/MediaPlayer: Error (100,0)
    10-24 20:24:56.076 2617-2617/demo E/javax.microedition.media.Player: There is a player (music/startBgMusic.wav) error with what is MEDIA_ERROR_SERVER_DIED and e is UNKNOWN 0
    10-24 20:24:56.076 2617-2617/demo E/MediaPlayer: Error (100,0)

其它重要信息 Other important information

replugin-host-lib/gradle Version:

rePlugin-plugin-lib/gradle Version:

Android API Version:Android 4.4.4 API 19

wogenhaosini commented 6 years ago

我也碰见了一样的问题:

日志如下:

11-07 22:08:39.938 26384-26384/ E/MediaPlayer-JNI: JNIMediaPlayerFactory: bIsQCMediaPlayerPresent 0
11-07 22:08:39.938 26384-26384/ E/ExtMediaPlayer-JNI: env->IsInstanceOf fails
11-07 22:08:39.938 26384-26384/ E/MediaPlayer-JNI: JNIMediaPlayerFactory: bIsQCMediaPlayerPresent 0
11-07 22:08:40.063 26384-26384/ E/ExtMediaPlayer-JNI: env->IsInstanceOf fails
11-07 22:08:40.063 26384-26384/ E/MediaPlayer-JNI: JNIMediaPlayerFactory: bIsQCMediaPlayerPresent 0
11-07 22:08:40.063 26384-26384/ E/ExtMediaPlayer-JNI: env->IsInstanceOf fails
11-07 22:08:40.063 26384-26384/ E/MediaPlayer-JNI: JNIMediaPlayerFactory: bIsQCMediaPlayerPresent 0
11-07 22:08:40.337 26384-26757/ E/h: total------>22916
11-07 22:08:40.338 26384-26757/ E/h: current------>4096
11-07 22:08:40.338 26384-26757/ E/h: current------>7769
11-07 22:08:40.339 26384-26757/ E/h: current------>11865
11-07 22:08:40.339 26384-26757/ E/h: current------>15961
11-07 22:08:40.339 26384-26757/ E/h: current------>20057
11-07 22:08:40.339 26384-26757/ E/h: current------>22916
11-07 22:08:43.279 26384-26384/ E/MediaPlayer: start called in state 2, mPlayer(0x7f6679e180)
11-07 22:08:43.279 26384-26384/ E/MediaPlayer: error (-38, 0)
11-07 22:08:43.279 26384-26384/ E/MediaPlayer: Error (-38,0)
11-07 22:08:55.263 26384-26384/ E/MediaPlayer: stop called in state 0, mPlayer(0x7f6679e180)
11-07 22:08:55.263 26384-26384/ E/MediaPlayer: error (-38, 0)
11-07 22:08:55.273 26384-26384/ E/MediaPlayer: Error (-38,0)
11-07 22:08:59.185 26384-26384/ E/ExtMediaPlayer-JNI: env->IsInstanceOf fails
11-07 22:08:59.185 26384-26384/ E/MediaPlayer-JNI: JNIMediaPlayerFactory: bIsQCMediaPlayerPresent 0
11-07 22:08:59.185 26384-26384/ E/ExtMediaPlayer-JNI: env->IsInstanceOf fails
11-07 22:08:59.185 26384-26384/ E/MediaPlayer-JNI: JNIMediaPlayerFactory: bIsQCMediaPlayerPresent 0
11-07 22:09:02.211 26384-26384/ E/MediaPlayer: start called in state 2, mPlayer(0x7f6679e380)
11-07 22:09:02.211 26384-26384/ E/MediaPlayer: error (-38, 0)
11-07 22:09:02.211 26384-26384/ E/MediaPlayer: Error (-38,0)
11-07 22:09:09.465 26384-26384/ E/MediaPlayer: stop called in state 0, mPlayer(0x7f6679e380)
11-07 22:09:09.465 26384-26384/ E/MediaPlayer: error (-38, 0)
11-07 22:09:09.481 26384-26384/ E/MediaPlayer: Error (-38,0)