Commit 12b5dd1a authored by Geoffrey Métais's avatar Geoffrey Métais

Thread mediaplayer stop & restart

parent bce9ebe5
......@@ -1022,8 +1022,14 @@ public class PlaybackService extends MediaBrowserServiceCompat implements IVLCVo
saveMediaMeta();
media.setEventListener(null);
mMediaPlayer.setEventListener(null);
mMediaPlayer.stop();
mMediaPlayer.setMedia(null);
final MediaPlayer mp = mMediaPlayer;
VLCApplication.runBackground(new Runnable() {
@Override
public void run() {
mp.stop();
mp.setMedia(null);
}
});
media.release();
publishState();
}
......@@ -2527,7 +2533,13 @@ public class PlaybackService extends MediaBrowserServiceCompat implements IVLCVo
public void restartMediaPlayer() {
stop();
mMediaPlayer.release();
final MediaPlayer mp = mMediaPlayer;
VLCApplication.runBackground(new Runnable() {
@Override
public void run() {
mp.release();
}
});
mMediaPlayer = newMediaPlayer();
/* TODO RESUME */
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment