文件最后提交记录最后更新时间
[video_player] Update tests for deprecatitons (#9463) Replaces video_player_web integration test usage of the legacy create and buildView methods with their replacements. No issue; updating per https://github.com/flutter/flutter/blob/main/docs/infra/Packages-Gardener-Rotation.md#deprecations ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.11 个月前
[video_player_web] Fix blank first frame on iOS. (#9025) Fixes [First Frame of Video Once VideoPlayer Controller doesn't show in iOS Safari/Chrome](https://github.com/flutter/flutter/issues/139107) This PR fixes the blank first frame issue by adding a _videoElement.load() call at the end of the initialize function. This call forces the browser to load media in preparation for playback (https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/load). Additionally, this PR removes loadedmetadata event listener, as the canplay event is now reliably emitted across all platforms. Keeping loadedmetadata listener could result in marking the video controller as initialized before the first frame is actually rendered. This causes the loader to disappear too early, leaving a blank space where the video should be until the browser displays the first frame. Relying on canplay ensures the first frame is ready before we proceed. > [!NOTE] > It turns out that this issue is iOS-specific and was reported not only in Flutter, but in some other packages and tools: > 1) [video-react/First frame not shown as the poster on iOS Safari](https://github.com/video-react/video-react/issues/328) > 2) [WordPress/gutenberg/Video Block: First frame not shown as the poster on iOS Safari — Fix: Use Fragment URL](https://github.com/WordPress/gutenberg/issues/51995) > [!TIP] > As a temporary workaround until this PR is merged, users can append the #t=0.001 fragment to the asset or URL src to force the browser to load the first frame (e.g., assets/butterfly.mp4#t=0.001, https://flutter.github.io/assets-for-api-docs/assets/videos/butterfly.mp4#t=0.001). The following repository was used for issue reproduction and testing: https://github.com/ksokolovskyi/video_player_blank_frame_bug | Before | After | | :---: | :---: | | https://video-player-blank-frame-bug.web.app | https://video-player-blank-frame-fix.web.app | | <video src="https://github.com/user-attachments/assets/4077fcc4-10cf-4dbd-8c59-2fd824b4e4c4" /> | <video src="https://github.com/user-attachments/assets/2951af36-1569-4a5c-90dd-1d52a5d1e7f2" /> | ## Pre-Review Checklist [^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.1 年前
[various] Enable avoid_print (#6842) * [various] Enable avoid_print Enables the avoid_print lint, and fixes violations (mostly by opting example files out of it). * Version bumps * Add tooling analysis option file that was accidentally omitted * Fix typo in analysis_options found by adding tool sub-options * Revert most version bumps * Fix ios_platform_images3 年前
[video_player] synchronize isPlaying state (#3261) [video_player] synchronize isPlaying state3 年前
Update repo for 3.32 stable (#9311) Does all of the steps from https://github.com/flutter/flutter/blob/master/docs/ecosystem/release/Updating-Packages-repo-for-a-stable-release.md for the 3.32 stable release (except the first one, as the stable roller has already landed).11 个月前
Standardize copyright year (#3737) Standardizes all first-party copyrights on a single year, as is done in flutter/flutter and flutter/engine. All code now uses 2013, which is the earliest year that was in any existing copyright notice. The script checks now enforce the exact format of first-party licenses and copyrights. Fixes flutter/flutter#784485 年前
[various] Update flutter.dev links to more reliable destinations (#6963) Contributes to https://github.com/flutter/website/issues/10363 by updating to the latest links and updating some links to use new /to/ links that can be updated as needed.1 年前
Update repo for 3.32 stable (#9311) Does all of the steps from https://github.com/flutter/flutter/blob/master/docs/ecosystem/release/Updating-Packages-repo-for-a-stable-release.md for the 3.32 stable release (except the first one, as the stable roller has already landed).11 个月前
README.md

video_player_web

The web implementation of video_player.

Usage

This package is endorsed, which means you can simply use video_player normally. This package will be automatically included in your app when you do, so you do not need to add it to your pubspec.yaml.

However, if you import this package to use any of its APIs directly, you should add it to your pubspec.yaml as usual.

Limitations on the Web platform

Video playback on the Web platform has some limitations that might surprise developers more familiar with mobile/desktop targets.

In no particular order:

dart:io

The web platform does not suppport dart:io, so attempts to create a VideoPlayerController.file will throw an UnimplementedError.

Autoplay

Attempts to start playing videos with an audio track (or not muted) without user interaction with the site ("user activation") will be prohibited by the browser and cause runtime errors in JS.

See also:

Some videos restart when using the seek bar/progress bar/scrubber

Certain videos will rewind to the beginning when users attempt to seekTo (change the progress/scrub to) another position, instead of jumping to the desired position. Once the video is fully stored in the browser cache, seeking will work fine after a full page reload.

The most common explanation for this issue is that the server where the video is stored doesn't support HTTP range requests.

NOTE: Flutter web's local server (the one that powers flutter run) DOES NOT support range requests, so all video assets in debug mode will exhibit this behavior.

See Issue #49360 for more information on how to diagnose if a server supports range requests or not.

Mixing audio with other audio sources

The VideoPlayerOptions.mixWithOthers option can't be implemented in web, at least at the moment. If you use this option it will be silently ignored.

Supported Formats

Different web browsers support different sets of video codecs.

Video codecs?

Check MDN's Web video codec guide to learn more about the pros and cons of each video codec.

What codecs are supported?

Visit caniuse.com: 'video format' for a breakdown of which browsers support what codecs. You can customize charts there for the users of your particular website(s).

Here's an abridged version of the data from caniuse, for a Global audience:

MPEG-4/H.264

Data on Global support for the MPEG-4/H.264 video format

WebM

Data on Global support for the WebM video format

Ogg/Theora

Data on Global support for the Ogg/Theora video format

AV1

Data on Global support for the AV1 video format

HEVC/H.265

Data on Global support for the HEVC/H.265 video format