media-kit icon indicating copy to clipboard operation
media-kit copied to clipboard

[Windows] Playing file is in a seperate window

Open Gorter-dev opened this issue 3 years ago • 1 comments

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,

Gorter-dev avatar Jan 12 '23 12:01 Gorter-dev

See example first & read documentation. Create video controller before opening media.

alexmercerind avatar Jan 12 '23 12:01 alexmercerind