Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 712 Bytes

useNetworkVideo.md

File metadata and controls

31 lines (24 loc) · 712 Bytes

useNetworkVideo

Creates VideoPlayerController using video_player, plays video obtained from the network, 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 = useNetworkVideo(
      dataSource: "https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4",
      autoPlay: true,
      looping: true,
    );

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