native_video_player 3.0.0 copy "native_video_player: ^3.0.0" to clipboard
native_video_player: ^3.0.0 copied to clipboard

A Flutter widget to play videos on iOS and Android using a native implementation.

3.0.0 #

Breaking Changes #

  • Removed PlaybackInfo class - all information now accessible directly from controller

    final duration = controller.videoInfo?.duration;
    final position = controller.playbackPosition;
    
    copied to clipboard
  • Controllers must now be explicitly disposed using dispose() method

    @override
    void dispose() {
      _eventsSubscription?.cancel();
      controller.dispose();
      super.dispose();
    }
    
    copied to clipboard
  • Removed init constructor from VideoSource class

    await controller.loadVideo(
      VideoSource(
        path: 'path/to/file',
        type: VideoSourceType.asset,
      ),
    );
    
    copied to clipboard
  • seekTo and playback position values now use Duration instead of seconds (#26)

    controller.seekTo(Duration(seconds: 3));
    
    copied to clipboard
  • Events-based API replaces callback system

    _eventsSubscription = controller.events.listen((event) {
      switch (event) {
        case PlaybackStatusChangedEvent():
          // Handle status change
          final playbackStatus = controller.playbackStatus;
        // Handle other events...
      }
    });
    
    copied to clipboard

Major Changes #

  • Targeting Dart 3.5 and Flutter 3.24
  • API redesign using events instead of callbacks
  • Using ExoPlayer on Android
  • Set Compile SDK to 35 on Android

Improvements #

  • Improved error reporting on Android
  • Improved example

Bug Fixes #

  • Fixed audio playback on iOS when device is in silent mode (#22)
  • Fixed memory leaks on iOS and Android

3.0.0-dev.4 #

  • Fixed memory leaks on iOS and Android

3.0.0-dev.3 #

  • Using ExoPlayer on Android
  • Set Compile SDK to 35 on Android

3.0.0-dev.2 #

  • Improved error reporting on android
  • Improved example

3.0.0-dev.1 #

  • Targeting Dart 3.5 and Flutter 3.24
  • API redesign using events instead of callbacks
  • Removed PlaybackInfo class - all information now accessible directly from controller
  • Controllers must now be explicitly disposed using dispose() method
  • Removed init constructor from VideoSource class
  • seekTo and playback position values now use Duration instead of seconds (#26)
  • Fixed audio playback on iOS when device is in silent mode (#22)

2.0.0 #

  • Added support for sending optional headers to the native players to stream videos behind authentication (thanks to @shenlong-tanwen)
  • Notify when video isn't playable on iOS (thanks to @ashilkn)
  • Upgrading to Gradle 8 (thanks to @Pablo-Aldana)
  • minSdkVersion on Android is now 21
  • Upgraded dependencies

1.3.1 #

  • Fixed #10
  • Split example into multiple files
  • Upgraded dependencies

1.3.0 #

  • Targeting Dart 3.0 and Flutter 3.10

1.2.0+3 #

  • BREAKING: NativeVideoPlayerController now throws exceptions that must be handled by the caller.
  • Added new method to set playback speed
  • Exposed more controller events (playback speed and volume changed)

1.1.0+2 #

  • Fixed gifs not showing in Readme

1.1.0 #

  • Targeting Flutter 3

1.0.3 #

  • Fixed publishing error

1.0.2 #

  • Fixed videos not playing on iOS 14

1.0.1 #

  • First public release
75
likes
160
points
1.62k
downloads

Publisher

verified publisheralbemala.me

Weekly Downloads

2024.09.08 - 2025.03.23

A Flutter widget to play videos on iOS and Android using a native implementation.

Repository (GitHub)
View/report issues

Documentation

API reference

Funding

Consider supporting this project:

github.com
www.buymeacoffee.com

License

MIT (license)

Dependencies

flutter, path, path_provider

More

Packages that depend on native_video_player