Click here to Skip to main content
15,867,594 members
Articles / Web Development / HTML5
Tip/Trick

YouTube® playback customization options

Rate me:
Please Sign up or sign in to vote.
4.75/5 (21 votes)
14 Feb 2015CPOL1 min read 96.6K   26   19
Customize YouTube® video playback by adding web query parameters

Following examples demonstrate YouTube playback customization technique by adding web query parameters to the video URL (i.e. the links to YouTube video items).

Setting the video playback starting point

Setting the video playback starting point by specifying the offset-time in minutes and seconds from the beginning of video clip (in this example, it is set to 1min:50 sec, which will force the player to start the sample music-video "The Verve - Bitter Sweet Symphony" at specified time marker):
 
http://www.youtube.com/watch?v=1lyu1KKwC74&t=1m50s[^],
 
where parameter "NGRgHj9hsqw" represents the actual video item ID in YouTube classification system; this is the mandatory part of YouTube URL string. Parameter &t=1m50s specifies the video playback starting point. Alternatively, it could be coded in the following format: #t=1m50s

Full Screen Mode

Playback in a Full Screen mode: http://www.youtube.com/v/1lyu1KKwC74, where 1lyu1KKwC74 represents the aforementioned video id.

Autoplay

Playback Autoplay option in a full-screen mode is set to "OFF" by default. In order to turn it "ON", add the parameter "&autoplay=1" to the end of the URL web query.

Loop

Playback Loop (number of video re-plays) could be specified by adding the following parameter: “&loop=2” to the end of the query to play the video twice or “&loop=3” to replay it three times and so on.

Related Videos option On/Off

Turn “OFF” the "Related Video" option to filter-off "extras" from the video port by adding “&rel=0” to the end of the web query.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Engineer
United States United States
Dr. Alexander Bell (aka DrABell), a seasoned full-stack Software (Win/Web/Mobile) and Data Engineer holds PhD in Electrical and Computer Engineering, authored 37 inventions and published 100+ technical articles and developed multiple award-winning apps (App Innovation Contests AIC 2012/2013 submissions) Alexander is currently focused on Microsoft Azure Cloud and .NET 6/8 development projects.

  1. HTML5/CSS3 graphic enhancement: buttons, inputs
  2. HTML5 Tables Formatting: Alternate Rows, Color Gradients, Shadows
  3. Azure web app: Engineering Calculator VOLTMATTER
  4. Azure: NYC real-time bus tracking app
  5. Quiz Engine powered by Azure cloud
  6. 'enRoute': Real-time NY City Bus Tracking Web App
  7. Advanced CSS3 Styling of HTML5 SELECT Element
  8. Aggregate Product function extends SQL
  9. YouTube™ API for ASP.NET

Comments and Discussions

 
GeneralRe: To the member "brutuscat"- 1. I am giving you a second warni... Pin
DrABELL29-Mar-11 8:29
DrABELL29-Mar-11 8:29 
GeneralRe: To the member "brutuscat"- 1. You are wrong on your assumpti... Pin
DrABELL29-Mar-11 5:20
DrABELL29-Mar-11 5:20 
GeneralRe: The reason and the point are that you are not adding any val... Pin
brutuscat29-Mar-11 3:39
brutuscat29-Mar-11 3:39 
GeneralReason for my Vote of 5 Very good share and nice highlightin... Pin
RaviRanjanKr3-Nov-11 22:17
professionalRaviRanjanKr3-Nov-11 22:17 
GeneralReason for my vote of 5 This probably exists in some documen... Pin
JH6420-Jun-11 13:40
JH6420-Jun-11 13:40 
GeneralRe: Thanks a bunch! Pin
DrABELL20-Jun-11 15:00
DrABELL20-Jun-11 15:00 
GeneralReason for my vote of 5 Good tip! Very good share, I never k... Pin
Ed Nutting5-Jun-11 23:30
Ed Nutting5-Jun-11 23:30 
GeneralRe: Thanks a bunch, Ed! I am totally agree with you. And, btw, a... Pin
DrABELL6-Jun-11 5:23
DrABELL6-Jun-11 5:23 
GeneralReason for my vote of 1 There is a thing called Documentatio... Pin
brutuscat28-Mar-11 23:50
brutuscat28-Mar-11 23:50 
GeneralRe: What is the point of your message and the reason for such un... Pin
DrABELL29-Mar-11 3:25
DrABELL29-Mar-11 3:25 
Generalnice ,my 5+ Pin
Monjurul Habib5-Mar-11 7:27
professionalMonjurul Habib5-Mar-11 7:27 
GeneralRe: Thanks a lot! Pin
DrABELL8-Mar-11 17:18
DrABELL8-Mar-11 17:18 
GeneralReason for my vote of 5 nice,my5 Pin
Monjurul Habib5-Mar-11 7:26
professionalMonjurul Habib5-Mar-11 7:26 
GeneralReason for my vote of 5 Good one dude Pin
thatraja5-Mar-11 3:01
professionalthatraja5-Mar-11 3:01 
GeneralRe: Many thanks! :) Pin
DrABELL5-Mar-11 4:13
DrABELL5-Mar-11 4:13 
GeneralThanks! Pin
DrABELL21-Feb-11 17:01
DrABELL21-Feb-11 17:01 
GeneralThis is awesome! Pin
Edin Kalabić21-Feb-11 11:41
Edin Kalabić21-Feb-11 11:41 
General<i>More on this topic, covering the embedded YouTube player:... Pin
DrABELL3-Feb-11 6:23
DrABELL3-Feb-11 6:23 
More on this topic, covering the embedded YouTube player:
1. <a href="http://exm.nr/youTub">Rich internet applications, part 1: embedding YouTube? video player into web page</a>[<a href="http://exm.nr/youTub" target="_blank" title="New Window">^</a>]
2. <a href="http://bit.ly/YouTub">Working DEMO of embedded YouTube player with playlist</a>[<a href="http://bit.ly/YouTub" target="_blank" title="New Window">^</a>]
GeneralReason for my vote of 5 you really hacked it! By the way nic... Pin
GPUToaster™2-Feb-11 18:30
GPUToaster™2-Feb-11 18:30 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.