Kemono/Coomer-VideoPlayer

take a video player under the link

Stan na 09-01-2024. Zobacz najnowsza wersja.

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         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();
})();