Kemono/Coomer-VideoPlayer

take a video player under the link

Verze ze dne 09. 01. 2024. Zobrazit nejnovější verzi.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Kemono/Coomer-VideoPlayer
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  take a video player under the link
// @author       You
// @match        https://coomer.party/*
// @match        https://kemono.party/*
// @match        https://coomer.su/*
// @match        https://kemono.su/*
// @icon         data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant        GM_addStyle
// @grant        GM_getResourceText
// @resource     css https://vjs.zencdn.net/7.10.2/video-js.min.css
// @require      https://cdnjs.cloudflare.com/ajax/libs/video.js/7.1.0/video.js
// @license      MIT
// ==/UserScript==

function kemonoVideoPlayer() {
    var video_links = document.getElementsByClassName("post__attachment-link");
    for (var i in video_links) {
        if(i == "length") break;
        var linksrc = video_links[i].getAttribute("href");
        if (linksrc.search("\.mp4|\.m4v") == -1) break;
        var player = document.createElement("video");
        player.controls = true;
        player.preload = "auto";
        player.className = "video-js vjs-default-skin";

        player.style.width = "100%";
        player.height = 800;
        player.setAttribute("data-setup", "{}");

        var src = document.createElement("source");
        src.type = "video/mp4";
        src.src = linksrc;
        player.appendChild(src);

        var div = document.createElement("div");
        div.appendChild(player);
        // videojs();
        video_links[i].parentElement.appendChild(div);
        videojs(player);
    }
}

(function () {
    'use strict';
    GM_addStyle(GM_getResourceText("css"));
    kemonoVideoPlayer();
})();