openVideo method
Future<WinVideoPlayerValue?>
openVideo(
- WinVideoPlayerController player,
- int textureId,
- String path
override
Implementation
@override
Future<WinVideoPlayerValue?> openVideo(
WinVideoPlayerController player, int textureId, String path) async {
var arguments = await methodChannel
.invokeMethod<Map>('openVideo', {"textureId": -1, "path": path});
if (arguments == null) return null;
if (arguments["result"] == false) return null;
int width = arguments["videoWidth"];
int height = arguments["videoHeight"];
double volume = arguments["volume"];
int textureId = arguments["textureId"];
var value = WinVideoPlayerValue(
textureId: textureId,
position: Duration.zero,
duration: Duration(milliseconds: arguments["duration"]),
size: Size(width.toDouble(), height.toDouble()),
isPlaying: false,
isInitialized: true,
volume: volume,
);
playerMap[value.textureId] =
WeakReference<WinVideoPlayerController>(player);
return value;
}