webf_video_player library
WebF Video Player - HTML5-compatible video playback for WebF applications.
This package provides a <webf-video-player> custom element that wraps
Flutter's video_player package with an HTML5-compatible API.
Quick Start
- Install the package in your WebF application
- Call
installWebFVideoPlayer()in your main() function - Use
<webf-video-player>in your HTML/JavaScript code
Dart Setup
import 'package:webf_video_player/webf_video_player.dart';
void main() {
installWebFVideoPlayer();
runApp(MyApp());
}
JavaScript Usage
<webf-video-player
src="https://example.com/video.mp4"
controls
autoplay
muted
loop
></webf-video-player>
Supported Properties
src- Video source URL (http://, https://, asset://, file://)poster- Poster image URLautoplay- Auto-start playbackcontrols- Show playback controlsloop- Loop video continuouslymuted- Mute audiovolume- Volume level (0.0 to 1.0)playbackRate- Playback speed (0.5 to 2.0)currentTime- Current position in secondsobjectFit- Video sizing (contain, cover, fill, none)
Supported Events
play,pause,ended- Playback state changestimeupdate- Periodic position updatesloadstart,loadedmetadata,canplay- Loading eventserror- Error eventsvolumechange,ratechange- Settings changes
Supported Methods
play()- Start playbackpause()- Pause playbackload()- Reload video sourcecanPlayType(mimeType)- Check MIME type support
Classes
- WebFVideoPlayer
- WebF custom element that wraps Flutter's VideoPlayer.
- WebFVideoPlayerState
Functions
-
installWebFVideoPlayer(
) → void - Installs the WebF Video Player custom element.