play method
Implementation
@override
Future<bool> play(String? url) async
{
if (_controller != null) _controller!.dispose();
Uri? uri = Uri.tryParse(url ?? "");
if (uri != null)
{
// initialize the controller
_controller = VideoPlayerController.network(url!)..initialize().then((_)
{
// Ensure the first frame is shown after the video is initialized, even before the play button has been pressed.
if (mounted) setState(() {});
});
_controller!.addListener(onVideoController);
}
return true;
}