Skip to content

Add Android support for MauiMediaElementHandler#742

Open
prathameshnarkhede wants to merge 1 commit intomainfrom
pratham/add-android-support-for-popup-media-view
Open

Add Android support for MauiMediaElementHandler#742
prathameshnarkhede wants to merge 1 commit intomainfrom
pratham/add-android-support-for-popup-media-view

Conversation

@prathameshnarkhede
Copy link
Copy Markdown
Contributor

@prathameshnarkhede prathameshnarkhede commented Apr 27, 2026

Implemented MauiMediaElementHandler and MauiVideoPlayer for Android, enabling video playback with VideoView.

Currently, the control supports 16:9 aspect ratio and any video will get fit into that ratio.

Screen.Recording.2026-04-27.114714.mp4

@@ -1,4 +1,4 @@
#if WINDOWS || __IOS__
#if WINDOWS || __IOS__ || ANDROID
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code that creates MauiMediaElement in HtmlToView still excludes Android. Looks like you had this change in an earlier commit (047111de#diff-afafce18e1ef9ab1fae6bd73694a1a77532312212518ab8f140de36224420da7) -- did that accidentally get reverted?

},
};

_videoView = new VideoView(context)
Copy link
Copy Markdown
Collaborator

@mstefarov mstefarov Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tried this with audio?

MauiMediaElement is created for both MarkupType.Audio and MarkupType.Video. iOS uses AVPlayer and Windows uses MediaPlayerElement; both handle audio fine. I am not sure if Android's VideoView does.


_videoView.SetVideoURI(Android.Net.Uri.Parse(source.ToString()));
_videoView.RequestFocus();
_videoView.Start();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means the video always auto-plays, right? We probably shouldn't do that, in case a popup has multiple videos. Our iOS and Windows players require a click to play.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants