HTML5 video not working on MAUI WebView
See original GitHub issueDescription
If I want to add video in my MAUI Blazor App I have a problem with rendering this video on iOS. On Android works well. I think the problem is in BlazorWebView component.
UPDATE This applies to all MAUI webviews, so is not Blazor-specific.
Steps to Reproduce
-
Create a new blank .NET MAUI Blazor App
-
Add some sample video mp4 file into the wwwroot/videos folder

-
Replace content of Index.razor page with content below:
@page "/"
<h1>Hello, world!</h1>
Welcome to your new app.
<video autoplay muted loop playsinline class="slideContent">
<source src="videos/TRIMOTERM.mp4" type="video/mp4">
</video>
-
Run app on Android. All good.

-
Run app on iPhone 12 (iOS 15.2) and nothing is shown where video could be.

Version with bug
Preview 13 (current)
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
iPhone 12 iOS 15.2, Xcode 13.2.1, VS 17.2.0 Preview 1.0
Did you find any workaround?
No
Relevant log output
Nothing
Issue Analytics
- State:
- Created 2 years ago
- Comments:28 (10 by maintainers)
Top Results From Across the Web
Issue with displaying the camera stream in an inline video ...
I am creating a . net maui application blazor hosted. This app uses RecordRTC. js to access the camera.
Read more >In a .NET Maui Blazor application, can you play a video ...
In a .NET Maui Blazor application, can you play a video (using the video HTML5 element) by pointing the source attribute directly to...
Read more >WebView - .NET MAUI
This article explains how to use the .NET MAUI WebView to display remote web pages, local HTML files, and HTML strings.
Read more >The HTML5 service worker and WebAssembly - .NET MAUI ...
- [Instructor] For this video, we are going to use a new, very simple MAUI Blazor application that does one thing: navigate out...
Read more >Managing WebView objects
Android provides several APIs to help you manage the WebView objects that display web content in your app. This page describes how to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In the meantime, if you’re looking to make this work today, in .NET 7, you can customize the platform view factory or WebViewHandler like this:
Thank you for that! Had a quick look and here is the weird thing… If I add the
controlsattribute to the video to show the controls and actually click the play button it works just fine. So it seems like there is something preventing it from playing automatically. Not sure if this is a bug on our side then though.