YouTube Videos in Blogger Atom/RSS feeds
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>开发者_如何学C<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?
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
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>
精彩评论