video_js_player 0.0.18
video_js_player: ^0.0.18 copied to clipboard
Video Library for Flutter, Easily use famuse video.js in flutter web
Web Video Player for Flutter
A Flutter package that provides a web-based video player using Video.js and flutter_inappwebview. This package allows you to integrate a customizable video player in your Flutter application with features like full-screen mode, picture-in-picture, track selection, and more.
π Features
-
Play videos from various sources using Video.js
-
Full-screen and Picture-in-Picture (PiP) support
-
Seek, play, and pause controls
-
Change text and audio tracks dynamically
-
Add remote text tracks (subtitles)
-
Works on Android, iOS, and Web
π¦ Installation
Add the package to your pubspec.yaml:
dependencies:
web_video_player: latest_version
Then, run:
flutter pub get
π§ Usage
1οΈβ£ Import the package:
import 'package:web_video_player/web_video_player.dart';
2οΈβ£ Initialize the Controller:
final _controller = WebVideoPlayerController();
3οΈβ£ Embed the Player:
WebVideoPlayer(
controller: _controller,
source: WebPlayerSource(
src: "https://your-video-url.mp4",
type: "video/mp4",
),
)
π API & Controls
| Method | Description |
|---|---|
| play() | Plays the video |
| pause() | Pauses the video |
| seekTo(seconds) | Seeks to a specific time |
| toggleFullScreenMode() | Toggles full-screen mode |
| requestPictureInPicture() | Enables Picture-in-Picture mode |
| changeTextTrack(id) | Changes the subtitle track |
| changeAudioTracks(id) | Changes the audio track |
| addRemoteTextTrack({...}) | Adds external subtitles |
π₯οΈ Platform Support
| Platform | Support |
|---|---|
| β Android | βοΈ |
| β iOS | βοΈ |
| β Web | βοΈ |
π‘ Notes
This package uses flutter_inappwebview to embed Video.js in a WebView.
π License
This project is licensed under the MIT License.
π¬ Contact & Contributions
Contributions are welcome! Feel free to open an issue or submit a pull request. π
