Add Android support for MauiMediaElementHandler#742
Add Android support for MauiMediaElementHandler#742prathameshnarkhede wants to merge 1 commit intomainfrom
Conversation
| @@ -1,4 +1,4 @@ | |||
| #if WINDOWS || __IOS__ | |||
| #if WINDOWS || __IOS__ || ANDROID | |||
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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.
Implemented
MauiMediaElementHandlerandMauiVideoPlayerfor 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