多视频播放器

只需提供视频源列表,即可播放多个预加载的视频。

Sample

示例

    MultiVideoPlayer.asset(
        videoSourceList: videos,
        scrollDirection: Axis.horizontal,
        preloadPagesCount: 2,
        onPageChanged: (videoPlayerController, index) {},
        getCurrentVideoController: (videoPlayerController) {},
    ),

如果WEB端滚动不起作用,请使用ScrollConfiguration。

    ScrollConfiguration(
        behavior: ScrollConfiguration.of(context).copyWith(
          dragDevices: {
            PointerDeviceKind.touch,
            PointerDeviceKind.mouse,
          },
        ),
        child: MultiVideoPlayer.asset(
          videoSourceList: videos,
          scrollDirection: Axis.horizontal,
          preloadPagesCount: 2,
          onPageChanged: (videoPlayerController, index) {},
          getCurrentVideoController: (videoPlayerController) {},
        ),
    ),

GitHub

查看 Github