2Posit

Watch playposit videos at 1.5x, 2x, or 10x speed!

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         2Posit
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Watch playposit videos at 1.5x, 2x, or 10x speed!
// @author       reesericci
// @match        https://api.playposit.com/player_v2/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=playposit.com
// @grant        none
// @license      GPL-v3.0-or-later
// ==/UserScript==



function waitForElm(selector) {
    return new Promise(resolve => {
        if (document.querySelector(selector)) {
            return resolve(document.querySelector(selector));
        }

        const observer = new MutationObserver(mutations => {
            if (document.querySelector(selector)) {
                resolve(document.querySelector(selector));
                observer.disconnect();
            }
        });

        observer.observe(document.body, {
            childList: true,
            subtree: true
        });
    });
}


(async function() {
    'use strict';

    await waitForElm("#playback-speed-select-all");

    let oneFiveOption = document.createElement("option")
    oneFiveOption.value = 1.5;
    oneFiveOption.text = "1.5x Speed"

    let twoOption = document.createElement("option")
    twoOption.value = 2;
    twoOption.text = "2x Speed"

    let tenOption = document.createElement("option")
    tenOption.value = 10;
    tenOption.text = "10x Speed"

    document.getElementById("playback-speed-select-all").add(oneFiveOption)
    document.getElementById("playback-speed-select-all").add(twoOption)
    document.getElementById("playback-speed-select-all").add(tenOption)
})();