YouTube 360视频iframe无法在移动浏览器中使用 [英] YouTube 360 video iframe does not work in mobile browser
问题描述
我正在尝试在我的移动网站上播放用于YouTube 360视频的嵌入式iframe - 它可以在桌面浏览器上正常工作,但在移动浏览器中我只能播放平面立体视图。
我可以确认它绝对是一个HTML5播放器
I am trying to get an embedded iframe for a YouTube 360 video to play on my mobile site - it works fine on a desktop browser but in the mobile browser I just get the flat stereoscopic view playing back. I can confirm it is definitely a HTML5 player
这显然是其他人正在经历的一个未解决的问题。
请参阅以下帖子:
This is clearly an unresolved problem that others are experiencing. See below posts:
- https://productforums.google.com/forum/#!topic/youtube/7sk92Fs1juk
- Make Youtube 360 degree Videos work on mobile
所以我需要帮助解决这两个潜在问题/解决方案中的至少一个。
So I want help with at least one of these two potential questions / solutions.
1)是吗?可以在移动浏览器中使用它吗?谷歌的文档表明它应该
1) Is it possible to get this working in a mobile browser at all? Google's documentation suggests that it should
供参考 - 这是我的iframe代码
For reference - here is my iframe code
<iframe width="1360" height="500" src="https://www.youtube.com/embed/0x16ngo8xfY?autoplay=1&loop=1&playlist=0x16ngo8xfY" frameborder="0" allowfullscreen></iframe>
2)假设没有,强制我的iframe启动的最佳方式是什么? 360视频正常运行的YouTube移动应用
谢谢,
Alex
Thanks, Alex
推荐答案
由于缺乏其他回复,如果有其他人发现这一点,我在过渡期间采用了这种(不幸的)略显苛刻的解决方案,似乎有效。
Given lack of other responses and in case anyone else finds this, I resorted to this (unfortunately) slightly hacky solution in the interim which seems to work.
if(window.innerWidth < 760){
$('.video').on('click', function( e ) {
e.preventDefault();
//assumes that by forcing window to go to youtube will kick up option to open in app where experience works - plays my full showreel
window.location = "https://www.youtube.com/watch?v=0x16ngo8xfY&list=PLzSXIFcDqpiCiKXMtXtVIHnmor9uUsEhC&autoplay=1";
});
}
这篇关于YouTube 360视频iframe无法在移动浏览器中使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!