默认官方不支持全屏, chewie基于官方扩展,支持全屏等。
dependencies:
chewie: ^0.9.7
video_player: ^0.10.1+6
flutter:
sdk: flutter
依赖video_player
引入包
import 'package:chewie/chewie.dart';
import 'package:video_player/video_player.dart';
final playerWidget = Chewie(
controller: ChewieController(
videoPlayerController: VideoPlayerController.network('http://xxx.mp4'),
aspectRatio: 3 / 2,
autoPlay: true,
looping: true,
),
);
缺少滑动快进功能,需要自己扩展,不过总比搞安卓和ios各写一套方便
--END--
网友评论