离子 - 嵌入式视频无法在ios上运行

时间:2022-04-25 04:34:22

I have an ionic app where I am displaying videos and that works fine when I test it in chrome browser and on android device, but nothing gets displayed on iphone. This is my html code:

我有一个离子应用程序,我正在显示视频,当我在Chrome浏览器和Android设备上测试时工作正常,但在iPhone上没有显示任何内容。这是我的HTML代码:

<iframe ng-show="article.external_media.length > 0 && article.external_media.url != ''" ng-src="{{article.external_media[0].url | safeUrl }} "></iframe>

2 个解决方案

#1


4  

I am posting the solution I found to the problem if anyone will need it in the future.This is what finally got the iframes to work on ios:

我发布了我发现问题的解决方案,如果有人将来需要它。这就是最终让iframe工作在ios上:

<allow-navigation href="*" />

#2


0  

If the problem comes from ios blocking external requests, add a configuration line on you .plist file like so:

如果问题来自ios阻止外部请求,请在.plist文件上添加配置行,如下所示:

<key>NSAppTransportSecurity</key>
<dict>
  <key>NSAllowsArbitraryLoads</key>
  <true/>
</dict>

#1


4  

I am posting the solution I found to the problem if anyone will need it in the future.This is what finally got the iframes to work on ios:

我发布了我发现问题的解决方案,如果有人将来需要它。这就是最终让iframe工作在ios上:

<allow-navigation href="*" />

#2


0  

If the problem comes from ios blocking external requests, add a configuration line on you .plist file like so:

如果问题来自ios阻止外部请求,请在.plist文件上添加配置行,如下所示:

<key>NSAppTransportSecurity</key>
<dict>
  <key>NSAllowsArbitraryLoads</key>
  <true/>
</dict>