Merge pull request #2157 from ShadowIce/1264-Playback-position-regularly-moves-back-to-pre-last-position-after-pause
Prepare media on app start/resume and not on playback start
This commit is contained in:
commit
3c10fb119a
|
@ -383,6 +383,9 @@ public class LocalPSMP extends PlaybackServiceMediaPlayer {
|
|||
statusBeforeSeeking = playerStatus;
|
||||
setPlayerStatus(PlayerStatus.SEEKING, media, getPosition());
|
||||
mediaPlayer.seekTo(t);
|
||||
if (statusBeforeSeeking == PlayerStatus.PREPARED) {
|
||||
media.setPosition(t);
|
||||
}
|
||||
try {
|
||||
seekLatch.await(3, TimeUnit.SECONDS);
|
||||
} catch (InterruptedException e) {
|
||||
|
|
|
@ -216,7 +216,7 @@ public abstract class PlaybackController {
|
|||
Intent serviceIntent = new Intent(activity, PlaybackService.class);
|
||||
serviceIntent.putExtra(PlaybackService.EXTRA_PLAYABLE, media);
|
||||
serviceIntent.putExtra(PlaybackService.EXTRA_START_WHEN_PREPARED, false);
|
||||
serviceIntent.putExtra(PlaybackService.EXTRA_PREPARE_IMMEDIATELY, false);
|
||||
serviceIntent.putExtra(PlaybackService.EXTRA_PREPARE_IMMEDIATELY, true);
|
||||
boolean fileExists = media.localFileAvailable();
|
||||
boolean lastIsStream = PlaybackPreferences.getCurrentEpisodeIsStream();
|
||||
if (!fileExists && !lastIsStream && media instanceof FeedMedia) {
|
||||
|
|
Loading…
Reference in New Issue