Player(是一个控制器)

/// player 实际上就是控制器,可以对当前的播放列表的维护
final Player _player = Player(
    id: 0,
    /// 下面也可以设置video的大小,遵循后来者居上
    videoDimensions: const VideoDimensions(300, 300),
);

player重要的方法

  1. remove
/// 这个函数的作用是移除,index 可能是 0 - n
_player.remove(0);
  1. open
// 使用这个函数将会清空所有的列表,我们加入的可以是多个,
// 只要调用这个函数就会清空player维护的那个播放列表,换成新加入的,open可以理解为,打开新的播放列表
_player.open(
    Media.network(_videoList[_index++]),
    autoStart: true
);
  1. remove add 等

Video(和html一样,是一个widget,需要传入上面的player)

/// size(width, height) 以这个为主,player的为辅助
child: Video(
  player: _player,
  width: 800,
  height: 800,
  showControls: true,
)