Click here to Skip to main content
11,490,801 members (74,757 online)
Click here to Skip to main content

YouTube® playback customization options

, 14 Feb 2015 CPOL 62.2K 26
Rate this:
Please Sign up or sign in to vote.
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:10 sec, which will force the player to start the sample car video at "German Cars" fragment):
 
http://www.youtube.com/watch?v=NGRgHj9hsqw&t=1m10s[^],
 
where parameter "NGRgHj9hsqw" represents the actual video item ID in YouTube classification system; this is the mandatory part of YouTube URL string. Parameter &t=1m10s specifies the video playback starting point. Alternatively, it could be coded in the following format: #t=1m10s

Shortening video URL

Entire URL with added web query could be shortened by using, for example, Bit.ly service and look like: http://bit.ly/CarGer[^]); all customization options will be preserved in the short URL.

Full Screen Mode

Playback in a Full Screen mode: http://www.youtube.com/v/NGRgHj9hsqw[^], where NGRgHj9hsqw represents the 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.

 

Embedded YouTube Player (click on image to open DEMO)

Sample screen shot of embedded YouTube Player

License

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

Share

About the Author

DrABELL
President Infosoft International Inc
United States United States
Dr. A. Bell has 20+ years of Software and Electrical Engineering experience: Win/Web veteran, published 300+ articles and authored 37 inventions, credited for 10+ Enterprise level projects (>250k code lines); currently focused on .NET/WPF, C#, HTML5, jQuery, SQL, 'Big Data', AI, Speech Tech and Mobile apps. He participated in App Innovation Contest (AIC 2102/2013) with several winning submissions. Sample projects/pubs follow:
  1. Edumatter M12: School Math Calculators and Equation Solvers (contest winner)
  2. Engineering Calculator VOLTA-2013 (contest winner)
  3. WebTV Project: Embedded YouTube Player (Goog #1 YouTube API for ASP.NET)
  4. Online 3 Fractions Calculator (#1 on Goog)
  5. Top-100 Digital Cameras (powered by iMark-DCAM rating engine)
  6. Engineering Calculator VOLTA-814 for Windows
  7. Pericles™ TTS-14 Text-to-Speech Synthesizer (Win)
  8. Semaphon™ SP-300 semantic phone number converter (Win)
  9. PaydayNY-2015 Payroll Tax Calculator (Win)
  10. 'Find Job Agency' Online Interactive Map (Microsoft Bing technology)
Follow on   Twitter

Comments and Discussions

 
GeneralRe: To the member "brutuscat"- 1. I am giving you a second warni... Pin
DrABELL29-Mar-11 9:29
memberDrABELL29-Mar-11 9:29 
GeneralRe: To the member "brutuscat"- 1. You are wrong on your assumpti... Pin
DrABELL29-Mar-11 6:20
memberDrABELL29-Mar-11 6:20 
GeneralRe: The reason and the point are that you are not adding any val... Pin
brutuscat29-Mar-11 4:39
memberbrutuscat29-Mar-11 4:39 
GeneralReason for my Vote of 5 Very good share and nice highlightin... Pin
RaviRanjankr3-Nov-11 23:17
mvpRaviRanjankr3-Nov-11 23:17 
GeneralReason for my vote of 5 This probably exists in some documen... Pin
JH6420-Jun-11 14:40
memberJH6420-Jun-11 14:40 
GeneralRe: Thanks a bunch! Pin
DrABELL20-Jun-11 16:00
memberDrABELL20-Jun-11 16:00 
GeneralReason for my vote of 5 Good tip! Very good share, I never k... Pin
EdMan1966-Jun-11 0:30
memberEdMan1966-Jun-11 0:30 
GeneralRe: Thanks a bunch, Ed! I am totally agree with you. And, btw, a... Pin
DrABELL6-Jun-11 6:23
memberDrABELL6-Jun-11 6:23 
GeneralReason for my vote of 1 There is a thing called Documentatio... Pin
brutuscat29-Mar-11 0:50
memberbrutuscat29-Mar-11 0:50 
GeneralRe: What is the point of your message and the reason for such un... Pin
DrABELL29-Mar-11 4:25
memberDrABELL29-Mar-11 4:25 
Generalnice ,my 5+ Pin
Monjurul Habib5-Mar-11 8:27
memberMonjurul Habib5-Mar-11 8:27 
GeneralRe: Thanks a lot! Pin
DrABELL8-Mar-11 18:18
memberDrABELL8-Mar-11 18:18 
GeneralReason for my vote of 5 nice,my5 Pin
Monjurul Habib5-Mar-11 8:26
memberMonjurul Habib5-Mar-11 8:26 
GeneralReason for my vote of 5 Good one dude Pin
thatraja5-Mar-11 4:01
mvpthatraja5-Mar-11 4:01 
GeneralRe: Many thanks! :) Pin
DrABELL5-Mar-11 5:13
memberDrABELL5-Mar-11 5:13 
GeneralThanks! Pin
DrABELL21-Feb-11 18:01
memberDrABELL21-Feb-11 18:01 
GeneralThis is awesome! Pin
LopeZ10121-Feb-11 12:41
memberLopeZ10121-Feb-11 12:41 
General<i>More on this topic, covering the embedded YouTube player:... Pin
DrABELL3-Feb-11 7:23
memberDrABELL3-Feb-11 7:23 
GeneralReason for my vote of 5 you really hacked it! By the way nic... Pin
GPUToaster2-Feb-11 19:30
memberGPUToaster2-Feb-11 19:30 

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

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

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150520.1 | Last Updated 14 Feb 2015
Article Copyright 2011 by DrABELL
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid