We think you're near New York

Currently in New York

Location: New York Current temperature: 49°F: Current condition: Clear See Extended Forecast

How to customize YouTube® video playback

The article describes YouTube® playback customization technique, aimed to refine the video presentation by adding the parameters to web query string, which allows to:

  • Start video playback at specific position (set offset in minutes and second)
  • Specify the number of video re-plays (Loop)
  • Start the video playback in Full Screen Mode
  • Turn “Related Video” options ON/OFF
  • Set the Autoplay option
  • Set the Playback Video Quality

The anatomy of YouTube URL: a bit of theory

Examples in this article are included to demonstrate the customization techniques, applied to the sample YouTube video, recorded by the author at New York International Auto Show 2010 [1] at Javitz Center® [2]. The link (in other words, URL, which stands for Universal Resources Locator) to the corresponding YouTube video item http://www.youtube.com/watch?v=NGRgHj9hsqw is a text string containing two sub-strings: the first, constant part to the left of the question mark (“?”), which is specific to the YouTube domain, and  the second, variable one to the right of question mark called “web query string” containing the sequence of “key-value” pairs (in other words, web query parameters). In this particular example web query string contains just a single mandatory parameter: “v=NGRgHj9hsqw”, where “NGRgHj9hsqw” represents the video item id, pertinent to the YouTube indexing system. The YouTube playback customization described below is achieved by just adding more “parameter-value pairs” to the end of such web query string, concatenated with the ampersand symbol “&”. The left part of URL stays the same in all following examples except for the special case of playing back the video in a Full Screen mode.

Advertisement

The modified URL, which includes extended web query string with the additional “key-value” pairs, could be “copy-pasted” into the Web Browser’s address bar, and also “twitted” (on Twitter®) or included in any online comments/posts. This modified URL string could be shortened with any popular services (e.g., Bit.ly [4]); the shortening of the YouTube URL will preserve its playback customization features.

Start Video playback at specific position

Setting the YouTube video starting position, specified by minutes and seconds, is useful option available through the web query string. Following example shows the modified URL [1] with additional web query parameter: “&t=1m10s” (could be also written as “#t=1m10s”), which instructs the video player to skip the initial part of the clip and start the playback at exact position corresponding to 1 minute 10 second of playtime: http://www.youtube.com/watch?v=NGRgHj9hsqw&t=1m10s  If the desirable “offset” is less than a minute (for example, 10 sec) then just omit the corresponding “minute” part of the string: it should look “#t=10s” for a 10 sec skip-time.

You could perform the quick of test of this modified URL functionality in any Web Browser; the video playback shall start at 1min 10sec time mark, corresponding to the section, showing German Car manufacturers at New York Auto Show 2010 [1]. As mentioned above, the modified URL string could be shortened with Bit.ly service: the resulting short version http://bit.ly/CarGer provides the same functionality as the original one.

Playback Loop

Setting the playback Loop mode (number of replays) is another option, accessible via YouTube web query string customization. To implement this option just add the string “&loop=2” to the end of the query to play the video twice or “&loop=3” to replay it three times and so on.

Full Screen mode

To play the YouTube video sample [1] in a full screen mode, modify the URL as follows: http://www.youtube.com/v/NGRgHj9hsqw, where the sub-string “NGRgHj9hsqw” corresponds to the item id.

Turning the "Related Video" options ON/OFF

Turning “OFF” this option will clean-up the video port from any extras. In many cases this option is set to “On” by default; just add the string “&rel=0” to the end of the web query to turn it "Off"

Setting the Autoplay option

Setting the autoplay option  is as simple as adding the parameter "&autoplay=1" to the web query string.

Setting the Video Quality

Several options are available regarding the playback video quality, which could be specified by adding one of the following “&fmt” parameters :

  • &fmt=37 for the highest video resolution/ highest audio quality, corresponding to HD 1080: 1920x1080/Stereo 44kHz, MP4
  • &fmt=22 for very high video resolution/ highest audio quality, corresponding to HD 720 (1280x720/Stereo 44kHz, MP4)
  • &fmt=35 for high video resolution/ highest audio quality: 640x480/Stereo 44kHz, MP4
  • &fmt=18 for medium video resolution/highest audio quality: 480x360/Stereo 44kHz, FLV
  • &fmt=34 for low video resolution/medium audio quality: 320x240/Stereo 22kHz, FLV
  • &fmt=6 for low video resolution/medium audio quality: 320x240/Mono 44kHz, FLV
  • &fmt=5 for low video resolution/medium audio quality: 320x240/Mono 22kHz, FLV
  • &fmt=17 for low video resolution/medium audio quality: 176x144/Mono 22kHz, 3GP

There are several other options of the less practical interest, thus not discussed in the article, but available online at [3].

Summary

YouTube video playback customization technique, described above is compatible with all major web browsers:

  • Internet Explorer 6+
  • Mozilla Firefox
  • Google Chrome
  • Apple Safari

The modified video item URL string could contain the extended web query string with multiple parameters, which could appear in any order. This modified URL could be shortened by Bit.ly or similar web services; the functionality of the resulting short URL will be preserved.

For the comprehensive coverage of embedding YouTube media items into the web page refer to the article [5].

References

  1. New York International Auto Show 2010: European Cars
  2. Jacob K. Javitz Convention Center, New York
  3. 10 Youtube URL Tricks You Should Know About
  4. Bit Ly
  5. Rich internet applications: embedding YouTube™ video player into web page

Disclaimer: this content is provided on "AS IS" basis without warranty of any kind.

Copyright© 2011 Alexander Bell

By

NY Online Learning Examiner

Dr. Alexander Bell, American Scientist, Engineer, Inventor and the fellow New Yorker is working as a Hi-Tech consultant for more than 15 years....

Comments

Add a new comment

Join the conversation! Log in here or create a new account if you've never registered before.

Got something to say?

Examiner.com is looking for writers, photographers, and videographers to join the fastest growing group of local insiders. If you are interested in growing your online rep apply to be an Examiner today!

Don't miss...