Skip to content
Snippets Groups Projects
Commit 2bc3afe1 authored by Geoffrey Métais's avatar Geoffrey Métais
Browse files

Keep same mediawrapper loaded

Fixes subtitles tracks lost on apps switch
parent c253a4c6
No related branches found
No related tags found
No related merge requests found
......@@ -869,7 +869,10 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
time = 0;
else
time -= 2000; // go back 2 seconds, to compensate loading time
mService.stop();
if (isFinishing())
mService.stop();
else
mService.pause();
SharedPreferences.Editor editor = mSettings.edit();
// Save position
......@@ -2935,8 +2938,10 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
mService.addCallback(this);
/* prepare playback */
boolean hasMedia = mService.hasMedia();
if (media == null)
media = hasMedia ? mService.getCurrentMediaWrapper() : new MediaWrapper(mUri);
if (hasMedia)
media = mService.getCurrentMediaWrapper();
else if (media == null)
media = new MediaWrapper(mUri);
if (mWasPaused)
media.addFlags(MediaWrapper.MEDIA_PAUSED);
if (mHardwareAccelerationError || intent.hasExtra(PLAY_DISABLE_HARDWARE))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment