create method
Creates an instance of a video player and returns its textureId.
Implementation
@override
Future<int?> create(DataSource dataSource) async {
if (dataSource.sourceType == DataSourceType.file) {
var controller = WinVideoPlayerController.file(File(dataSource.uri!));
await controller.initialize();
return controller.textureId_ > 0 ? controller.textureId_ : null;
} else if (dataSource.sourceType == DataSourceType.network) {
var controller = WinVideoPlayerController.network(dataSource.uri!);
await controller.initialize();
return controller.textureId_ > 0 ? controller.textureId_ : null;
} else {
throw UnimplementedError('create() has not been implemented for dataSource type [assets] and [contentUri] in Windows OS');
}
}