Video Player HDR
A fork of the official Flutter video_player
plugin with HDR (High Dynamic Range) support for Android and iOS. This package exposes the option of using platform views in addition to the texture view currently offered by video_player
.
Features
- Play HDR videos using platform views.
- Detect if the device supports HDR playback.
- Query supported HDR formats.
- Check for wide color gamut support.
- Retrieve video metadata, including HDR information.
- All standard features of the original
video_player
plugin.
Supported Platforms
- Android
- iOS
- macOS (fallbacks to
video_player_avfoundation
) - Web (fallbacks to
video_player_web
)
Installation
Add the following to your pubspec.yaml
:
dependencies:
video_player_hdr: ^1.0.0
Then run:
flutter pub get
Usage
Import the package:
import 'package:video_player_hdr/video_player_hdr.dart';
Basic Example
final controller = VideoPlayerHdrController.asset('assets/videos/sample_hdr_video.mp4');
await controller.initialize();
controller.play();
HDR Features
final isHdrSupported = await controller.isHdrSupported();
final supportedHdrFormats = await controller.getSupportedHdrFormats();
final isWideColorGamut = await controller.isWideColorGamutSupported();
final metadata = await controller.getVideoMetadata();
Example App
A full example is available in the example/
directory.
It demonstrates:
- HDR video playback
- Checking HDR support
- Listing supported HDR formats
- Wide color gamut detection
- Retrieving video metadata
API
isHdrSupported()
: Checks if the device supports HDR playback.getSupportedHdrFormats()
: Returns a list of HDR formats supported by the device.isWideColorGamutSupported()
: Checks if the device supports wide color gamut.getVideoMetadata()
: Retrieves metadata from the video.
Note: These methods are only available on Android and iOS.
Migrating from video_player
This package is a drop-in replacement for the official video_player
plugin.
Just replace your imports and controller instantiations with video_player_hdr
.
Issues & Feedback
Please report issues and feature requests on the GitHub issue tracker.
License
This project is a fork of the official Flutter video_player
plugin and retains its original BSD 3-Clause license.
See LICENSE for details.
Authors and Contributors
Significant modifications and HDR support by Rubén Gómez López (rubengmlp@gmail.com).