Youtube embedded video does not work in cordova app on iOS

I am developing a mobile application with a corridor, and I really need to be able to play the embedded video from YouTube.

I tried to solve the problem for a while:

  • I set the playsinline attribute to 1 in the iframe API iframe

  • I put <preference name="AllowInlineMediaPlayback" value="true"/> in my config.xml file

  • Then I set AllowsInlineMediaPlayback to true in plist in Xcode

  • I am even trying to put webkit-playinginline directly on an iframe

The results look strange. When I first play my video, it becomes full screen. So I test my HTML through remote developer tools to check if the attribute is set well. It! I do the way I edited it, I leave it unchanged, and the magic happens: my video plays inline!

Obviously, I cannot ask my users to do this trick.

Anyone have an idea to solve this problem?

This is a kind of emergency problem ...

+5
source share
2 answers

There are several conf files in the cordova folder, the one that worked in my case with IOS is /Staging/config.xml Try adding conf to this file: preference name = "AllowInlineMediaPlayback" value = "true"

+2
source

More specifically, you can add this preference like @Patrice Tadrif mentioned in the answer above in Cordova config.xml

 <platform name="ios"> <preference name="AllowInlineMediaPlayback" value="true"> <platform> 
0
source

Source: https://habr.com/ru/post/1204836/


All Articles