Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 661 Bytes

useAssetVideo.md

File metadata and controls

31 lines (24 loc) · 661 Bytes

useAssetVideo

Creates VideoPlayerController using video_player, plays video obtained from an asset, tracks its state, and exposes playback controls.

Installation

Depends on video_player.

dependencies:
  flutter_use_video: ^0.0.2

Usage

class Sample extends HookWidget {
  @override
  Widget build(BuildContext context) {
    final videoController = useAssetVideo(
      asset: "assets/video/get_started.mp4",
      autoPlay: true,
      looping: true,
    );

    return Container(
      child: VideoPlayer(videoController),
    );
  }
}