media-kit
media-kit copied to clipboard
[Windows] Playing file is in a seperate window
Hi,
Using the following code:
(note; these are just snippets of code)
1.
final Player _player = Player();
VideoController? _videoController;
2.
_player.open(Playlist(
[
Media('file://${file.path}'),
],
));
_videoController = await VideoController.create(_player.handle);
setState(() {});
3.
Video(
controller: _videoController,
),
Code block 2 is in a function, when the first video gets loaded. It opens a seperate window to play said video. Then after switching between videos for a few times it suddenly work and is shown in the widget as defined in block 3.
Thanks in advance! Kind regards,
See example first & read documentation. Create video controller before opening media.