-
Notifications
You must be signed in to change notification settings - Fork 1
[DRAFT] video_player platform view support #1
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
Conversation
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.
Whole file content extracted from FVPVideoPlayerPlugin.m
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.
This code was a part of FVPVideoPlayer class. It is all related to texture approach. I extracted it from FVPVideoPlayer and put here. This class extends FVPVideoPlayer and adds texture approach specific code.
...ndation/Sources/video_player_avfoundation/include/video_player_avfoundation/FVPVideoPlayer.h
Outdated
Show resolved
Hide resolved
4059fbf to
15618d5
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.
I had to add many of these methods to the interface because they were referenced in FVPVideoPlayerPlugin.m (and now the player is not longer a part of that file)
a0ac882 to
3ff70e8
Compare
223fedc to
282e746
Compare
eae938d to
60a1733
Compare
0b8d7ec to
3b55eec
Compare
|
Already merged in parent repository, this one served just as a preview. Closing |
This PR adds support for platform views on iOS as a way of displaying a video. When creating a video, it's now possible to choose between texture view approach (rendered using
Texturewidget on the Flutter side) and platform view approach (rendered on the native side, usingAVPlayerLayer).FVPVideoPlayerclass now has nothing to do with texture. The texture-related code was moved from it toFVPVideoPlayerTextureApproach- a subclass ofFVPVideoPlayerthat adds texture functionality. In the plugin class (createWithOptionsmethod) we create either the basic version (for platform view) or the texture subclass (in case of texture approach) based on the parameter passed in from Flutter side.Platform view is only supported on iOS, no MacOS implementation is added in this PR. The functionality is not yet exposed in the app-facing package (only in example app) - it will be done later, once we add the Android implementation. The PR does not introduce breaking changes, I followed the rule "non-breaking changes, even at the expense of a less-clean API" (
buildViewWithOptionsmethod,viewTypeinDataSource).Up to this point, the variable naming relied heavily on the texture (we had a lot of
textureIdvariables and properties). Since now you can use a platform view instead of a texture view, these variables and parameters will be renamed to justplayerId. This will be done in a separate PR to keep git diff for this one clean.I left some comments in the PR to clarify/discuss some choices.
Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.mdto 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.