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;
|
statusBeforeSeeking = playerStatus;
|
||||||
setPlayerStatus(PlayerStatus.SEEKING, media, getPosition());
|
setPlayerStatus(PlayerStatus.SEEKING, media, getPosition());
|
||||||
mediaPlayer.seekTo(t);
|
mediaPlayer.seekTo(t);
|
||||||
|
if (statusBeforeSeeking == PlayerStatus.PREPARED) {
|
||||||
|
media.setPosition(t);
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
seekLatch.await(3, TimeUnit.SECONDS);
|
seekLatch.await(3, TimeUnit.SECONDS);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
|
@ -216,7 +216,7 @@ public abstract class PlaybackController {
|
|||||||
Intent serviceIntent = new Intent(activity, PlaybackService.class);
|
Intent serviceIntent = new Intent(activity, PlaybackService.class);
|
||||||
serviceIntent.putExtra(PlaybackService.EXTRA_PLAYABLE, media);
|
serviceIntent.putExtra(PlaybackService.EXTRA_PLAYABLE, media);
|
||||||
serviceIntent.putExtra(PlaybackService.EXTRA_START_WHEN_PREPARED, false);
|
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 fileExists = media.localFileAvailable();
|
||||||
boolean lastIsStream = PlaybackPreferences.getCurrentEpisodeIsStream();
|
boolean lastIsStream = PlaybackPreferences.getCurrentEpisodeIsStream();
|
||||||
if (!fileExists && !lastIsStream && media instanceof FeedMedia) {
|
if (!fileExists && !lastIsStream && media instanceof FeedMedia) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user