Youtube嵌入视频不能在小米设备Cordova WebView中播放

时间:2018-06-14 13:10:15

标签: android cordova youtube

我在一个cordova应用程序中有一个奇怪的行为,其中一个页面包含来自youtube的视频:

<iframe width="100%" height="360" src="https://www.youtube.com/embed/bTqVqk7FSmY?feature=player_embedded&showinfo=0&rel=0" allow="accelerometer; gyroscope; magnetometer; autoplay; encrypted-media" frameborder="0" allowfullscreen></iframe>

适用于ios&amp; Android模拟器,但在我的设备上失败:小米MiA1。

我在三星设备上测试过,它也可以。

这是我的config.xml用于测试:

<access origin="*" />
<allow-intent href="*" />
<allow-navigation href="*" />

的index.html:

<meta http-equiv="Content-Security-Policy" content="
                        default-src * data: blob: ws: wss: gap://ready file://*;
                        style-src * 'unsafe-inline';
                        script-src * 'unsafe-inline' 'unsafe-eval';
                        connect-src * ws: wss:;">

当我尝试播放时出现此错误:

Uncaught TypeError: Cannot read property 'hide' of null
at E_.J (https://www.youtube.com/yts/jsbin/player-vflT6zTz3/fr_FR/base.js:7383:299)
at new E_ (https://www.youtube.com/yts/jsbin/player-vflT6zTz3/fr_FR/base.js:4105:292)
at new M_ (https://www.youtube.com/yts/jsbin/player-vflT6zTz3/fr_FR/base.js:4142:493)
at g.O_.init (https://www.youtube.com/yts/jsbin/player-vflT6zTz3/fr_FR/base.js:7424:39)
at lY.g.h.fy (https://www.youtube.com/yts/jsbin/player-vflT6zTz3/fr_FR/base.js:7013:69)
at new g0 (https://www.youtube.com/yts/jsbin/player-vflT6zTz3/fr_FR/base.js:4217:223)
at https://www.youtube.com/yts/jsbin/player-vflT6zTz3/fr_FR/base.js:7566:161
at Jh.Mh.a.w (https://www.youtube.com/yts/jsbin/www-embed-player-vflo0Y8an/www-embed-player.js:502:261)
at Mh (https://www.youtube.com/yts/jsbin/www-embed-player-vflo0Y8an/www-embed-player.js:503:12)
at Jh.k.ga (https://www.youtube.com/yts/jsbin/www-embed-player-vflo0Y8an/www-embed-player.js:498:4)

Uncaught TypeError: Cannot read property 'l' of undefined
at M_.g.h.Sn (VM41 base.js:7415)
at sra (VM41 base.js:3874)
at M_.g.h.nT (VM41 base.js:7122)

0 个答案:

没有答案