Kemono/Coomer-VideoPlayer

take a video player under the link

اعتبارا من 09-01-2024. شاهد أحدث إصدار.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

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