AmazonVideo Speed

Saves the set playback speed on Netflix

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         AmazonVideo Speed
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Saves the set playback speed on Netflix
// @author       Bobocato
// @match        https://www.amazon.de/*
// @match        https://www.amazon.com/*
// @match        https://www.amazon.co.uk/*
// @grant        none
// ==/UserScript==

function setEvents(video){
    //Safe Playback Rate
    video.onratechange = function() {
        var speedup = video.playbackRate - localStorage.getItem("playrate");
        if((Math.round(speedup *10)/10) == 0.1 ||(Math.round(speedup *10)/10) == -0.1 ){
            localStorage.setItem("playrate", video.playbackRate);
        }
    };

    //Set volume and playbackrate as soon as video starts playing
    video.onplaying = function() {
        if (localStorage.getItem("playrate") !== null){
            video.playbackRate = localStorage.getItem("playrate");
        }
    };
}

function setSettings(video){
    if (localStorage.getItem("playrate") !== null){
        video.playbackRate = localStorage.getItem("playrate");
    }
}

(function() {
    'use strict';
    setInterval(function(){
        var video = document.getElementsByTagName("video");
        for(var i = 0; i < video.length; i++){
            if(typeof(video[i]) != "undefined"){
                setEvents(video[i]);
                setSettings(video[i]);
            }
        }
    }, 2500);
})();