mohe_native_player 1.11.4 copy "mohe_native_player: ^1.11.4" to clipboard
mohe_native_player: ^1.11.4 copied to clipboard

A Flutter native video player plugin for iOS and Android with full-featured controls, HLS/DASH support, danmaku, DLNA casting, PiP, and more.

mohe_native_player #

A Flutter native video player plugin for iOS and Android with full-featured controls, HLS/DASH support, danmaku (barrage), DLNA casting, Picture-in-Picture, and more.

Features #

  • Native playback - Uses platform-native players (AVPlayer on iOS, ExoPlayer on Android)
  • HLS & DASH - Supports m3u8, mpd streaming formats
  • Full controls - Play, pause, seek, volume, brightness, playback speed
  • Danmaku/Barrage - Built-in danmaku overlay support
  • DLNA casting - Cast video to DLNA devices
  • Picture-in-Picture - PiP mode on supported devices
  • Fullscreen - Portrait and landscape fullscreen with orientation lock
  • Episode selector - Built-in episode list UI
  • Quality selector - Multi-quality HLS switching
  • Custom UI - Customizable progress bar, buttons, loading GIF, toast

Platform Support #

Platform Support
iOS
Android

Installation #

Add to your pubspec.yaml:

dependencies:
  mohe_native_player: ^1.11.4

Then run:

flutter pub get

Usage #

import 'package:mohe_native_player/mohe_native_player.dart';

// Create a controller
final controller = PlayerController();

// Build the player view
PlayerView(controller: controller)

// After the view is created, play a video
await controller.play('https://example.com/video.m3u8');

// Listen to events
controller.eventStream.listen((event) {
  print('Event: ${event.event} ${event.params}');
});

// Control playback
await controller.pause();
await controller.resume();
await controller.seek(30.0);  // Seek to 30 seconds
await controller.setRate(1.5);  // 1.5x speed
await controller.enterFullscreen();

API Overview #

PlayerController #

  • Playback: play(), pause(), resume(), stop(), seek()
  • Info: getCurrentTime(), getDuration(), getCurrentVideoDisplayInfo(), getVolume(), getBrightness()
  • Settings: setRate(), setVolume(), setMuted(), setBrightness()
  • Load failure: setLoadFailureDetection() — detect load/stall timeout and surface an error event with a reason (see PlayerLoadFailureReason) so you can show a "load failed / retry" UI
  • Fullscreen: enterFullscreen(), exitFullscreen(), lockOrientation()
  • Danmaku: addBarrageText(), setBarrageVisible(), clearBarrage()
  • PiP: enterPIP(), exitPIP()
  • DLNA: startDLNADiscovery(), connectDLNADevice(), dlnaPlay(), etc.
  • UI: setPlayerTitle(), setProgressSliderColor(), showEpisodeSelector(), etc.

PlayerView #

A widget that renders the native video player. Pass a PlayerController to control playback and receive events.

License #

MIT

2
likes
140
points
1.48k
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter native video player plugin for iOS and Android with full-featured controls, HLS/DASH support, danmaku, DLNA casting, PiP, and more.

Repository

License

MIT (license)

Dependencies

flutter, screen_brightness, volume_controller

More

Packages that depend on mohe_native_player

Packages that implement mohe_native_player