Jump to content
Sign in to follow this  
fabio

[FIXED] YouTube embedding in 0 A.D. forum

Recommended Posts

I want to report a problem I notice with YouTube video embedded in the forum (using latest Firefox here). It seems that the forum always force the video to be played with Flash, even if I choose to use YouTube HTML5 when available.

Just as an example see this post with embedded video. It plays with Flash on the forum, but when clicking to see it on YouTube the video is also available in HTML5/Webm. I have this problem only on 0 A.D. forum, see for example the video embedded in sauerbraten web page, it's correctly displayed in HTML5 mode.

A possibly related problem is that when using my slow netbook video embedded in the forum make the page hugely slow. When the video is displayed in Flash mode in YouTube is pretty fast, so I suppose it's the forum it's embedding YouTube videos, possibly related to the forced resizing applied to the video:

<object style="height: 390px; width: 640px">

Edited by fabio

Share this post


Link to post
Share on other sites

For reference here is the code used by our forum

<object style="[url=""]height: 390px; width: 640px[/url]"><param name="[url=""]movie[/url]" value="[url=""]http://youtube.com/v/gDndZn0YPdI?version=3[/url]"><param name="[url=""]allowFullScreen[/url]" value="[url=""]true[/url]"><param name="[url=""]allowScriptAccess[/url]" value="[url=""]always[/url]"><embed src="[url="view-source:http://youtube.com/v/gDndZn0YPdI?version=3"]http://youtube.com/v/gDndZn0YPdI?version=3[/url]" type="[url=""]application/x-shockwave-flash[/url]" allowfullscreen="[url=""]true[/url]" allowscriptaccess="[url=""]always[/url]" height="[url=""]360[/url]" width="[url=""]640[/url]"></object>

and the sauerbraten website

<iframe src="[url="view-source:http://www.youtube.com/embed/EsTkLZhMI0I?rel=0"]http://www.youtube.com/embed/EsTkLZhMI0I?rel=0[/url]" allowfullscreen="" frameborder="[url=""]0[/url]" height="[url=""]320[/url]" width="[url=""]400[/url]"></iframe>

So it is a simple formatting issue, though I don't know how easy it would be to change without causing hassle every time we upgrade.

Share this post


Link to post
Share on other sites

The forum changed the link you posted. Here are the fixed code.

This is what happens on sauerbraten:

<iframe width="400" height="320" src="http://www.youtube.com/embed/EsTkLZhMI0I?rel=0" frameborder="0" allowfullscreen></iframe>

This is current 0 A.D.:

<object style="movie" value="allowFullScreen" value="allowScriptAccess" value="http://youtube.com/v/gDndZn0YPdI?version=3" type="true" allowScriptAccess="640" height="360"></embed></object>

This is what YouTube suggests when clicking on the previous video to watch on YouTube, right click and "copy HTML...":

<iframe width="640" height="390" src="http://www.youtube.com/embed/gDndZn0YPdI" frameborder="0" allowfullscreen></iframe>

This one looks like the sauerbraten, other than the missing ?rel=0. Can this last one be used rather than the current one, since it is what YouTube suggest?

Share this post


Link to post
Share on other sites

The <object> approach was YouTube's older video embed syntax. The <iframe> is YouTube's newer one. If we're using <object> it's because they didn't use <iframe> at the time this forum was set up.

A quick glance looks like the code that parses the youtube urls/media tags here on this forum is contained within admin/sources/classes/bbcode/custom/defaults.php. In theory it's possible to make changes, but I'd recommend not doing it because it'll complicate upgrading the forum.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...