Вы можете использовать flutter_vlc_player
Сначала добавьте его:
dependencies:
flutter_vlc_player: ^3.0.3
Затем используйте его как:
import 'package:flutter/material.dart';
import 'package:flutter_vlc_player/flutter_vlc_player.dart';
class ExampleVideo extends StatefulWidget {
@override
_ExampleVideoState createState() => _ExampleVideoState();
}
class _ExampleVideoState extends State<ExampleVideo> {
final String urlToStreamVideo = 'http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_60fps_normal.mp4';
final VlcPlayerController controller = new VlcPlayerController(
// Start playing as soon as the video is loaded.
onInit: (){
controller.play();
}
);
final int playerWidth = 640;
final int playerHeight = 360;
@override
Widget build(BuildContext context) {
return Scaffold(
body: SizedBox(
height: playerHeight,
width: playerWidth,
child: new VlcPlayer(
aspectRatio: 16 / 9,
url: urlToStreamVideo,
controller: controller,
placeholder: Center(child: CircularProgressIndicator()),
)
)
);
}
}