vlc player plugin
vlc player
flutter plugin to view local videos and videos from the network. work example:
getting started
to start using the plugin, copy this code or follow the example:
import 'package:flutter/material.dart';
import 'package:flutter_vlc_player/vlc_player.dart';
import 'package:flutter_vlc_player/vlc_player_controller.dart';
class examplevideo extends statefulwidget {
@override
_examplevideostate createstate() => _examplevideostate();
}
class _examplevideostate extends state<examplevideo> {
final string urltostreamvideo = 'http://213.226.254.135:91/mjpg/video.mjpg';
final vlcplayercontroller controller = vlcplayercontroller();
final int playerwidth = 640;
final int playerheight = 360;
@override
widget build(buildcontext context) {
return scaffold(
body: vlcplayer(
defaultwidth: playerwidth,
defaultheight: playerheight,
url: urltostreamvideo,
controller: controller,
placeholder: center(child: circularprogressindicator()),
),
);
}
}
to take screenshot from video just follow next code:
uint8list image = await controller.makesnapshot();
Comments are closed.