SAUK Discussion Board

Go Back   SAUK Discussion Board > Board Management > The Garage
Join! Blogs FAQ Calendar Today's Posts Search

Notices

Reply  Post New Thread
 
Thread Tools
  #1  
Old 18th July 2013, 18:22
Duke of Prunes Duke of Prunes is offline
Member
 
Join Date: Jan 2011
Location: SE London
Posts: 2,869

Mood
Bored

Default YouTube embeds (request to admins)

Would it be possible to change the YouTube embedding code so that it uses the iframe player rather than the old Flash-only one? The iframe version can use HTML5 video tags if the browser supports it (which is awesomeness for battery life on laptops, as Flash sucks up loads of CPU), and has far more options.

The src of the iframe would be something like:
Code:
http://www.youtube.com/embed/{INSERT-VIDEO-ID-HERE-LOL}?theme=light&modestbranding=1&fs=0&enablejsapi=0&disablekb=1&autoplay=0&version=3&origin=http://social-anxiety-community.org
That would disable autoplay/fullscreen/keyboard control, use the light theme for controls (the dark one looks ugly with the theme on here), and hide the YouTube branding (for neatness).

You will need to sanitise video ids by ignoring video IDs that aren't 11 characters and that don't match a regexp like \w\- (alphanumerics, underscores and hyphens) for safety – not sure if vBulletin can filter BBcode parameters that way, but I'd be surprised if it can't.

Shouldn't change the user experience for 90% of users, but it means that embeds will work on systems without Flash (e.g. on certain mobile devices, or for people who don't want to install it), so it's worth a try if you've got the time to do it.
Reply With Quote
  #2  
Old 18th July 2013, 18:49
[Martin] [Martin] is offline
Global Moderator
 
Join Date: Jun 2013
Location: Passed out on Grav's sofa..
Posts: 1,915
Default Re: YouTube embeds (request to admins)

^^ neat idea. I often browse this site without flash and html5 embedded vids would be great!
Reply With Quote
  #3  
Old 18th July 2013, 19:27
daveysurfy daveysurfy is offline
Member
 
Join Date: Jun 2012
Location: UK
Posts: 1,300
Default Re: YouTube embeds (request to admins)

Would this allow the videos to appear at full resolution, the current method means they appear in a tiny window.
Reply With Quote
  #4  
Old 18th July 2013, 20:12
Duke of Prunes Duke of Prunes is offline
Member
 
Join Date: Jan 2011
Location: SE London
Posts: 2,869

Mood
Bored

Default Re: YouTube embeds (request to admins)

Quote:
Originally Posted by daveysurfy
Would this allow the videos to appear at full resolution, the current method means they appear in a tiny window.
That just depends on the height/width of the element – it can be changed it for either type of player.

In this case, the main advantage of using the iframe would be HTML5.

There's other neat things you can do with it as well (you get proper interaction between the player and the site, so you can control the player from elsewhere on the page and use the events from the player to control your own scripts, e.g. dim the rest of the page when the player is running, getting the info of the video to use outside of the player), but they're not really relevant to forum embeds.

It's basically a direct upgrade/drop-in replacement, anyway.
Reply With Quote
  #5  
Old 18th July 2013, 20:32
Azi Azi is offline
Moderator
 
Join Date: Sep 2007
Posts: 19,979
Default Re: YouTube embeds (request to admins)

Cheers for this DoP.
Reply With Quote
Reply


Forum Jump


All times are GMT +1. The time now is 02:40.


SAUK Award
Logo designed by abc
Powered by vBulletin
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.