zarjay / YouTube Utils

Published:

Version: 1.1.0+e6b5d3d updated

Summary: Library of Youtube-specific functions runnable from the browser console. The functions only work if the YouTube video is rendered in HTML5, not Flash.

License: MIT; https://github.com/zarjay/userscripts/blob/master/LICENSE

YouTube Utils

Run these functions in your browser console.

API

u.include(url)

Includes a CSS or JS file onto the page.

Returns a promise that resolves when the CSS/JS file has finished loading.

u.include('//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js').then(function() {
  // do something with $ or jQuery
});

u.flip(axis)

Flips the video about an axis.

Defaults to the y-axis if one isn't specified.

u.pause() / u.stop()

Pauses the video.

u.play() / u.go()

Plays the video.

u.loop

Getter/setter for the video's loop property.

Set to true to make the video loop.

u.speed

Getter/setter for the video's playbackRate property.

u.speed = 3; // Speed up the video by 3x

u.video

Reference to the <video> element. See HTMLVideoElement, HTMLMediaElement, HTMLElement, and Element for available methods and properties.

Rating: 0