HTML5 speeding youtube 2x from url?

I would like to know how to speed up a YouTube video without a user clicking on HTML5 (video), but changing the URL instead.

For example, I know how to watch a video from a certain time by adding the &t=1m1s parameter to the URL (for 1 minute and one second). Can I use a similar method to speed up 2x video?

What parameters should be added to the URL to watch the video at double speed (I use html5)?

+28
html5 youtube send
Mar 24 '14 at 9:04
source share
5 answers

Cannot change the playback speed of the URLs.

In any case, if you work with HTML, you can use the iFrame API for the YouTube player.

Here's how to set up the player with all JavaScript: https://developers.google.com/youtube/iframe_api_reference#Getting_Started

And here is the function you are looking for to set the playback speed: https://developers.google.com/youtube/iframe_api_reference#Playback_rate

So you can edit your onPlayerReady function as follows:

 function onPlayerReady(event) { player.setPlaybackRate(2); // This is what you're looking for event.target.playVideo(); } 

Of course, you can go to step 5 of the documentation, as this will stop playing your video after six seconds.

If you have any problems with the configuration, I will edit the JSFiddle later (I could not do this at work, since my Flash plugin does not start).

Update:

Here JSFiddle works fine with this code: http://jsfiddle.net/jpreynat/e11oy0eu/

+36
Aug 13 '14 at 9:50
source share

I tried to do the same earlier this week.

Solving exclusively from a URL is not possible. (or, if so, this is not the documentation here: https://developers.google.com/youtube/player_parameters )

I came up with this JSFiddle Johan Preynat: http://jsfiddle.net/jpreynat/e11oy0eu/

Worked for me, so hopefully it will be useful for you.

HTML

 <!-- 1. The <iframe> (and video player) will replace this <div> tag. --> <div id="player"></div> 

Javascript

 // 2. This code loads the IFrame Player API code asynchronously. var tag = document.createElement('script'); tag.src = "https://www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); // 3. This function creates an <iframe> (and YouTube player) // after the API code downloads. var player; function onYouTubeIframeAPIReady() { player = new YT.Player('player', { height: '390', width: '640', videoId: 'M7lc1UVf-VE', events: { 'onReady': onPlayerReady } }); } // 4. The API will call this function when the video player is ready. function onPlayerReady(event) { player.setPlaybackRate(2); event.target.playVideo(); } 

See also the YouTube documentation on this subject: https://developers.google.com/youtube/iframe_api_reference

+2
Feb 26 '17 at 0:56
source share

Can you enter a shift> or & lt; from users input via URL or simpler JavaScript? It may be easier to get the hotkey pressed by the user.

+1
Sep 08 '19 at 17:08
source share

You can use this site, it also uses x4 https://www.kapwing.com

0
Apr 18 '19 at 2:58
source share

Speed โ€‹โ€‹can be controlled by assigning a value to a variable. Example

https://www.youtube.com/watch?v=zmcEbOqju90&speed=0.9

0
May 11 '19 at 7:50
source share



All Articles