Skip to content

Commit 639c222

Browse files
authored
Fix iOS takeSnapshot not working (#83)
1 parent 8b0fc30 commit 639c222

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

ios/Classes/SwiftFlutterVlcPlayerPlugin.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public class VLCView: NSObject, FlutterPlatformView {
121121
let byteArray = (image ?? UIImage()).pngData()
122122

123123
result([
124-
"snapshot": byteArray
124+
"snapshot": byteArray?.base64EncodedString()
125125
])
126126
return
127127

@@ -151,6 +151,9 @@ public class VLCView: NSObject, FlutterPlatformView {
151151
result(FlutterMethodNotImplemented)
152152
return
153153
}
154+
} else {
155+
result(FlutterMethodNotImplemented)
156+
return
154157
}
155158

156159
})

lib/flutter_vlc_player.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ class VlcPlayerController {
366366
}
367367

368368
Future<Uint8List> takeSnapshot() async {
369-
var result = await _methodChannel.invokeMethod("getSnapshot");
369+
var result = await _methodChannel.invokeMethod("getSnapshot", {'getSnapShot': ''});
370370
var base64String = result['snapshot'];
371371
Uint8List imageBytes = CryptoUtils.base64StringToBytes(base64String);
372372
return imageBytes;

0 commit comments

Comments
 (0)