Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
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 @@ -114,8 +114,10 @@ public void onBufferingUpdate(MediaPlayer mediaPlayer, int percent) {
new MediaPlayer.OnErrorListener() {
@Override
public boolean onError(MediaPlayer mp, int what, int extra) {
eventSink.error(
"VideoError", "Video player had error " + what + " extra " + extra, null);
if (eventSink != null) {
eventSink.error(
"VideoError", "Video player had error " + what + " extra " + extra, null);
}
return true;
}
});
Expand Down
2 changes: 2 additions & 0 deletions packages/video_player/ios/Classes/VideoPlayerPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,7 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
[[_players objectForKey:textureId] dispose];
}
[_players removeAllObjects];
result(nil);
} else if ([@"create" isEqualToString:call.method]) {
NSDictionary* argsMap = call.arguments;
FLTFrameUpdater* frameUpdater = [[FLTFrameUpdater alloc] initWithRegistry:_registry];
Expand Down Expand Up @@ -327,6 +328,7 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
[_registry unregisterTexture:textureId];
[_players removeObjectForKey:@(textureId)];
[player dispose];
result(nil);
} else if ([@"setLooping" isEqualToString:call.method]) {
[player setIsLooping:[[argsMap objectForKey:@"looping"] boolValue]];
result(nil);
Expand Down