为什么使用“youtube.com/v"的 YouTube 视频无法加载 [英] Why are YouTube videos using 'youtube.com/v' not loading
问题描述
请查看此页面.
在移动设备上查看页面时会播放嵌入的视频,但在计算机上查看时不会播放(在运行 Windows 8 和 10 的两台笔记本电脑上,在 Chrome、FF 和 Edge 上进行了测试).
此问题仅存在于 YouTube 视频中,并且问题始于 48 小时前(大约)
例如,查看此 YouTube URL(未加载视频):
我通过重写 emvideo 模块设法解决了这个问题.
我目前使用的模块版本 = "6.x-1.26".
我没有花时间更改整个模块;
我只更改了我需要的部分:
所有更改均在此文件中进行:\sites\all\modules\emfield\contrib\emvideo\providers\youtube.inc
在
function theme_emvideo_youtube_flash
第 444 行中,我更改了该行$url = check_plain("http://www.youtube.com/v/$code&$related$autoplay_value$colors$border$high_quality$display_info$enablejsapi$fs");
到
$url = check_plain("https://www.youtube.com/embed/$code");
.
我所做的是查看 youtube 嵌入代码并尝试使链接看起来相同.
- 下一步是更改 FLASH 输出,在第 566 行函数中
theme_emvideo_youtube_default_external
并更改下一个内容:
<代码>
到
<div id="$url"><iframe width="$width" height="$width" src="$url" frameborder="0" allowfullscreen></iframe>
仅此而已……
希望它有点帮助......
Please review this page.
The embedded video plays when the page is viewed on a mobile device but not when viewed on a computer (tested on two laptops running Windows 8 and 10, on Chrome, FF, and Edge).
This issue only exists with YouTube videos and the problem began 48 hours ago (approx.)
For example, see this YouTube URL (no video is being loaded):
I have managed to handle this problem by rewriting the emvideo module.
I am currently using the module version = "6.x-1.26".
I didn’t take the time to change the entire module;
I changed only the parts I needed:
All the changes were made in this file: \sites\all\modules\emfield\contrib\emvideo\providers\youtube.inc
In
function theme_emvideo_youtube_flash
line 444 I changed the line$url = check_plain("http://www.youtube.com/v/$code&$related$autoplay_value$colors$border$high_quality$display_info$enablejsapi$fs");
to
$url = check_plain("https://www.youtube.com/embed/$code");
.
What I did was to look at the youtube embed code and try to make the link look the same.
- Next step was to change the FLASH output, in line 566 function
theme_emvideo_youtube_default_external
and change the next content:
<div id="$div_id">
<object type="application/x-shockwave-flash" height="$height" width="$width" data="$url" id="$id">
<param name="movie" value="$url" />
<param name="allowScriptAccess" value="sameDomain"/>
<param name="quality" value="best"/>
<param name="allowFullScreen" value="$fullscreen_value"/>
<param name="bgcolor" value="#FFFFFF"/>
<param name="scale" value="noScale"/>
<param name="salign" value="TL"/>
<param name="FlashVars" value="$flashvars" />
<param name="wmode" value="transparent" />
</object>
</div>
To
<div id="$url"><iframe width="$width" height="$width" src="$url" frameborder="0" allowfullscreen></iframe></div>
And that’s all…
Hope it helps a bit…
这篇关于为什么使用“youtube.com/v"的 YouTube 视频无法加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!