Skip to content

Video player iOS HDR videos look washed out #143080

Description

@mcosti

Steps to reproduce

  1. Load this video into the video player: https://rcwl-prod.s3.eu-west-2.amazonaws.com/files/15d8fd20-80fe-4829-9c28-8766ae5bbd25/PRE_AND_POST_NATAL/FINAL_FULL_BODY_PREG_WORKOUT_WITH_HILS.mp4
  2. See that the colors are washed out (at least on iOS)

Expected results

Colors should look correctly.

Actual results

Colors are washed out

Code sample

Code sample
import 'package:flutter/material.dart';
import 'package:video_player/video_player.dart';

void main() => runApp(const VideoApp());

/// Stateful widget to fetch and then display video content.
class VideoApp extends StatefulWidget {
  const VideoApp({Key? key}) : super(key: key);

  @override
  _VideoAppState createState() => _VideoAppState();
}

class _VideoAppState extends State<VideoApp> {
  late VideoPlayerController _controller;

  @override
  void initState() {
    super.initState();
    _controller = VideoPlayerController.network(
      videoPlayerOptions: VideoPlayerOptions(allowBackgroundPlayback: true),
      'https://rcwl-prod.s3.eu-west-2.amazonaws.com/files/15d8fd20-80fe-4829-9c28-8766ae5bbd25/PRE_AND_POST_NATAL/FINAL_FULL_BODY_PREG_WORKOUT_WITH_HILS.mp4',
    )..initialize().then((_) {
        // Ensure the first frame is shown after the video is initialized, even before the play button has been pressed.
        setState(() {});
      });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Video Demo',
      home: Scaffold(
        body: Center(
          child: _controller.value.isInitialized
              ? AspectRatio(
                  aspectRatio: _controller.value.aspectRatio,
                  child: VideoPlayer(_controller),
                )
              : const CircularProgressIndicator(),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: () {
            setState(() {
              _controller.value.isPlaying ? _controller.pause() : _controller.play();
            });
          },
          child: Icon(
            _controller.value.isPlaying ? Icons.pause : Icons.play_arrow,
          ),
        ),
      ),
    );
  }

  @override
  void dispose() {
    super.dispose();
    _controller.dispose();
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.16.9, on macOS 14.1 23B74 darwin-arm64, locale en-NL)
    • Flutter version 3.16.9 on channel stable at /opt/homebrew/Caskroom/flutter/3.16.3/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 41456452f2 (13 days ago), 2024-01-25 10:06:23 -0800
    • Engine revision f40e976bed
    • Dart version 3.2.6
    • DevTools version 2.28.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    r: duplicateIssue is closed as a duplicate of an existing issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions