-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[video_player_android] Platform view support #8466
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[video_player_android] Platform view support #8466
Conversation
1bd40ac
to
773cfc1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mostly LG.
Holding off on approval so @camsim99 can also take a look. Thanks for addressing the comments!
...yer_android/android/src/main/java/io/flutter/plugins/videoplayer/ExoPlayerEventListener.java
Outdated
Show resolved
Hide resolved
...yer_android/android/src/main/java/io/flutter/plugins/videoplayer/ExoPlayerEventListener.java
Outdated
Show resolved
Hide resolved
...o_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java
Outdated
Show resolved
Hide resolved
...o_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java
Show resolved
Hide resolved
...o_player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerPlugin.java
Show resolved
Hide resolved
...player_android/android/src/main/java/io/flutter/plugins/videoplayer/VideoPlayerProvider.java
Outdated
Show resolved
Hide resolved
packages/video_player/video_player_android/lib/src/android_video_player.dart
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other changes look reasonable to me, thanks!!
@stuartmorgan @camsim99 @matanlurey Thanks for the review! I did some lasts manual tests on a couple of devices and everything seems to be working fine. I'll go ahead and merge this one. |
flutter/packages@9e4684e...abba683 2025-03-05 [email protected] [camera_avfoundation] Tests backfilling - part 1 (flutter/packages#8698) 2025-03-04 [email protected] [go_router_builder]: Fix `The argument type 'String?' can't be assigned to the parameter type 'String' because 'String?' ` on path and query params (flutter/packages#8737) 2025-03-04 [email protected] [video_player_android] Platform view support (flutter/packages#8466) 2025-03-04 [email protected] [webview_flutter_wkwebview] Fixes crash with nil `WKFrameInfo.request` (flutter/packages#8766) 2025-03-03 [email protected] Manual roll Flutter from 842db35 to 04d3934 (4 revisions) (flutter/packages#8775) 2025-03-03 [email protected] Roll Flutter from 842db35 to 04d3934 (4 revisions) (flutter/packages#8774) 2025-03-03 [email protected] [flutter_plugin_android_lifecycle] Uses flutter.compileSdkVersion, bumps minimum flutter version to 3.27 (flutter/packages#8760) 2025-03-03 [email protected] [google_sign_in] Add Android account name field as optional (platform interface changes) (flutter/packages#8735) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages-flutter-autoroll Please CC [email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
This PR adds support for platform views on Android as a way of displaying a video. When creating a video, it's now possible to choose between texture view approach (rendered using
Texture
widget on the Flutter side) and platform view approach (rendered on the native side, usingSurfaceView
).VideoPlayer
class now has nothing to do with texture. The texture-related code was moved from it toTextureVideoPlayer
- a subclass ofVideoPlayer
that adds texture functionality. There's alsoPlatformViewVideoPlayer
- a subclass ofVideoPlayer
that adds platform view functionality. In the plugin class (create
method) we create either the platform view version or the texture version based on the parameter (viewType
) passed in from Flutter side.The functionality is not yet exposed in the app-facing package (only in the example app) - it will be done in a separate PR. The PR does not introduce breaking changes.
Related issues:
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to add a description of the change, following repository CHANGELOG style, or this PR is exempt from CHANGELOG changes.///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.