Results 1 to 2 of 2

Thread: Simple YouTube slowdowner (bookmarklet)

  1. #1
    Registered User Niavlys's Avatar
    Join Date
    Jan 2013
    Location
    Montpellier, France
    Posts
    60

    Default Simple YouTube slowdowner (bookmarklet)

    Hi everyone,

    Thanks to the slowdowner on Free Bluegrass Backing Tracks (fbbts.com), I recently found out about the playbackRate attribute of the video and audio HTML5 elements.

    So... I was able to make this little Javascript bookmarklet that lets you slowdown a YouTube video. You just have to create a bookmark with the entire following code in the "Address" field (or is it "URL"? My browser is in french), and then click this bookmark when you're on a video page.

    Note that it will only work if the HTML5 video player is enabled (go to http://youtube.com/html5 if it's not) and used in the page.
    I'm aware of the similar feature already existing in YouTube, but the difference here is that you can slowdown more gradually (not limited to 0.25 and 0.5), and it's also more easily accessible.
    Code:
    javascript:(function(){
    var sb_player=document.querySelector(".html5-main-video");
    var sb_sliderOld=document.getElementById("sb_slider");
    if(sb_player!=null){
    if(sb_sliderOld!=null){
    sb_sliderOld.parentNode.removeChild(sb_sliderOld);
    sb_player.playbackRate=1;
    }
    var sb_slider=document.createElement("input");
    sb_slider.id="sb_slider";
    sb_slider.setAttribute("style","position:absolute;bottom:0;left:50%;width:3.5em;z-index:999");
    sb_slider.setAttribute("type","number");
    if(document.getElementById("movie_player"))document.getElementById("movie_player").appendChild(sb_slider);
    else document.body.appendChild(sb_slider);
    sb_slider.setAttribute("value","1");
    sb_slider.setAttribute("step","0.05");
    sb_slider.setAttribute("min","0");
    var sb_majPlaybackRate=function(){if(this.value>0)sb_player.playbackRate=this.value;};
    sb_slider.onchange=sb_majPlaybackRate;
    }})();
    It's a simple script that I thought I should share somewhere around here.
    I'll be glad to get any feedback about this.

    Sylvain

  2. The Following 3 Users Say Thank You to Niavlys For This Useful Post:


  3. #2
    Registered User
    Join Date
    Jun 2013
    Location
    Kernersville, NC
    Posts
    2,593
    Blog Entries
    3

    Default Re: Simple YouTube slowdowner (bookmarklet)

    Hi Sylvain - thanks for the backing tracks site link!

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •