Skip to content

[macOS] video_player: PlatformException on .mp4 video asset (OSStatus error -101) while .mov works. #176448

@priyankgandhi0

Description

@priyankgandhi0

Steps to reproduce

Steps to Reproduce

  1. Create a new Flutter project.
  2. Add the dependency:

dependencies:
video_player: ^2.9.2

Expected results

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

class VideoExample extends StatefulWidget {
  const VideoExample({super.key});

  @override
  State<VideoExample> createState() => _VideoExampleState();
}

class _VideoExampleState extends State<VideoExample> {
  late VideoPlayerController _controller;

  @override
  void initState() {
    super.initState();
    _controller = VideoPlayerController.asset("assets/sample.mp4")
      ..initialize().then((_) {
        setState(() {});
        _controller.play();
      });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: _controller.value.isInitialized
            ? AspectRatio(
                aspectRatio: _controller.value.aspectRatio,
                child: VideoPlayer(_controller),
              )
            : const CircularProgressIndicator(),
      ),
    );
  }
}


Actual results

  1. The app runs on macOS.
  2. The video does not load.
  3. flutter: Video Error: PlatformException(VideoError, Failed to load video: The operation could not be completed: An unknown error occurred (-101): The operation couldn’t be completed. (OSStatus error -101.), null, null)

this errro printed

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

flutter: Video Error: PlatformException(VideoError, Failed to load video: The operation could not be completed: An unknown error occurred (-101): The operation couldn’t be completed. (OSStatus error -101.), null, null)

Flutter Doctor output

Doctor output
[Paste your output here]

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: desktopRunning on desktopfound in release: 3.35Found to occur in 3.35found in release: 3.37Found to occur in 3.37has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: video_playerThe Video Player pluginpackageflutter/packages repository. See also p: labels.platform-macBuilding on or for macOS specificallyteam-macosOwned by the macOS platform teamtriaged-macosTriaged by the macOS platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions