Blogger Atom/RSS 源中的 YouTube 视频

发布于 2024-08-16 11:43:52 字数 1626 浏览 8 评论 0原文

我正在尝试通过 Ruby on Rails 应用程序和 Safari 的提要阅读器查看我的博客帐户的提要。所有简单的 HTML(如段落和图像)都可以很好地解释,但嵌入 YouTube 视频不起作用。

例如,当我将其添加到博客中的帖子中时:

<p>Before</p>
<object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/9_tCtvmAm4M&hl=en_US&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/9_tCtvmAm4M&hl=en_US&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object>

这是使用 feed_tools gem 得出的:

<p>Before</p>
&lt;object width="560" height="340"&gt;&lt;param name="movie" value="http://www.youtube.com/v/9_tCtvmAm4M&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;rel=0"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/9_tCtvmAm4M&amp;amp;hl=en_US&amp;amp;fs=1&amp;amp;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"&gt;&lt;/embed&gt;&lt;/object&gt;

Safari 的提要阅读器简单地显示:

<p>Before</p>

... 这让我认为它无法解析作为 YouTube 视频接收的内容。

是否可以让 YouTube 视频在提要阅读器中正确显示?发生这种情况是因为嵌入式 Flash 不是正式有效的 HTML 吗?

I'm trying to view a feed from my blogger account both from a Ruby on Rails app, and Safari's feed reader. All of the simple HTML (like paragraphs and images) is interpreted just fine, but embedding a YouTube video isn't working.

For example, when I add this to my post inside of blogger:

<p>Before</p>
<object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/9_tCtvmAm4M&hl=en_US&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/9_tCtvmAm4M&hl=en_US&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object>

This comes out using the feed_tools gem:

<p>Before</p>
<object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/9_tCtvmAm4M&amp;hl=en_US&amp;fs=1&amp;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/9_tCtvmAm4M&amp;hl=en_US&amp;fs=1&amp;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object>

Safari's feed reader simply shows:

<p>Before</p>

... which makes me think that it can't parse what's being received as the youtube video.

Is it possible to get youtube videos to show up correctly in feed readers? Is this happening because the embedded flash isn't officially valid HTML?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

心舞飞扬 2024-08-23 11:43:52

嗯,这有点奇怪,与其他 Flash 内容一样吗?您是否尝试过 YouTube 嵌入视频的新方式: http://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html

Hmmm that's a bit weird, was it is like with other Flash content? Have you tried YouTube's new way of embedding videos: http://apiblog.youtube.com/2010/07/new-way-to-embed-youtube-videos.html

二智少女猫性小仙女 2024-08-23 11:43:52

在你的帖子中尝试一下:

<p>Before</p>
<iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube.com/embed/VIDEO_ID" frameborder="0">
</iframe>

Try this in your post:

<p>Before</p>
<iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube.com/embed/VIDEO_ID" frameborder="0">
</iframe>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文