Skip to content

Instantly share code, notes, and snippets.

View zst123's full-sized avatar

zst123 zst123

View GitHub Profile
@zst123
zst123 / bookmarklet.js
Last active August 29, 2015 14:03 — forked from BrettBukowski/bookmarklet.js
Update: Add Background, make label and input detect playback speed and set accordingly
javascript:!function(a){function g(a,b){for(var c in b)b.hasOwnProperty(c)&&(a.style[c]=b[c])}var b=a.querySelector("video"),c=a.createElement("input"),d=a.createElement("label"),e=a.createElement("div"),f;d.innerHTML='<span class="asdf">1x</span>',g(d,{color:"#EEE",fontSize:"11px",background:"#1b1b1b"}),c.type="range",c.max=4,c.min=.25,c.value=1,c.step=.05,g(c,{left:"4px",width:"90%",verticalAlign:"middle",webkitAppearance:"slider-horizontal",mozAppearance:"slider-horizontal"}),d.appendChild(c),g(e,{width:"50%",padding:"3px",position:"absolute",zIndex:1e3}),e.appendChild(d),(f=a.querySelector(".html5-player-chrome"))?(f.appendChild(e),g(e,{left:"30%"})):b.parentNode.insertBefore(e,b),d.querySelector(".asdf").innerHTML=b.playbackRate+"x",c.value=b.playbackRate,c.addEventListener("change",function(a){var c=a.target.value;b.playbackRate=c,d.querySelector(".asdf").innerHTML=c+"x"})}(document);
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
import android.util.AttributeSet;
import android.view.View;
import android.view.animation.AccelerateDecelerateInterpolator;