Skip to content
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

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

FirentisTFW
Copy link
Contributor

@FirentisTFW FirentisTFW commented Jan 21, 2025

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, using SurfaceView).

VideoPlayer class now has nothing to do with texture. The texture-related code was moved from it to TextureBasedVideoPlayer - a subclass of VideoPlayer that adds texture functionality. In the plugin class (create method) we create either the basic version (for platform view) or the texture subclass (in case of texture approach) 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:

  • #86613 - this issue requests platform view support for iOS. Here we also add it for the Android, so that it works on both mobile platforms.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@FirentisTFW FirentisTFW force-pushed the feature/video-player-android-platform-view-support branch from 1bd40ac to 773cfc1 Compare January 28, 2025 11:37
@FirentisTFW FirentisTFW marked this pull request as ready for review January 28, 2025 14:38
@FirentisTFW FirentisTFW requested a review from camsim99 as a code owner January 28, 2025 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant