Commit 40c85b34 authored by Felix Paul Kühne's avatar Felix Paul Kühne

Movie View: improve continue-where-left-off playback behavior, so we no longer...

Movie View: improve continue-where-left-off playback behavior, so we no longer show the clip's first frame but jump directly to the last position

Note that this requires a recent libvlc checkout due to underlying, required improvements merged last week
parent 7e9e0011
......@@ -204,10 +204,20 @@
- (void)_playNewMedia
{
if (self.mediaItem.lastPosition && [self.mediaItem.lastPosition floatValue] < .95) {
if (self.mediaItem.duration.intValue != 0) {
NSNumber *playbackPositionInTime = @(self.mediaItem.lastPosition.floatValue * (self.mediaItem.duration.intValue / 1000.));
[_mediaPlayer.media addOptions:@{@"start-time": playbackPositionInTime}];
APLog(@"set starttime to %i", playbackPositionInTime.intValue);
}
}
[_mediaPlayer play];
if (self.mediaItem.lastPosition && [self.mediaItem.lastPosition floatValue] < .95)
/* fallback if an invalid duration was reported by MLKit */
if (self.mediaItem.duration.intValue == 0 && self.mediaItem.lastPosition && [self.mediaItem.lastPosition floatValue] < .95)
[_mediaPlayer setPosition:[self.mediaItem.lastPosition floatValue]];
self.playbackSpeedSlider.value = [self _playbackSpeed];
[self _updatePlaybackSpeedIndicator];
......
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