Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ private class VideoPlayer {
private final EventChannel eventChannel;
private boolean isPlaying = false;
private boolean isInitialized = false;
private boolean isLooping = false;

@TargetApi(21)
VideoPlayer(
Expand Down Expand Up @@ -133,7 +132,7 @@ void pause() {
}

void setLooping(boolean value) {
mediaPlayer.setLooping(isLooping);
mediaPlayer.setLooping(value);
}

void setVolume(double value) {
Expand Down
3 changes: 2 additions & 1 deletion packages/video_player/ios/Classes/VideoPlayerPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ - (instancetype)initWithURL:(NSURL*)url frameUpdater:(FrameUpdater*)frameUpdater
if ([videoTrack statusOfValueForKey:@"preferredTransform" error:nil] ==
AVKeyValueStatusLoaded) {
dispatch_async(dispatch_get_main_queue(), ^{
[item addOutput:_videoOutput];
[_player replaceCurrentItemWithPlayerItem:item];
});
}
Expand Down Expand Up @@ -147,6 +146,7 @@ - (void)observeValueForKeyPath:(NSString*)path
break;
case AVPlayerItemStatusReadyToPlay:
_isInitialized = true;
[item addOutput:_videoOutput];
[self sendInitialized];
[self updatePlayingState];
break;
Expand Down Expand Up @@ -230,6 +230,7 @@ - (FlutterError* _Nullable)onListenWithArguments:(id _Nullable)arguments

- (void)dispose {
_disposed = true;
[_displayLink invalidate];
[[_player currentItem] removeObserver:self forKeyPath:@"status" context:statusContext];
[[_player currentItem] removeObserver:self
forKeyPath:@"loadedTimeRanges"
Expand Down