// ==UserScript== // @name Replace Video Links with HTML5 Player (Video.js) // @namespace http://tampermonkey.net/ // @version 1.3 // @description Replace video links with HTML5 player on XenForo.com using Video.js // @author Your Name // @match https://www.thecoli.com/threads/* // @match https://thecoli.com/threads/* // @match https://www.thecoli.com/forums/*/post-thread // @match https://thecoli.com/forums/*/post-thread // @match https://www.thecoli.com/conversations/* // @grant none // ==/UserScript== (function() { 'use strict'; // Function to load Video.js CSS and JS files if they are not already loaded function loadVideoJs() { const head = document.head || document.getElementsByTagName('head')[0]; const style = document.createElement('link'); style.rel = 'stylesheet'; style.href = 'https://vjs.zencdn.net/8.16.1/video-js.css'; head.appendChild(style); // Add custom Video.js styles const customStyle = document.createElement('style'); customStyle.textContent = ` .video-js { max-width: 100vw; max-height: 80vh; object-fit: contain; margin: 0 auto; border-radius: 5px; box-shadow: 0 0 10px rgba(0, 0, 0, 0.2); } `; head.appendChild(customStyle); const script = document.createElement('script'); script.src = 'https://vjs.zencdn.net/8.16.1/video.min.js'; head.appendChild(script); return new Promise(resolve => { script.onload = resolve; }); } var replacedLinks = {}; function replaceVideoLinks() { var links = document.querySelectorAll('a[href*=".mp4"], a[href*=".m3u8"], a[href*=".webm"]'); links.forEach(function(link) { if (!replacedLinks[link.href]) { var videoUrl = link.href; // Create a new