什么会导致这个 youtube 嵌入字符串停止工作? [英] What would cause this youtube embed string to stop working?

查看:28
本文介绍了什么会导致这个 youtube 嵌入字符串停止工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将 youtube 链接保存在数据存储中,以便根据主题分批查看.我基本上是用标题注释和长度数据保存 videoid.

I save youtube links in a datastore for viewing in batches according to topic. I basically save the videoid with a caption note and the length data.

我使用 php 构建了一个自定义查看器.我已经按照我想要的方式使用它至少 10 个月了.在此期间,格式发生了重大变化,我能够适应这种变化.

I used php to construct a custom viewer. I've been using it for at least 10 months exactly the way I want. One breaking change to the format happened during this time and I was able to adjust to that change.

现在,今天似乎发生了另一个重大变化,我很想知道这是我的代码还是 youtube 的嵌入语法.

Now, today, it looks like another breaking change has happened and I'm curious to see if it's my code or if it's youtube's embed syntax.

以下是来自 Veritasium 频道的 YouTube 视频 ID 列表:

So here's a list of youtube video id's from the Veritasium channel:

2KZb2_vcNTg,Ux33-5k8cjg,vqDbMEdLiCs,myh94hpFmJY,Iuv6hY6zsd0,vWVZ6APXM4w,BD6h-wDj7bw,1Xp_imnO6WE,38gVZgE39K8,XAgXwUwQoPA,rAYW9n8i-C4

我用这个基线语法动态构建了一个 iframe:

I dynamically construct an iframe with this baseline syntax:

<iframe id="myiframe" class="myplaylist" width="720" height="405" src="https://www.youtube.com/embed/videoseries?playlist= <comma separated list of video id's> &amp;controls=1?enablejsapi=1" frameborder="0" allowfullscreen=""></iframe>

因此,由这两部分创建的功能性 iframe 元素如下所示:

So a functional iframe element created from these two pieces looks this:

<iframe id="myiframe" class="myplaylist" width="720" height="405" src="https://www.youtube.com/embed/videoseries?playlist=2KZb2_vcNTg,Ux33-5k8cjg,vqDbMEdLiCs,myh94hpFmJY,Iuv6hY6zsd0,vWVZ6APXM4w,BD6h-wDj7bw,1Xp_imnO6WE,38gVZgE39K8,XAgXwUwQoPA,rAYW9n8i-C4&amp;controls=1?enablejsapi=1" frameborder="0" allowfullscreen=""></iframe>

这不能作为片段使用,但作为 html 元素,它应该显示一个 youtube 播放器,并在右上角显示一个计数器和排队视频的下拉列表,就像您正在查看播放列表一样youtube 网站.

This won't work as a snippet, but as an html element, it should show a youtube player, and in the upper right show a counter and drop down list of the queued videos as though you were looking at a playlist on the youtube site.

例如(除了这个是演示新问题):

For example (Except this one is demonstrating the new problem):

如果有人尝试使用这个完整的标签,看看嵌入的播放器是否能正常工作,这会有所帮助.我不知道出了什么问题.

It would help if someone would try this completed tag, and see if the embedded player functions. I can't tell what's gone wrong.

推荐答案

我认为是 YouTube.我不知道这是有意为之还是错误,但在 YouTube 结束时肯定发生了一些变化.

I think it's YouTube. I don't know whether it is intended or a bug, but something certainly changed on YouTube's end.

如果您复制视频的网址,则它是 https://youtu.be/videoseries - YouTube 不再将 /videoseries 识别为特殊网址,而只是尝试像播放列表前面的视频片段一样加载它.

If you copy the URL of the video it is https://youtu.be/videoseries - YouTube no longer recognizes /videoseries as a special URL and simply tries loading it as if it were a video slug at the front of the playlist.

看起来一个潜在的解决方法是简单地从嵌入 URL 中删除 videoseries,如下所示:

It looks like a potential workaround is simply removing videoseries from the embed URL, like this:

<iframe id="myiframe" class="myplaylist" width="720" height="405" src="https://www.youtube.com/embed/?playlist=2KZb2_vcNTg,Ux33-5k8cjg,vqDbMEdLiCs,myh94hpFmJY,Iuv6hY6zsd0,vWVZ6APXM4w,BD6h-wDj7bw,1Xp_imnO6WE,38gVZgE39K8,XAgXwUwQoPA,rAYW9n8i-C4&amp;controls=1?enablejsapi=1" frameborder="0" allowfullscreen=""></iframe>

这篇关于什么会导致这个 youtube 嵌入字符串停止工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆