WebView Not Respecting video tag "playsinline" attribute
See original GitHub issueBug Report
Problem
What is expected to happen?
When a video tag contains the playsinline
attribute I expect the video to be played in the confines of the webview
What does actually happen?
The video is being rendered in a native full screen viewer.
Information
Command or Code
Create a Cordova app that has the following video tag in the webview:
<video id="video-player" autoplay playsinline controls src="https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4"/>
When you start the cordova app you will see the video played full screen.
The same tag served to a Safari Browser behaves properly and doesn’t render it full screen.
Environment, Platform, Device
Running on iPad (MLMP2LL/A) with iOS 15.0
Version information
Cordova ios platform: 6.2.0
Checklist
- I searched for existing GitHub issues
- I updated all Cordova tooling to most recent version
- [x ] I included all the necessary information above
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
How can i force playsinline for all <video> content
I have added the 'playsinline' attribute after the HTML page is fully loaded there is no issue with that and it works okay....
Read more >iOS: using <video> doesn't respect playsinline and when ...
Started a brand new ionic project and added this plugin. added this video code. <video width="300" controls playsinline muted ...
Read more >allowsInlineMediaPlayback not being respected in iOS 10 ...
We have a problem with iOS 10 Beta 5 and 6 (not sure about prior) where the allowsInlineMediaPlayback property is not being respected....
Read more >playsinline not being respected on iOS
We have an HTML video element included in our index.html file which has a source that is dynamically loaded based on various triggers...
Read more >The Video Embed element - HTML - MDN Web Docs - Mozilla
A Boolean attribute indicating that the video is to be played "inline", that is within the element's playback area. Note that the absence...
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 FreeTop 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
Top GitHub Comments
@breautek - Perfect! That did the trick. Thanks so much for the quick response.
For me, the code magically started to work on it’s own. Currently I have the following line under “<platform name="ios">”
<preference name="AllowInlineMediaPlayback" value="true" />
Before this config started to work by itself, I remember doing the following as a stop-gap:
Change the file in step 2 to say true instead of false. You might need to do this every time you add ios platform.