You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
[video_player_web, video_player] Detect DOM playback/init errors and convert them to PlatformExceptions (#2483)
video_player_web:
* Add a `PlatformException` to the event Stream `onError`, instead of the Event coming straight from the DOM.
* Handle videoElement.play() rejection. Funnel that as a PlatformException to the event Stream as well.
* Update documentation about web-specific _quirks and features_.
video_player:
* Add documentation about the web platform.
Copy file name to clipboardExpand all lines: packages/video_player/video_player/README.md
+11-2Lines changed: 11 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,15 +40,24 @@ Ensure the following permission is present in your Android Manifest file, locate
40
40
41
41
The Flutter project template adds it, so it may already be there.
42
42
43
-
### Supported Formats
43
+
### Web
44
+
45
+
This plugin compiles for the web platform since version `0.10.5`, in recent enough versions of Flutter (`>=1.12.13+hotfix.4`).
46
+
47
+
> The Web platform does **not** suppport `dart:io`, so attempts to create a `VideoPlayerController.file` will throw an `UnimplementedError`.
48
+
49
+
Different web browsers may have different video-playback capabilities (supported formats, autoplay...). Check [package:video_player_web](https://pub.dev/packages/video_player_web) for more web-specific information.
50
+
51
+
## Supported Formats
44
52
45
53
- On iOS, the backing player is [AVPlayer](https://developer.apple.com/documentation/avfoundation/avplayer).
46
54
The supported formats vary depending on the version of iOS, [AVURLAsset](https://developer.apple.com/documentation/avfoundation/avurlasset) class
47
55
has [audiovisualTypes](https://developer.apple.com/documentation/avfoundation/avurlasset/1386800-audiovisualtypes?language=objc) that you can query for supported av formats.
48
56
- On Android, the backing player is [ExoPlayer](https://google.github.io/ExoPlayer/),
49
57
please refer [here](https://google.github.io/ExoPlayer/supported-formats.html) for list of supported formats.
58
+
- On Web, available formats depend on your users' browsers (vendor and version). Check [package:video_player_web](https://pub.dev/packages/video_player_web) for more specific information.
Copy file name to clipboardExpand all lines: packages/video_player/video_player_web/CHANGELOG.md
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,12 @@
1
+
## 0.1.2
2
+
3
+
* Add a `PlatformException` to the player's `eventController` when there's a `videoElement.onError`. Fixes https://github.com/flutter/flutter/issues/48884.
4
+
* Handle DomExceptions on videoElement.play() and turn them into `PlatformException` as well, so we don't end up with unhandled Futures.
5
+
* Update setup instructions in the README.
6
+
1
7
## 0.1.1+1
2
8
3
-
- Add an android/ folder with no-op implementation to workaround https://github.com/flutter/flutter/issues/46898.
9
+
* Add an android/ folder with no-op implementation to workaround https://github.com/flutter/flutter/issues/46898.
Copy file name to clipboardExpand all lines: packages/video_player/video_player_web/README.md
+43-12Lines changed: 43 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,26 +4,57 @@ The web implementation of [`video_player`][1].
4
4
5
5
## Usage
6
6
7
-
To use this plugin in your Flutter Web app, simply add it as a dependency in
8
-
your pubspec using a `git` dependency. This is only temporary: in the future
9
-
we hope to make this package an "endorsed" implementation of `video_player`,
10
-
so that it is automatically included in your Flutter Web app when you depend
11
-
on `package:video_player`.
7
+
This package is the endorsed implementation of `video_player` for the web platform since version `0.10.5`, so it gets automatically added to your application by depending on `video_player: ^0.10.5`.
8
+
9
+
No further modifications to your `pubspec.yaml` should be required in a recent enough version of Flutter (`>=1.12.13+hotfix.4`):
12
10
13
11
```yaml
12
+
...
14
13
dependencies:
15
-
video_player: ^0.10.4
16
-
video_player_web:
17
-
git:
18
-
url: git://github.com/flutter/plugins.git
19
-
path: packages/video_player/video_player_web
14
+
...
15
+
video_player: ^0.10.5
16
+
...
20
17
```
21
18
22
-
Once you have the `video_player_web` dependency in your pubspec, you should
23
-
be able to use `package:video_player` as normal.
19
+
Once you have the correct `video_player` dependency in your pubspec, you should
20
+
be able to use `package:video_player` as normal, even from your web code.
21
+
22
+
## dart:io
23
+
24
+
The Web platform does **not** suppport `dart:io`, so attempts to create a `VideoPlayerController.file` will throw an `UnimplementedError`.
24
25
25
26
## Autoplay
26
27
Playing videos without prior interaction with the site might be prohibited
27
28
by the browser and lead to runtime errors. See also: https://goo.gl/xX8pDD.
28
29
30
+
## Supported Formats
31
+
32
+
**Different web browsers support different sets of video codecs.**
33
+
34
+
### Video codecs?
35
+
36
+
Check MDN's [**Web video codec guide**](https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Video_codecs) to learn more about the pros and cons of each video codec.
37
+
38
+
### What codecs are supported?
39
+
40
+
Visit [**caniuse.com: 'video format'**](https://caniuse.com/#search=video%20format) for a breakdown of which browsers support what codecs. You can customize charts there for the users of your particular website(s).
41
+
42
+
Here's an abridged version of the data from caniuse, for a Global audience:
43
+
44
+
#### MPEG-4/H.264
45
+
[](https://caniuse.com/#feat=mpeg4)
46
+
47
+
#### WebM
48
+
[](https://caniuse.com/#feat=webm)
49
+
50
+
#### Ogg/Theora
51
+
[](https://caniuse.com/#feat=ogv)
52
+
53
+
#### AV1
54
+
[](https://caniuse.com/#feat=av1)
55
+
56
+
#### HEVC/H.265
57
+
[](https://caniuse.com/#feat=hevc)
0 commit comments