After playing Video VIDEO, broadcast a video in SurfaceView without destroying.

Error log:

01-01 08:03:33.888 2627 2627 W ContextImpl: Calling a method in the system process without a qualified user: android.app.ContextImpl.sendBroadcast:763 android.content.ContextWrapper.sendBroadcast:396 com.jrm.localmm.business.video.MultiVideoPlayView.openPlayer:357 com.jrm.localmm .business.video.MultiVideoPlayView.setVideoPath:251 com.jrm.localmm.ui.multiplayback.MultiPlayerController.startPlayBack:125 01-01 08:03:33.889 1689 3440 D mstplayer: [3440] [AVP] notify_msg_cb: 0x100101-01 08 :03:33.889 1689 3440 D mstplayer: [3440] [AVP] open fail event01-01 08:03:33.889 1689 3440 D mstplayer: [3440] [AVP] mmp event 0x1001, size 0, data 0x0x001-01 08:03 :33.889 2627 2643 E MediaPlayer: error (1, -5003)

I haven’t continued to check why yet,

I just know that the next song will be played Re-release the player at some time to play normally.

But the strange thing is that there was a release when the error occurred last time, okay.

 /** * Start player. */ private void openPlayer() {if (mUri == null || mSurfaceHolder == null) {// not ready for playback just yet, will try again later return;} // close the built-in music service of android Intent i = new Intent("com.android .music.musicservicecommand"); i.putExtra("command", "pause"); this.getContext().sendBroadcast(i); // Close the user's music callback interface if (myPlayerCallback != null) myPlayerCallback.onCloseMusic( ); // we shouldn't clear the target state, because somebody might have // ​​called start() previously release(false); try {mMMediaPlayer = new MMediaPlayer(); mDuration = -1; mMMediaPlayer.setOnPreparedListener(mPreparedListener); mMMediaPlayer.se tOnVideoSizeChangedListener(mSizeChangedListener); mMMediaPlayer.setOnCompletionListener(mCompletionListener); mMMediaPlayer.setOnErrorListener(mErrorListener); mMMediaPlayer.setOnInfoListener(mInfoListener); String path = mUri.toString(); if (mSurfaceHolder != null) {mMSurfaceHolder(mSurfaceHolder) } if (Tools.isNetPlayback(path) && mHeaders != null) {Log.i(TAG,"netvideo setDataSource with headers"); mMMediaPlayer.setDataSource(mContext, mUri ,mHeaders);} else {mMMediaPlayer.setDataSource(mContext, mUri); mMMediaPlayer.setParameter(KEY_PARAMETER_SET_MUTIL_VIDEO_PLAY, 1);} mMMediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); mMMediaPlayer.setScreenOnWhilePlaying(true); Log.i(TAG, "***********prepareAsync: " + mSurfaceHolder); mMMediaPlayer.prepareAs ync(); mCurrentState = STATE_PREPARING; Log.i(TAG, "*******prepareAsync end***** viewId:"+viewId);} catch (IOException ex) {Log.w(TAG, " Unable to open content: "+ mUri, ex); if (myPlayerCallback != null) {myPlayerCallback.onError(mMMediaPlayer, IO_ERROR, 0, viewId);} return;} catch (IllegalArgumentException ex) {Log.w(TAG," Unable to open content: "+ mUri, ex); errorCallback(0); return;} catch (IllegalStateException ex) {Log.w(TAG, "Unable to open content:" + mUri, ex); errorCallback(0); return;} catch (SecurityException ex) {Log.w(TAG, "Unable to open content: "+ mUri, ex); errorCallback(0); return;} }

 /* * release the media player in any state. */ private void release(boolean cleartargetstate) {Log.i(TAG, "***********release*******"); if (mCurrentState == STATE_IDLE) {return;} mCurrentState = STATE_IDLE; if (cleartargetstate) {new Thread(new Runnable() {@Override public void run() {if (mMMediaPlayer != null && mMMediaPlayer.isPlaying()) {try {mMMediaPlayer .stop();} catch (IllegalStateException e) {Log.i(TAG, "stop fail! please try again!"); try {this.wait(2000); mMMediaPlayer.stop();} catch (InterruptedException e1) {e1.printStackTrace();}}} if (mMMediaPlayer != null) {Log.i(TAG, "*****release start***** viewId:"+viewId); mMMediaPlayer.release();// release will done reset Log.i( TAG, "*****release end***** viewId:"+viewId);} mMMediaPlayer = null;} }).start();} else {if (mMMediaPlayer != null) {Log.i( TAG, "***********release Player viewId:"+viewId); mMMediaPlayer.release();} mMMediaPlayer = null;} }

WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]
SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 1546 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC

Leave a Comment

Your email address will not be published.