Custom Native HTML5 Player with Shortcuts

Custom html5 player with shortcuts and v.redd.it videos with audio

目前为 2020-12-24 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Custom Native HTML5 Player with Shortcuts
  3. // @namespace https://gist.github.com/narcolepticinsomniac
  4. // @version 1.4
  5. // @description Custom html5 player with shortcuts and v.redd.it videos with audio
  6. // @author narcolepticinsomniac
  7. // @include *
  8. // @require https://cdnjs.cloudflare.com/ajax/libs/arrive/2.4.1/arrive.min.js
  9. // @run-at document-start
  10. // @grant GM.xmlHttpRequest
  11. // @connect v.redd.it
  12. // ==/UserScript==
  13.  
  14. let imagusAudio;
  15. let audioSync;
  16. let audioError;
  17. let ytID;
  18. let ytTimeChecked;
  19. const $ = document.querySelector.bind(document);
  20. const $$ = document.querySelectorAll.bind(document);
  21. const newEl = document.createElement.bind(document);
  22.  
  23. const settings = {
  24. // delay to hide contols and cursor if inactive (set to 3000 milliseconds)
  25. hideControls: 3000,
  26. // delay for fullscreen double-click (set to 300 milliseconds)
  27. clickDelay: 300,
  28. // right-click delay to match imagus user setting (set to 0 milliseconds)
  29. imagusStickyDelay: 0,
  30. // right/left arrows keys or inner skip buttons (set to 10 seconds)
  31. skipNormal: 10,
  32. // Shift + Arrow keys or outer skip buttons (set to 30 seconds)
  33. skipShift: 30,
  34. // Ctrl + Arrow keys skip (set to 1 minute)
  35. skipCtrl: 1,
  36. };
  37.  
  38. const shortcutFuncs = {
  39. toggleCaptions: v => {
  40. const validTracks = [];
  41. for (let i = 0; i < v.textTracks.length; ++i) {
  42. const tt = v.textTracks[i];
  43. if (tt.mode === 'showing') {
  44. tt.mode = 'disabled';
  45. if (v.textTracks.addEventListener) {
  46. // If text track event listeners are supported
  47. // (they are on the most recent Chrome), add
  48. // a marker to remember the old track. Use a
  49. // listener to delete it if a different track
  50. // is selected.
  51. v.cbhtml5vsLastCaptionTrack = tt.label;
  52.  
  53. function cleanup(e) {
  54. for (let i = 0; i < v.textTracks.length; ++i) {
  55. const ott = v.textTracks[i];
  56. if (ott.mode === 'showing') {
  57. delete v.cbhtml5vsLastCaptionTrack;
  58. v.textTracks.removeEventListener('change', cleanup);
  59. return;
  60. }
  61. }
  62. }
  63. v.textTracks.addEventListener('change', cleanup);
  64. }
  65. return;
  66. } else if (tt.mode !== 'hidden') {
  67. validTracks.push(tt);
  68. }
  69. }
  70. // If we got here, none of the tracks were selected.
  71. if (validTracks.length === 0) {
  72. return true; // Do not prevent default if no UI activated
  73. }
  74. // Find the best one and select it.
  75. validTracks.sort((a, b) => {
  76. if (v.cbhtml5vsLastCaptionTrack) {
  77. const lastLabel = v.cbhtml5vsLastCaptionTrack;
  78.  
  79. if (a.label === lastLabel && b.label !== lastLabel) {
  80. return -1;
  81. } else if (b.label === lastLabel && a.label !== lastLabel) {
  82. return 1;
  83. }
  84. }
  85.  
  86. const aLang = a.language.toLowerCase();
  87. const bLang = b.language.toLowerCase();
  88. const navLang = navigator.language.toLowerCase();
  89.  
  90. if (aLang === navLang && bLang !== navLang) {
  91. return -1;
  92. } else if (bLang === navLang && aLang !== navLang) {
  93. return 1;
  94. }
  95.  
  96. const aPre = aLang.split('-')[0];
  97. const bPre = bLang.split('-')[0];
  98. const navPre = navLang.split('-')[0];
  99.  
  100. if (aPre === navPre && bPre !== navPre) {
  101. return -1;
  102. } else if (bPre === navPre && aPre !== navPre) {
  103. return 1;
  104. }
  105.  
  106. return 0;
  107. })[0].mode = 'showing';
  108. },
  109.  
  110. togglePlay: v => {
  111. v.paused ? v.play() : v.pause();
  112. },
  113.  
  114. toStart: v => {
  115. v.currentTime = 0;
  116. },
  117.  
  118. toEnd: v => {
  119. v.currentTime = v.duration;
  120. },
  121.  
  122. skipLeft: (v, key, shift, ctrl) => {
  123. if (shift) {
  124. v.currentTime -= settings.skipShift;
  125. } else if (ctrl) {
  126. v.currentTime -= settings.skipCtrl;
  127. } else {
  128. v.currentTime -= settings.skipNormal;
  129. }
  130. },
  131.  
  132. skipRight: (v, key, shift, ctrl) => {
  133. if (shift) {
  134. v.currentTime += settings.skipShift;
  135. } else if (ctrl) {
  136. v.currentTime += settings.skipCtrl;
  137. } else {
  138. v.currentTime += settings.skipNormal;
  139. }
  140. },
  141.  
  142. increaseVol: v => {
  143. if (audioError) return;
  144. if (v.nextSibling.querySelector('volume.disabled')) {
  145. v.volume = 0;
  146. return;
  147. }
  148. const increase = (v.volume + 0.1).toFixed(1);
  149. if (v.muted) {
  150. v.muted = !v.muted;
  151. v.volume = 0.1;
  152. } else {
  153. v.volume <= 0.9 ? v.volume = increase : v.volume = 1;
  154. }
  155. },
  156.  
  157. decreaseVol: v => {
  158. if (audioError) return;
  159. if (v.nextSibling.querySelector('volume.disabled')) {
  160. v.volume = 0;
  161. return;
  162. }
  163. const decrease = (v.volume - 0.1).toFixed(1);
  164. v.volume >= 0.1 ? v.volume = decrease : v.volume = 0;
  165. },
  166.  
  167. toggleMute: v => {
  168. v.muted = !v.muted;
  169. if (audioSync) imagusAudio.muted = v.muted;
  170. },
  171.  
  172. toggleFS: v => {
  173. if (document.fullscreenElement) {
  174. document.exitFullscreen();
  175. v.parentElement.classList.remove('native-fullscreen');
  176. } else {
  177. v.parentElement.classList.add('native-fullscreen');
  178. v.parentElement.requestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
  179. }
  180. },
  181.  
  182. reloadVideo: v => {
  183. const currTime = v.currentTime;
  184. v.load();
  185. v.currentTime = currTime;
  186. },
  187.  
  188. slowOrPrevFrame: (v, key, shift) => {
  189. if (shift) { // Less-Than
  190. v.currentTime -= 1 / 60;
  191. } else { // Comma
  192. if (v.playbackRate >= 0.1) {
  193. const decrease = (v.playbackRate - 0.1).toFixed(2);
  194. const rate = v.nextSibling.querySelector('rate');
  195. v.playbackRate = decrease;
  196. rate.textContent = `${v.playbackRate}x`;
  197. if (v.playbackRate !== 1) {
  198. rate.setAttribute('data-current-rate', `${v.playbackRate}x`);
  199. }
  200. if (v.playbackRate === 0.9) {
  201. v.classList.add('playback-rate-decreased');
  202. } else if (v.playbackRate === 1.1) {
  203. v.classList.add('playback-rate-increased');
  204. } else if (v.playbackRate === 1) {
  205. v.classList.remove('playback-rate-decreased');
  206. v.classList.remove('playback-rate-increased');
  207. rate.removeAttribute('data-current-rate');
  208. }
  209. } else {
  210. v.playbackRate = 0;
  211. }
  212. if (audioSync) imagusAudio.playbackRate = v.playbackRate;
  213. }
  214. },
  215.  
  216. fastOrNextFrame: (v, key, shift) => {
  217. if (shift) { // Greater-Than
  218. v.currentTime += 1 / 60;
  219. } else { // Period
  220. if (v.playbackRate <= 15.9) {
  221. const increase = (v.playbackRate += 0.1).toFixed(2);
  222. const rate = v.nextSibling.querySelector('rate');
  223. v.playbackRate = increase;
  224. rate.textContent = `${v.playbackRate}x`;
  225. if (v.playbackRate !== 1) {
  226. rate.setAttribute('data-current-rate', `${v.playbackRate}x`);
  227. }
  228. if (v.playbackRate === 0.9) {
  229. v.classList.add('playback-rate-decreased');
  230. } else if (v.playbackRate === 1.1) {
  231. v.classList.add('playback-rate-increased');
  232. } else if (v.playbackRate === 1) {
  233. v.classList.remove('playback-rate-decreased');
  234. v.classList.remove('playback-rate-increased');
  235. rate.removeAttribute('data-current-rate');
  236. }
  237. } else {
  238. v.playbackRate = 16;
  239. }
  240. if (audioSync) imagusAudio.playbackRate = v.playbackRate;
  241. }
  242. },
  243.  
  244. normalSpeed: v => { // ?
  245. v.playbackRate = v.defaultPlaybackRate;
  246. if (audioSync) imagusAudio.playbackRate = v.playbackRate;
  247. v.classList.remove('playback-rate-decreased');
  248. v.classList.remove('playback-rate-increased');
  249. v.nextSibling.querySelector('rate').textContent = '1x';
  250. v.nextSibling.querySelector('rate').removeAttribute('data-current-rate');
  251. },
  252.  
  253. toPercentage: (v, key) => {
  254. v.currentTime = (v.duration * (key - 48)) / 10.0;
  255. },
  256. };
  257.  
  258. const keyFuncs = {
  259. 32: shortcutFuncs.togglePlay, // Space
  260. 75: shortcutFuncs.togglePlay, // K
  261. 35: shortcutFuncs.toEnd, // End
  262. 48: shortcutFuncs.toStart, // 0
  263. 36: shortcutFuncs.toStart, // Home
  264. 37: shortcutFuncs.skipLeft, // Left arrow
  265. 74: shortcutFuncs.skipLeft, // J
  266. 39: shortcutFuncs.skipRight, // Right arrow
  267. 76: shortcutFuncs.skipRight, // L
  268. 38: shortcutFuncs.increaseVol, // Up arrow
  269. 40: shortcutFuncs.decreaseVol, // Down arrow
  270. 77: shortcutFuncs.toggleMute, // M
  271. 70: shortcutFuncs.toggleFS, // F
  272. 67: shortcutFuncs.toggleCaptions, // C
  273. 82: shortcutFuncs.reloadVideo, // R
  274. 188: shortcutFuncs.slowOrPrevFrame, // Comma or Less-Than
  275. 190: shortcutFuncs.fastOrNextFrame, // Period or Greater-Than
  276. 191: shortcutFuncs.normalSpeed, // Forward slash or ?
  277. 49: shortcutFuncs.toPercentage, // 1
  278. 50: shortcutFuncs.toPercentage, // 2
  279. 51: shortcutFuncs.toPercentage, // 3
  280. 52: shortcutFuncs.toPercentage, // 4
  281. 53: shortcutFuncs.toPercentage, // 5
  282. 54: shortcutFuncs.toPercentage, // 6
  283. 55: shortcutFuncs.toPercentage, // 7
  284. 56: shortcutFuncs.toPercentage, // 8
  285. 57: shortcutFuncs.toPercentage, // 9
  286. };
  287.  
  288. function customPlayer(v) {
  289. let videoWrapper;
  290. let savedTimeKey;
  291. let mouseDown;
  292. let isPlaying;
  293. let isSeeking;
  294. let earlyXposPercent;
  295. let preventMouseMove;
  296. let controlsTimeout;
  297. let imagusMouseTimeout;
  298. let imagusVid;
  299. let muteTillSync;
  300. let loaded;
  301. let error;
  302. let elToFocus;
  303. let clickCount = 0;
  304. let repeat = 0;
  305. const directVideo = /video/.test(document.contentType) &&
  306. document.body.firstElementChild === v;
  307. const controls = newEl('controls');
  308. const imagus = v.classList.contains('imagus');
  309. if (imagus && !imagusVid) {
  310. imagusVid = v;
  311. imagusAudio = newEl('video');
  312. imagusAudio.preload = 'auto';
  313. imagusAudio.autoplay = 'true';
  314. imagusAudio.className = 'imagus imagus-audio';
  315. imagusAudio.style = 'display: none!important;';
  316. imagusVid.parentElement.insertBefore(imagusAudio, imagusVid);
  317. }
  318. if (directVideo) {
  319. elToFocus = document.body;
  320. self === top ? document.body.classList.add('direct-video-top-level') :
  321. document.body.classList.add('direct-video-embed');
  322. } else {
  323. elToFocus = v;
  324. videoWrapper = newEl('videowrapper');
  325. v.parentNode.insertBefore(videoWrapper, v);
  326. videoWrapper.appendChild(v);
  327. if (!imagus) {
  328. const compStyles = getComputedStyle(v);
  329. const position = compStyles.getPropertyValue('position');
  330. const zIndex = compStyles.getPropertyValue('z-index');
  331. if (position === 'absolute') {
  332. videoWrapper.style.setProperty('--wrapper-position', `${position}`);
  333. }
  334. if (zIndex !== 'auto') {
  335. controls.style.setProperty('--controls-z-index', `calc(${zIndex} + 1)`);
  336. }
  337. }
  338. }
  339. v.parentNode.insertBefore(controls, v.nextSibling);
  340. const playButton = newEl('btn');
  341. playButton.className = 'toggle-play';
  342. controls.appendChild(playButton);
  343. const beginButton = newEl('btn');
  344. beginButton.className = 'begin';
  345. controls.appendChild(beginButton);
  346. const skipLongLeft = newEl('btn');
  347. skipLongLeft.className = 'skip-long left';
  348. controls.appendChild(skipLongLeft);
  349. const skipShortLeft = newEl('btn');
  350. skipShortLeft.className = 'skip-short left';
  351. controls.appendChild(skipShortLeft);
  352. const skipShortRight = newEl('btn');
  353. skipShortRight.className = 'skip-short right';
  354. controls.appendChild(skipShortRight);
  355. const skipLongRight = newEl('btn');
  356. skipLongRight.className = 'skip-long right';
  357. controls.appendChild(skipLongRight);
  358. const timelineWrapper = newEl('timelinewrapper');
  359. controls.appendChild(timelineWrapper);
  360. const currentTime = newEl('currenttime');
  361. currentTime.textContent = '0:00';
  362. timelineWrapper.appendChild(currentTime);
  363. const timeline = newEl('timeline');
  364. timelineWrapper.appendChild(timeline);
  365. const timeBar = newEl('timebar');
  366. timeline.appendChild(timeBar);
  367. const timeBuffer = newEl('timebuffer');
  368. timeBar.appendChild(timeBuffer);
  369. const timeProgress = newEl('timeprogress');
  370. timeBar.appendChild(timeProgress);
  371. const timeSlider = newEl('input');
  372. timeSlider.type = 'range';
  373. timeSlider.value = 0;
  374. timeSlider.min = 0;
  375. timeSlider.max = 100;
  376. timeSlider.step = 0.01;
  377. timeSlider.textContent = '';
  378. timeline.appendChild(timeSlider);
  379. const timeTooltip = newEl('timetooltip');
  380. timeTooltip.className = 'hidden';
  381. timeTooltip.textContent = '-:-';
  382. timeline.appendChild(timeTooltip);
  383. const totalTime = newEl('totaltime');
  384. totalTime.textContent = '-:-';
  385. timelineWrapper.appendChild(totalTime);
  386. const rateDecrease = newEl('btn');
  387. rateDecrease.className = 'rate-decrease';
  388. controls.appendChild(rateDecrease);
  389. const rate = newEl('rate');
  390. rate.textContent = '1x';
  391. controls.appendChild(rate);
  392. const rateIncrease = newEl('btn');
  393. rateIncrease.className = 'rate-increase';
  394. controls.appendChild(rateIncrease);
  395. const volume = newEl('volume');
  396. controls.appendChild(volume);
  397. const volumeBar = newEl('volumebar');
  398. volume.appendChild(volumeBar);
  399. const volumeTrail = newEl('volumetrail');
  400. volumeBar.appendChild(volumeTrail);
  401. const volumeSlider = newEl('input');
  402. volumeSlider.type = 'range';
  403. volumeSlider.min = 0;
  404. volumeSlider.max = 1;
  405. volumeSlider.step = 0.01;
  406. volumeSlider.textContent = '';
  407. volume.appendChild(volumeSlider);
  408. const volumeTooltip = newEl('volumetooltip');
  409. volumeTooltip.className = 'hidden';
  410. volumeTooltip.textContent = '0%';
  411. volume.appendChild(volumeTooltip);
  412. const muteButton = newEl('btn');
  413. muteButton.className = 'mute';
  414. controls.appendChild(muteButton);
  415. const expandButton = newEl('btn');
  416. expandButton.className = 'expand';
  417. controls.appendChild(expandButton);
  418. v.classList.remove('custom-native-player-hidden');
  419. if (v.querySelector('source')) v.classList.add('contains-source');
  420. if (videoWrapper) enforcePosition();
  421. volumeValues();
  422.  
  423. v.onloadedmetadata = e => {
  424. loaded = true;
  425. shortcutFuncs.normalSpeed(v);
  426. savedTimeKey = `${location.pathname}${location.search}${v.duration}`;
  427. const savedTime = localStorage.getItem(savedTimeKey);
  428. if (timeSlider.value === '0') {
  429. if (savedTime) v.currentTime = savedTime;
  430. } else if (earlyXposPercent) {
  431. const time = (earlyXposPercent * v.duration) / 100;
  432. v.currentTime = time;
  433. }
  434. currentTime.textContent = formatTime(v.currentTime);
  435. totalTime.textContent = formatTime(v.duration);
  436. v.classList.remove('disabled');
  437. sliderValues(e);
  438. };
  439.  
  440. v.onloadeddata = () => {
  441. const imagusVreddit = /v(cf)?\.redd\.it/.test(v.src);
  442. const vHasAudio = hasAudio(v);
  443. if (!vHasAudio && !imagusVreddit) {
  444. v.classList.add('muted');
  445. volumeSlider.value = 0;
  446. muteButton.classList.add('disabled');
  447. volume.classList.add('disabled');
  448. } else if (vHasAudio && !imagusVreddit) {
  449. if (v.volume && !v.muted) v.classList.remove('muted');
  450. volumeValues();
  451. if (volume.classList.contains('disabled')) {
  452. muteButton.classList.remove('disabled');
  453. volume.classList.remove('disabled');
  454. }
  455. }
  456. elToFocus.focus({preventScroll: true});
  457. if (v.duration <= settings.skipNormal) {
  458. skipShortLeft.classList.add('disabled');
  459. skipShortRight.classList.add('disabled');
  460. } else {
  461. skipShortLeft.classList.remove('disabled');
  462. skipShortRight.classList.remove('disabled');
  463. }
  464. if (v.duration <= settings.skipShift) {
  465. skipLongLeft.classList.add('disabled');
  466. skipLongRight.classList.add('disabled');
  467. } else {
  468. skipLongLeft.classList.remove('disabled');
  469. skipLongRight.classList.remove('disabled');
  470. }
  471. if (v.paused) {
  472. v.classList.add('paused');
  473. if (videoWrapper) videoWrapper.classList.add('paused');
  474. }
  475. if (imagus) v.currentTime = 0;
  476. };
  477.  
  478. v.oncanplay = () => {
  479. v.oncanplay = null;
  480. if (!loaded) {
  481. v.load();
  482. console.log('Custom native player reloaded');
  483. }
  484. };
  485.  
  486. v.onseeked = () => {
  487. styleBuffer();
  488. setTimeout(styleBuffer, 500);
  489. };
  490.  
  491. v.onprogress = () => {
  492. styleBuffer();
  493. setTimeout(styleBuffer, 500);
  494. };
  495.  
  496. v.ontimeupdate = e => {
  497. if (v.readyState > 0) {
  498. if (v.duration > 0 && !mouseDown) {
  499. sliderValues(e);
  500. totalTime.textContent = formatTime(v.duration);
  501. if (!imagus && savedTimeKey) localStorage.setItem(savedTimeKey, v.currentTime)
  502. }
  503. }
  504. };
  505.  
  506. v.onvolumechange = e => {
  507. if (audioError) return;
  508. if (audioSync) imagusAudio.volume = v.volume;
  509. if (v.muted || !v.volume) {
  510. v.classList.add('muted');
  511. volumeSlider.value = 0;
  512. volumeTrail.style.width = '0';
  513. localStorage.setItem('videomuted', 'true');
  514. } else {
  515. v.classList.remove('muted');
  516. sliderValues(e);
  517. v.volume > 0.1 ? localStorage.setItem('videovolume', v.volume) :
  518. localStorage.setItem('videovolume', 0.1);
  519. localStorage.setItem('videomuted', 'false');
  520. }
  521. };
  522.  
  523. v.onplay = () => {
  524. if (v === imagusVid && audioSync) imagusAudio.play();
  525. v.classList.remove('paused');
  526. if (videoWrapper) videoWrapper.classList.remove('paused');
  527. v.classList.add('playing');
  528. };
  529.  
  530. v.onpause = () => {
  531. if (v === imagusVid && audioSync) imagusAudio.pause();
  532. if (!isSeeking) {
  533. v.classList.remove('playing');
  534. v.classList.add('paused');
  535. if (videoWrapper) videoWrapper.classList.add('paused');
  536. }
  537. };
  538.  
  539. v.onended = () => {
  540. if (localStorage.getItem(savedTimeKey)) localStorage.removeItem(savedTimeKey);
  541. savedTimeKey = false;
  542. };
  543.  
  544. v.onemptied = () => {
  545. if (v === imagusVid) {
  546. if (v.src !== '') {
  547. if (/v(cf)?\.redd\.it/.test(v.src)) {
  548. const prefix = v.src.split('DASH')[0].replace('vcf.', 'v.');
  549. const audioSrc = `${prefix}DASH_audio.mp4`;
  550. GM.xmlHttpRequest({
  551. method: 'GET',
  552. url: audioSrc,
  553. onload: xhr => {
  554. imagusAudio.src = xhr.status >= 200 && xhr.status < 300 ? audioSrc : `${prefix}audio`;
  555. },
  556. onerror: () => {
  557. imagusAudio.src = `${prefix}audio`;
  558. },
  559. });
  560. if (!imagusAudio.muted) {
  561. muteTillSync = true;
  562. imagusAudio.muted = true;
  563. }
  564. if (imagusVid.hasAttribute('loop')) imagusAudio.setAttribute('loop', 'true');
  565. }
  566. v.parentElement.parentElement.classList.add('imagus-video-wrapper');
  567. window.addEventListener('click', imagusClick, true);
  568. document.addEventListener('keyup', imagusKeys, true);
  569. document.addEventListener('mousedown', imagusMouseDown, true);
  570. document.addEventListener('mouseup', imagusMouseUp, true);
  571. } else {
  572. audioSync = false;
  573. audioError = false;
  574. imagusAudio.pause();
  575. imagusAudio.removeAttribute('src');
  576. imagusAudio.load();
  577. imagusAudio.removeAttribute('loop');
  578. v.parentElement.parentElement.removeAttribute('class');
  579. timeTooltip.classList.add('hidden');
  580. window.removeEventListener('click', imagusClick, true);
  581. document.removeEventListener('keyup', imagusKeys, true);
  582. document.removeEventListener('mousedown', imagusMouseDown, true);
  583. document.removeEventListener('mouseup', imagusMouseUp, true);
  584. }
  585. }
  586. };
  587.  
  588. v.onerror = () => {
  589. error = true;
  590. elToFocus.blur();
  591. v.classList.add('disabled');
  592. };
  593.  
  594. v.onmousedown = e => {
  595. if (error && e.button !== 2) return;
  596. e.stopPropagation();
  597. e.stopImmediatePropagation();
  598. if (e.button === 0) {
  599. clickCount++;
  600. const checkState = v.paused;
  601. if (clickCount === 1) {
  602. setTimeout(() => {
  603. if (clickCount === 1) {
  604. // avoid conflicts with existing click listeners
  605. const recheckState = v.paused;
  606. if (checkState === recheckState) shortcutFuncs.togglePlay(v);
  607. } else {
  608. shortcutFuncs.toggleFS(v);
  609. }
  610. clickCount = 0;
  611. }, settings.clickDelay);
  612. }
  613. } else if (e.button === 2) {
  614. window.addEventListener('contextmenu', preventHijack, true);
  615. }
  616. };
  617.  
  618. v.onmouseup = e => {
  619. if (e.button === 2) {
  620. setTimeout(() => {
  621. window.removeEventListener('contextmenu', preventHijack, true);
  622. }, 100);
  623. }
  624. if (error) elToFocus.blur();
  625. };
  626.  
  627. v.onmousemove = () => {
  628. controlsTimeout ? clearTimeout(controlsTimeout) :
  629. v.classList.add('active');
  630. if (videoWrapper) videoWrapper.classList.add('active');
  631. controlsTimeout = setTimeout(() => {
  632. controlsTimeout = false;
  633. v.classList.remove('active');
  634. if (videoWrapper) videoWrapper.classList.remove('active');
  635. }, settings.hideControls);
  636. };
  637.  
  638. new ResizeObserver(() => {
  639. compactControls();
  640. }).observe(v);
  641.  
  642. controls.onmouseup = () => {
  643. if (error) return;
  644. elToFocus.focus({preventScroll: true});
  645. };
  646.  
  647. timeSlider.onmousemove = e => sliderValues(e);
  648.  
  649. timeSlider.oninput = e => sliderValues(e);
  650.  
  651. timeSlider.onmousedown = e => {
  652. if (e.button > 0) return;
  653. mouseDown = true;
  654. isSeeking = true;
  655. if (timeTooltip.classList.contains('hidden')) sliderValues(e);
  656. if (v.readyState > 0) {
  657. if (!v.paused) {
  658. isPlaying = true;
  659. v.pause();
  660. } else {
  661. isPlaying = false;
  662. }
  663. }
  664. };
  665.  
  666. timeSlider.onmouseup = e => {
  667. if (e.button > 0) return;
  668. mouseDown = false;
  669. isSeeking = false;
  670. if (v.readyState > 0) {
  671. sliderValues(e);
  672. if (isPlaying) {
  673. v.play();
  674. isPlaying = false;
  675. }
  676. }
  677. };
  678.  
  679. volumeSlider.onmousemove = e => sliderValues(e);
  680.  
  681. volumeSlider.oninput = e => {
  682. if (v.muted) shortcutFuncs.toggleMute(v);
  683. sliderValues(e);
  684. };
  685.  
  686. muteButton.onmouseup = e => {
  687. if (e.button > 0) return;
  688. const lastVolume = localStorage.getItem('videovolume');
  689. if (v.muted || v.volume) shortcutFuncs.toggleMute(v);
  690. v.volume = lastVolume;
  691. if (audioSync) imagusAudio.muted = v.muted;
  692. };
  693.  
  694. playButton.onmouseup = e => {
  695. if (e.button > 0) return;
  696. shortcutFuncs.togglePlay(v);
  697. };
  698.  
  699. skipShortLeft.onmouseup = e => {
  700. if (e.button > 0) return;
  701. shortcutFuncs.skipLeft(v);
  702. };
  703.  
  704. skipShortRight.onmouseup = e => {
  705. if (e.button > 0) return;
  706. shortcutFuncs.skipRight(v);
  707. };
  708.  
  709. skipLongLeft.onmouseup = e => {
  710. if (e.button > 0) return;
  711. v.currentTime -= settings.skipShift;
  712. };
  713.  
  714. skipLongRight.onmouseup = e => {
  715. if (e.button > 0) return;
  716. v.currentTime += settings.skipShift;
  717. };
  718.  
  719. beginButton.onmouseup = e => {
  720. if (e.button > 0) return;
  721. v.currentTime = 0;
  722. timeSlider.value = 0;
  723. timeProgress.style.width = '0';
  724. currentTime.textContent = '0:00';
  725. };
  726.  
  727. rateDecrease.onmouseup = e => {
  728. if (e.button > 0) return;
  729. shortcutFuncs.slowOrPrevFrame(v);
  730. };
  731.  
  732. rateIncrease.onmouseup = e => {
  733. if (e.button > 0) return;
  734. shortcutFuncs.fastOrNextFrame(v);
  735. };
  736.  
  737. rate.onmouseup = e => {
  738. if (e.button > 0) return;
  739. shortcutFuncs.normalSpeed(v);
  740. };
  741.  
  742. rate.onmouseenter = () => {
  743. rate.textContent = '1x?';
  744. };
  745.  
  746. rate.onmouseleave = () => {
  747. const currentRate = rate.getAttribute('data-current-rate');
  748. if (currentRate) rate.textContent = currentRate;
  749. };
  750.  
  751. expandButton.onmouseup = e => {
  752. if (e.button > 0) return;
  753. shortcutFuncs.toggleFS(v);
  754. };
  755.  
  756. // exiting fullscreen by escape key or other browser provided method
  757. document.onfullscreenchange = () => {
  758. if (!document.fullscreenElement) {
  759. const nativeFS = $('.native-fullscreen');
  760. if (nativeFS) nativeFS.classList.remove('native-fullscreen');
  761. }
  762. };
  763.  
  764. if (imagusVid) {
  765. imagusAudio.onloadedmetadata = () => {
  766. audioSync = true;
  767. if (v.hasAttribute('autoplay')) imagusAudio.play();
  768. };
  769.  
  770. imagusAudio.onloadeddata = () => {
  771. if (v.volume && !v.muted) v.classList.remove('muted');
  772. volumeValues(v);
  773. if (volume.classList.contains('disabled')) {
  774. muteButton.classList.remove('disabled');
  775. volume.classList.remove('disabled');
  776. }
  777. };
  778.  
  779. imagusAudio.onended = () => {
  780. imagusAudio.currentTime = 0;
  781. if (imagusVid.hasAttribute('loop')) imagusAudio.play();
  782. };
  783.  
  784. imagusAudio.onerror = () => {
  785. audioError = true;
  786. v.classList.add('muted');
  787. volumeSlider.value = 0;
  788. muteButton.classList.add('disabled');
  789. volume.classList.add('disabled');
  790. };
  791. }
  792.  
  793. if (directVideo) {
  794. v.removeAttribute('tabindex');
  795. document.body.setAttribute('tabindex', '0');
  796. document.addEventListener('keydown', docHandleKeyDown, true);
  797. document.addEventListener('keypress', docHandleKeyOther, true);
  798. document.addEventListener('keyup', docHandleKeyOther, true);
  799. } else {
  800. v.addEventListener('keydown', handleKeyDown, false);
  801. v.addEventListener('keypress', handleKeyOther, false);
  802. v.addEventListener('keyup', handleKeyOther, false);
  803. }
  804.  
  805. function sliderValues(e) {
  806. let slider;
  807. let xPosition;
  808. const vid = audioSync ? imagusAudio && v : v;
  809. const eType = e && e.type;
  810. const eTime = eType === 'timeupdate';
  811. const eVolume = eType === 'volumechange';
  812. const eMeta = eType === 'loadedmetadata';
  813. const eData = eType === 'loadeddata';
  814. const eInput = eType === 'input';
  815. const eMouseUp = eType === 'mouseup';
  816. const eMouseMove = eType === 'mousemove';
  817. const eMouseDown = eType === 'mousedown';
  818. if (eMeta || eTime || eVolume || eData || !e) {
  819. slider = eMeta || eTime ? timeSlider : volumeSlider;
  820. } else {
  821. slider = e.target;
  822. }
  823. const tooltip = slider.nextSibling;
  824. const timeTarget = slider === timeSlider;
  825. const sliderWidth = slider.clientWidth;
  826. const halfSlider = sliderWidth / 2;
  827. const slider14ths = halfSlider / 7;
  828. const eX = e && e.offsetX;
  829. const start7 = eX <= 7;
  830. const end7 = eX >= sliderWidth - 7;
  831. if (eMouseMove || eMouseDown) {
  832. if (start7 || end7) {
  833. xPosition = start7 ? 0 : sliderWidth;
  834. } else {
  835. xPosition = eX < halfSlider ? (eX + (-7 + (eX / slider14ths))).toFixed(1) :
  836. (eX + ((eX - halfSlider) / slider14ths)).toFixed(1);
  837. }
  838. }
  839. if (eMeta || eTime || eVolume || eData || !e) {
  840. xPosition = eMeta || eTime ?
  841. ((((100 / v.duration) * v.currentTime) * sliderWidth) / 100).toFixed(1) :
  842. (v.volume * sliderWidth).toFixed(1);
  843. }
  844. if (eTime && e.target === imagusVid && audioSync) {
  845. if (imagusVid.currentTime - imagusAudio.currentTime >= 0.1 ||
  846. imagusVid.currentTime - imagusAudio.currentTime <= -0.1) {
  847. imagusAudio.currentTime = imagusVid.currentTime + 0.06;
  848. console.log('time sync corrected');
  849. if (muteTillSync && imagusAudio.readyState > 2) {
  850. imagusAudio.muted = false;
  851. muteTillSync = false;
  852. console.log('unmuted after time correct');
  853. }
  854. } else if (muteTillSync && imagusAudio.readyState > 2) {
  855. imagusAudio.muted = false;
  856. muteTillSync = false;
  857. console.log('unmuted');
  858. }
  859. }
  860. if (eInput || eMouseUp) xPosition = +tooltip.getAttribute('data-x-position');
  861. const xPosPercent = timeTarget ? (xPosition / sliderWidth) * 100 :
  862. Math.round((xPosition / sliderWidth) * 100);
  863. let time = (xPosPercent * v.duration) / 100;
  864. if (eInput || eMeta || eTime || eVolume || eData || !e) {
  865. const valueTrail = timeTarget ? timeProgress : volumeTrail;
  866. const offset = halfSlider < xPosition ? -7 + (xPosition / slider14ths) :
  867. (xPosition - halfSlider) / slider14ths;
  868. slider.value = timeTarget ? xPosPercent : xPosPercent / 100;
  869. valueTrail.style.width = `calc(${xPosPercent}% - ${offset}px)`;
  870. if (eInput && !timeTarget) {
  871. if (start7 || end7) {
  872. vid.volume = start7 ? 0 : 1;
  873. } else {
  874. vid.volume = xPosPercent / 100;
  875. }
  876. }
  877. if (eInput && timeTarget && v.readyState > 0) currentTime.textContent = formatTime(time);
  878. if (eTime) currentTime.textContent = formatTime(v.currentTime);
  879. if (eInput && timeTarget && v.readyState < 1) earlyXposPercent = xPosPercent;
  880. if (eMeta && !tooltip.classList.contains('hidden')) {
  881. xPosition = +tooltip.getAttribute('data-x-position');
  882. time = (xPosition / sliderWidth) * v.duration;
  883. tooltip.textContent = formatTime(time);
  884. }
  885. } else if (eMouseUp) {
  886. if (audioSync) {
  887. if (start7 || end7) {
  888. imagusAudio.currentTime = start7 ? 0 : v.duration;
  889. } else {
  890. imagusAudio.currentTime = time;
  891. }
  892. }
  893. if (start7 || end7) {
  894. v.currentTime = start7 ? 0 : v.duration;
  895. } else {
  896. v.currentTime = time;
  897. }
  898. preventMouseMove = true;
  899. setTimeout(() => {
  900. preventMouseMove = false;
  901. }, 10);
  902. } else if (eMouseMove || eMouseDown) {
  903. if (!preventMouseMove || eMouseDown) {
  904. tooltip.dataset.xPosition = xPosition;
  905. tooltip.style.left = `${eX}px`;
  906. if (v.readyState > 0 && timeTarget) tooltip.textContent = formatTime(time);
  907. if (!timeTarget) tooltip.textContent = `${xPosPercent}%`;
  908. }
  909. tooltip.classList.remove('hidden');
  910. preventMouseMove = false;
  911. }
  912. }
  913.  
  914. function styleBuffer() {
  915. if (v.readyState > 1 && v.duration > 0) {
  916. const buffer = (v.buffered.end(v.buffered.length - 1) / v.duration) * 100;
  917. timeBuffer.style.width = `${buffer}%`;
  918. console.log('buffer styled');
  919. }
  920. }
  921.  
  922. function formatTime(t) {
  923. let seconds = Math.round(t);
  924. const minutes = Math.floor(seconds / 60);
  925. if (minutes > 0) seconds -= minutes * 60;
  926. if (seconds.toString().length === 1) seconds = `0${seconds}`;
  927. return `${minutes}:${seconds}`;
  928. }
  929.  
  930. function volumeValues() {
  931. const videovolume = localStorage.getItem('videovolume');
  932. const videomuted = localStorage.getItem('videomuted');
  933. if ((!videovolume && !videomuted) ||
  934. (videovolume && videovolume === '1' &&
  935. videomuted && videomuted !== 'true')) {
  936. v.volume = 1;
  937. volumeSlider.value = 1;
  938. volumeTrail.style.width = '100%';
  939. localStorage.setItem('videovolume', v.volume);
  940. localStorage.setItem('videomuted', 'false');
  941. } else if (videomuted && videomuted === 'true') {
  942. v.classList.add('muted');
  943. volumeSlider.value = 0;
  944. volumeTrail.style.width = '0';
  945. v.muted = true;
  946. } else {
  947. v.volume = videovolume;
  948. if (audioSync) imagusAudio.volume = v.volume;
  949. sliderValues();
  950. if (!volumeSlider.clientWidth) {
  951. new MutationObserver((_, observer) => {
  952. const volumeWidthSet = v.parentElement.querySelector('volume input').clientWidth;
  953. if (volumeWidthSet) {
  954. sliderValues();
  955. observer.disconnect();
  956. }
  957. }).observe(v.parentElement, {childList: true, subtree: true, attributes: true});
  958. }
  959. }
  960. }
  961.  
  962. function hasAudio() {
  963. return v.mozHasAudio ||
  964. Boolean(v.webkitAudioDecodedByteCount) ||
  965. Boolean(v.audioTracks && v.audioTracks.length);
  966. }
  967.  
  968. function compactControls() {
  969. const width = v.clientWidth;
  970. width && width < 892 ? v.classList.add('compact') : v.classList.remove('compact');
  971. width && width < 412 ? v.classList.add('compact-2') : v.classList.remove('compact-2');
  972. width && width < 316 ? v.classList.add('compact-3') : v.classList.remove('compact-3');
  973. width && width < 246 ? v.classList.add('compact-4') : v.classList.remove('compact-4');
  974. }
  975.  
  976. function imagusMouseDown(e) {
  977. const vid = $('.imagus-video-wrapper');
  978. if (vid && e.button === 2) {
  979. e.stopImmediatePropagation();
  980. imagusMouseTimeout = setTimeout(() => {
  981. imagusMouseTimeout = 'sticky';
  982. }, settings.imagusStickyDelay);
  983. }
  984. }
  985.  
  986. function imagusMouseUp(e) {
  987. const vid = $('.imagus-video-wrapper');
  988. if (vid && e.button === 2) {
  989. if (imagusMouseTimeout === 'sticky') {
  990. vid.classList.add('stickied');
  991. setTimeout(() => {
  992. v.removeAttribute('controls');
  993. });
  994. if (volume.classList.contains('disabled')) volumeSlider.value = 0;
  995. document.removeEventListener('mousedown', imagusMouseDown, true);
  996. document.removeEventListener('mouseup', imagusMouseUp, true);
  997. } else {
  998. clearInterval(imagusMouseTimeout);
  999. imagusMouseTimeout = false;
  1000. }
  1001. }
  1002. }
  1003.  
  1004. function imagusClick(e) {
  1005. const imagusStickied = $('.imagus-video-wrapper.stickied');
  1006. if (imagusStickied) {
  1007. if (e.target.closest('.imagus-video-wrapper.stickied')) {
  1008. e.stopImmediatePropagation();
  1009. } else {
  1010. imagusStickied.removeAttribute('class');
  1011. e.preventDefault();
  1012. }
  1013. }
  1014. }
  1015.  
  1016. function imagusKeys(e) {
  1017. const vid = $('.imagus-video-wrapper');
  1018. if (vid) {
  1019. if (e.keyCode === 13 || e.keyCode === 90) {
  1020. vid.classList.add('stickied');
  1021. setTimeout(() => {
  1022. v.removeAttribute('controls');
  1023. });
  1024. if (volume.classList.contains('disabled')) volumeSlider.value = 0;
  1025. document.removeEventListener('keyup', imagusKeys, true);
  1026. document.removeEventListener('mousedown', imagusMouseDown, true);
  1027. document.removeEventListener('mouseup', imagusMouseUp, true);
  1028. }
  1029. }
  1030. }
  1031.  
  1032. function handleKeyDown(e) {
  1033. if (e.altKey || e.metaKey) return true; // Do not activate
  1034. const func = keyFuncs[e.keyCode];
  1035. if (func) {
  1036. if ((func.length < 3 && e.shiftKey) ||
  1037. (func.length < 4 && e.ctrlKey)) return true; // Do not activate
  1038. func(e.target, e.keyCode, e.shiftKey, e.ctrlKey);
  1039. e.preventDefault();
  1040. e.stopPropagation();
  1041. e.stopImmediatePropagation();
  1042. return false;
  1043. }
  1044. }
  1045.  
  1046. function handleKeyOther(e) {
  1047. if (e.altKey || e.metaKey) return true; // Do not prevent default
  1048. const func = keyFuncs[e.keyCode];
  1049. if (func) {
  1050. if ((func.length < 3 && e.shiftKey) ||
  1051. (func.length < 4 && e.ctrlKey)) return true; // Do not prevent default
  1052. e.preventDefault();
  1053. e.stopPropagation();
  1054. e.stopImmediatePropagation();
  1055. return false;
  1056. }
  1057. }
  1058.  
  1059. function docHandleKeyDown(e) {
  1060. if (document.body !== document.activeElement ||
  1061. e.altKey || e.metaKey) return true; // Do not activate
  1062. const func = keyFuncs[e.keyCode];
  1063. if (func) {
  1064. if ((func.length < 3 && e.shiftKey) ||
  1065. (func.length < 4 && e.ctrlKey)) return true; // Do not activate
  1066. func(v, e.keyCode, e.shiftKey, e.ctrlKey);
  1067. e.preventDefault();
  1068. e.stopPropagation();
  1069. return false;
  1070. }
  1071. }
  1072.  
  1073. function docHandleKeyOther(e) {
  1074. if (document.body !== document.activeElement ||
  1075. e.altKey || e.metaKey) return true; // Do not prevent default
  1076. const func = keyFuncs[e.keyCode];
  1077. if (func) {
  1078. if ((func.length < 3 && e.shiftKey) ||
  1079. (func.length < 4 && e.ctrlKey)) return true; // Do not prevent default
  1080. e.preventDefault();
  1081. e.stopPropagation();
  1082. return false;
  1083. }
  1084. }
  1085.  
  1086. // circumvent any scripts attempting to hijack video context menus
  1087. function preventHijack(e) {
  1088. e.stopPropagation();
  1089. e.stopImmediatePropagation();
  1090. const redirectEvent = e.target.ownerDocument.createEvent('MouseEvents');
  1091. redirectEvent.initMouseEvent(e, e.bubbles, e.cancelable);
  1092. return e;
  1093. }
  1094.  
  1095. function enforcePosition() {
  1096. setTimeout(() => {
  1097. let controlsDisplaced = controls !== v.nextSibling;
  1098. const vidDisplaced = videoWrapper !== v.parentNode;
  1099. if (vidDisplaced || controlsDisplaced) {
  1100. if (vidDisplaced) videoWrapper.appendChild(v);
  1101. controlsDisplaced = v !== controls.previousSibling;
  1102. if (controlsDisplaced) videoWrapper.insertBefore(controls, v.nextSibling);
  1103. const bs =
  1104. videoWrapper.querySelectorAll('videowrapper > *:not(video):not(controls)');
  1105. for (let i = 0; i < bs.length; ++i) {
  1106. bs[i].remove();
  1107. }
  1108. }
  1109. repeat++;
  1110. if (repeat < 10) enforcePosition.call(this);
  1111. }, 100);
  1112. }
  1113. }
  1114.  
  1115. function ytSaveCurrentTime(v) {
  1116. v.addEventListener('loadstart', ytCheckSavedTime);
  1117. v.addEventListener('loadeddata', ytCheckSavedTime);
  1118.  
  1119. v.ontimeupdate = () => {
  1120. if (v.currentTime > 0 && ytTimeChecked) localStorage.setItem(ytID, v.currentTime);
  1121. };
  1122.  
  1123. v.onended = () => {
  1124. if (localStorage.getItem(ytID)) localStorage.removeItem(ytID);
  1125. };
  1126. }
  1127.  
  1128. function ytCheckSavedTime(e) {
  1129. ytID = location.href.replace(/.*?\/(watch\?v=|embed\/)(.*?)(\?|&|$).*/, '$2');
  1130. const savedTime = localStorage.getItem(ytID);
  1131. const timeURL = /(\?|&)(t(ime_continue)?|start)=[1-9]/.test(location.href);
  1132. const ytStart = $('.ytp-clip-start:not([style*="left: 0%;"])');
  1133. if (e.type === 'loadstart') {
  1134. ytTimeChecked = false;
  1135. if ((!ytStart || !savedTime) && !timeURL) ytTimeChecked = true;
  1136. if (ytStart) ytStart.click();
  1137. if (ytTimeChecked && savedTime) e.target.currentTime = savedTime;
  1138. e.target.focus({preventScroll: true});
  1139. if (self === top) window.scroll({top: 0, behavior: 'smooth'});
  1140. } else if (e.type === 'loadeddata' && !ytTimeChecked) {
  1141. if (savedTime) e.target.currentTime = savedTime;
  1142. ytTimeChecked = true;
  1143. }
  1144. }
  1145.  
  1146. window.addEventListener('DOMContentLoaded', () => {
  1147. const style = $('#custom-native-player-style');
  1148. if (style) {
  1149. const docEls = $$('html > *');
  1150. for (let i = 0; i < docEls.length; i++) {
  1151. if (docEls[i].tagName === 'STYLE' &&
  1152. docEls[i].classList.contains('stylus') &&
  1153. docEls[i].id !== 'custom-native-player-style') {
  1154. $('html').insertBefore(style, docEls[i]);
  1155. break;
  1156. } else if (docEls[i] === docEls[docEls.length - 1]) {
  1157. $('html').insertBefore(style, docEls[i].nextSibling);
  1158. }
  1159. }
  1160. }
  1161.  
  1162. document.arrive(
  1163. 'video[controls], video[style*="visibility: inherit !important"]',
  1164. {fireOnAttributesModification: true, existing: true}, v => {
  1165. if (!v.parentNode.parentNode) return;
  1166. const vP = v.parentNode;
  1167. const vPP = v.parentNode.parentNode;
  1168. const imagus = !v.hasAttribute('controls') &&
  1169. $('html > div[style*="z-index: 2147483647"]') === v.parentNode;
  1170. const vidOrParentsIdOrClass =
  1171. `${v.id}${v.classList}${vP.id}${vP.classList}${vPP.id}${vPP.classList}`;
  1172. const exclude = v.classList.contains('custom-native-player') ||
  1173. v.classList.contains('imagus') ||
  1174. /(v(ideo)?|me)(-|_)?js|jw|jplay|plyr|kalt|flowp|wisti/i.test(vidOrParentsIdOrClass);
  1175. if (imagus || (v.hasAttribute('controls') && !exclude)) {
  1176. if (imagus) v.classList.add('imagus');
  1177. v.classList.add('custom-native-player');
  1178. v.classList.add('custom-native-player-hidden');
  1179. v.setAttribute('tabindex', '0');
  1180. v.setAttribute('preload', 'auto');
  1181. v.removeAttribute('controls');
  1182. customPlayer(v);
  1183. }
  1184. });
  1185. });
  1186.  
  1187. if (/^https?:\/\/www\.youtube\.com/.test(location.href)) {
  1188. document.arrive(
  1189. 'video[src*="youtube.com"]',
  1190. {fireOnAttributesModification: true, existing: true}, v => {
  1191. ytSaveCurrentTime(v);
  1192. });
  1193. }
  1194.  
  1195. const css = `.imagus-video-wrapper {
  1196. height: min-content!important;
  1197. position: fixed!important;
  1198. left: 0!important;
  1199. right: 0!important;
  1200. top: 0!important;
  1201. bottom: 0!important;
  1202. margin: auto!important;
  1203. box-shadow: none!important;
  1204. background-color: hsl(0, 0%, 0%)!important;
  1205. width: calc(100% - 100px)!important;
  1206. }
  1207. .imagus-video-wrapper.stickied {
  1208. box-shadow: 0 0 0 100000px hsla(0, 0%, 0%, .7)!important;
  1209. }
  1210. .imagus-video-wrapper videowrapper {
  1211. height: 0!important;
  1212. padding-top: 56.25%!important;
  1213. }
  1214. .imagus-video-wrapper videowrapper video.custom-native-player {
  1215. position: absolute!important;
  1216. }
  1217. @media (min-width: 177.778vh) {
  1218. .imagus-video-wrapper {
  1219. margin: 18px auto!important;
  1220. height: calc(100vh - 18px)!important;
  1221. width: calc(((100vh - 18px) * 16) / 9)!important;
  1222. }
  1223. .imagus-video-wrapper videowrapper {
  1224. height: 100%!important;
  1225. padding-top: 0!important;
  1226. }
  1227. .imagus-video-wrapper videowrapper video.custom-native-player {
  1228. position: relative!important;
  1229. }
  1230. }
  1231. html > div[style*="2147483647"] > img[style*="display: block"] ~ videowrapper {
  1232. display: none!important;
  1233. }
  1234. html > div[style*="2147483647"] {
  1235. background: none!important;
  1236. box-shadow: none!important;
  1237. border: 0!important;
  1238. }
  1239. html > div[style*="2147483647"] videowrapper + div {
  1240. -webkit-text-fill-color: hsl(0, 0%, 90%)!important;
  1241. box-shadow: none!important;
  1242. width: 100%!important;
  1243. max-width: 100%!important;
  1244. box-sizing: border-box!important;
  1245. overflow: hidden!important;
  1246. text-overflow: ellipsis!important;
  1247. }
  1248. html > div:not(.stickied) video.custom-native-player + controls,
  1249. video[controls]:not(.custom-native-player) {
  1250. opacity: 0!important;
  1251. pointer-events: none!important;
  1252. }
  1253. videowrapper {
  1254. --wrapper-position: relative;
  1255. position: var(--wrapper-position)!important;
  1256. height: 100%!important;
  1257. display: block!important;
  1258. font-size: 0px!important;
  1259. top: 0!important;
  1260. bottom: 0!important;
  1261. left: 0!important;
  1262. right: 0!important;
  1263. background-color: hsl(0, 0%, 0%)!important;
  1264. overflow: hidden!important;
  1265. }
  1266. video.custom-native-player + controls timetooltip,
  1267. video.custom-native-player + controls volumetooltip {
  1268. position: absolute!important;
  1269. display: none!important;
  1270. top: -25px!important;
  1271. height: 22px!important;
  1272. line-height: 22px!important;
  1273. text-align: center!important;
  1274. border-radius: 4px!important;
  1275. font-size: 12px!important;
  1276. background: hsla(0, 0%, 0%, .7)!important;
  1277. box-shadow: 0 0 4px hsla(0, 0%, 100%, .5)!important;
  1278. color: hsl(0, 0%, 100%)!important;
  1279. pointer-events: none!important;
  1280. }
  1281. video.custom-native-player + controls timetooltip {
  1282. margin-left: -25px!important;
  1283. width: 50px!important;
  1284. }
  1285. video.custom-native-player + controls volumetooltip {
  1286. margin-left: -20px!important;
  1287. width: 40px!important;
  1288. }
  1289. video.custom-native-player.compact + controls timeline timetooltip {
  1290. top: -25px!important;
  1291. }
  1292. video.custom-native-player.compact + controls btn,
  1293. video.custom-native-player.compact + controls rate,
  1294. video.custom-native-player.compact + controls volume {
  1295. height: 24px!important;
  1296. line-height: 22px!important;
  1297. }
  1298. video.custom-native-player.compact + controls volume input {
  1299. padding-bottom: 2px!important;
  1300. }
  1301. video.custom-native-player.compact + controls btn:before {
  1302. margin-top: -2px!important;
  1303. }
  1304. video.custom-native-player.compact + controls volume > volumebar {
  1305. top: 6px!important;
  1306. }
  1307. video.custom-native-player + controls timelinewrapper {
  1308. line-height: 20px!important;
  1309. }
  1310. video.custom-native-player + controls timeline:hover timetooltip:not(.hidden),
  1311. video.custom-native-player + controls volume:hover volumetooltip:not(.hidden) {
  1312. display: inline!important;
  1313. }
  1314. video.custom-native-player {
  1315. cursor: none!important;
  1316. max-height: 100%!important;
  1317. height: 100%!important;
  1318. width: 100%!important;
  1319. margin: 0!important;
  1320. padding: 0!important;
  1321. top: 0!important;
  1322. bottom: 0!important;
  1323. left: 0!important;
  1324. right: 0!important;
  1325. background-color: hsl(0, 0%, 0%)!important;
  1326. border-radius: 0!important;
  1327. }
  1328. video.custom-native-player:not(.contains-source):not([src*="/"]) {
  1329. cursor: auto!important;
  1330. }
  1331. video.custom-native-player:not(.contains-source):not([src*="/"]) + controls {
  1332. display: none!important;
  1333. }
  1334. video.custom-native-player + controls > * {
  1335. background: none!important;
  1336. outline: none!important;
  1337. line-height: 32px!important;
  1338. font-family: monospace!important;
  1339. }
  1340. video.custom-native-player.compact + controls > * {
  1341. line-height: 24px!important;
  1342. }
  1343. video.custom-native-player + controls {
  1344. --controls-z-index: 1;
  1345. white-space: nowrap!important;
  1346. transition: opacity .5s ease 0s!important;
  1347. background-color: hsla(0, 0%, 0%, .85)!important;
  1348. height: 32px !important;
  1349. width: 100%!important;
  1350. cursor: default !important;
  1351. font-size: 18px !important;
  1352. user-select: none!important;
  1353. z-index: var(--controls-z-index)!important;
  1354. flex: none!important;
  1355. position: absolute!important;
  1356. display: flex!important;
  1357. flex-wrap: wrap!important;
  1358. opacity: 0!important;
  1359. margin: 0!important;
  1360. bottom: 0!important;
  1361. left: 0!important;
  1362. right: 0!important;
  1363. }
  1364. video.custom-native-player.custom-native-player-hidden,
  1365. video.custom-native-player.custom-native-player-hidden + controls {
  1366. opacity: 0!important;
  1367. pointer-events: none!important;
  1368. }
  1369. video.custom-native-player.paused + controls,
  1370. video.custom-native-player.active + controls,
  1371. video.custom-native-player + controls:hover {
  1372. opacity: 1!important;
  1373. }
  1374. video.custom-native-player + controls timeline {
  1375. flex-grow: 1!important;
  1376. position: relative!important;
  1377. align-items: center!important;
  1378. flex-direction: column!important;
  1379. height: 100%!important;
  1380. }
  1381. video.custom-native-player + controls timelinewrapper {
  1382. flex: 1 0 480px!important;
  1383. position: relative!important;
  1384. align-items: center!important;
  1385. }
  1386. video.custom-native-player.compact + controls timelinewrapper {
  1387. order: -1;
  1388. flex-basis: 100%!important;
  1389. height: 20px!important;
  1390. }
  1391. video.custom-native-player.compact + controls timeline timebar {
  1392. top: 5px!important;
  1393. }
  1394. video.custom-native-player.compact + controls currenttime,
  1395. video.custom-native-player.compact + controls totaltime {
  1396. line-height: 20px!important;
  1397. }
  1398. video.custom-native-player.compact + controls {
  1399. height: 44px!important;
  1400. }
  1401. video.custom-native-player.compact-2 + controls btn.begin,
  1402. video.custom-native-player.compact-2 + controls btn.skip-short,
  1403. video.custom-native-player.compact-3 + controls rate,
  1404. video.custom-native-player.compact-3 + controls btn.rate-increase,
  1405. video.custom-native-player.compact-3 + controls btn.rate-decrease,
  1406. video.custom-native-player.compact-4 + controls btn.skip-long {
  1407. display: none!important;
  1408. }
  1409. video.custom-native-player + controls > * {
  1410. display: inline-flex!important;
  1411. }
  1412. video.custom-native-player.compact-2 + controls btn.rate-increase,
  1413. video.custom-native-player.compact-4 + controls btn.toggle-play {
  1414. margin-right: auto!important;
  1415. }
  1416. video.custom-native-player + controls timeline > timebar > timebuffer,
  1417. video.custom-native-player + controls timeline > timebar > timeprogress,
  1418. video.custom-native-player + controls volume > volumebar > volumetrail {
  1419. position: absolute!important;
  1420. flex: none!important;
  1421. pointer-events: none!important;
  1422. height: 100%!important;
  1423. border-radius: 20px!important;
  1424. }
  1425. video.custom-native-player + controls timeline > timebar,
  1426. video.custom-native-player + controls volume > volumebar {
  1427. position: absolute!important;
  1428. height: 10px!important;
  1429. border-radius: 20px!important;
  1430. overflow: hidden!important;
  1431. background-color: hsla(0, 0%, 16%, .85)!important;
  1432. top: 11px!important;
  1433. left: 0!important;
  1434. right: 0!important;
  1435. pointer-events: none!important;
  1436. z-index: -1!important;
  1437. box-shadow: inset 0 0 0 1px hsla(0, 0%, 40%), inset 0 0 5px hsla(0, 0%, 40%, .85)!important;
  1438. }
  1439. video.custom-native-player + controls volume.disabled,
  1440. video.custom-native-player + controls btn.disabled {
  1441. -webkit-filter: brightness(.4);
  1442. filter: brightness(.4);
  1443. pointer-events: none!important;
  1444. }
  1445. video.custom-native-player.disabled,
  1446. video.custom-native-player.active.disabled {
  1447. cursor: default!important;
  1448. }
  1449. video.custom-native-player.disabled + controls {
  1450. opacity: 1!important;
  1451. -webkit-filter: brightness(.3)sepia(1)hue-rotate(320deg)saturate(5);
  1452. filter: brightness(.3)sepia(1)hue-rotate(320deg)saturate(5);
  1453. }
  1454. video.custom-native-player.disabled + controls > * {
  1455. pointer-events: none!important;
  1456. }
  1457. video.custom-native-player + controls volume {
  1458. max-width: 70px!important;
  1459. flex: 1 0 48px!important;
  1460. position: relative!important;
  1461. margin: 0 12px!important;
  1462. }
  1463. video.custom-native-player + controls timeline > timebar > timebuffer {
  1464. background-color: hsla(0, 0%, 100%, .2)!important;
  1465. border-top-right-radius: 20px!important;
  1466. border-bottom-right-radius: 20px!important;
  1467. left: 0!important;
  1468. }
  1469. video.custom-native-player + controls timeline > timebar > timeprogress,
  1470. video.custom-native-player + controls volume > volumebar > volumetrail {
  1471. background-color: hsla(0, 0%, 100%, .4)!important;
  1472. left: 0!important;
  1473. }
  1474. video.custom-native-player + controls volume.disabled volumetrail {
  1475. width: 0!important;
  1476. }
  1477. video.custom-native-player + controls timeline > input {
  1478. height: 100%!important;
  1479. width: 100%!important;
  1480. }
  1481. video.custom-native-player.active {
  1482. cursor: pointer!important;
  1483. }
  1484. video.custom-native-player + controls btn {
  1485. border: none !important;
  1486. cursor: pointer!important;
  1487. background-color: transparent!important;
  1488. font-family: "Segoe UI Symbol"!important;
  1489. font-size: 0!important;
  1490. margin: 0!important;
  1491. align-items: center!important;
  1492. justify-content: center!important;
  1493. height: 32px!important;
  1494. padding: 0!important;
  1495. flex: 1 1 32px!important;
  1496. max-width: 46px!important;
  1497. box-sizing: content-box!important;
  1498. position: relative!important;
  1499. opacity: .86!important;
  1500. text-shadow: none!important;
  1501. transition: opacity .3s, text-shadow .3s!important;
  1502. -webkit-text-fill-color: hsl(0, 0%, 100%)!important;
  1503. }
  1504. video.custom-native-player + controls btn.toggle-play {
  1505. flex: 1 1 46px!important
  1506. }
  1507. video.custom-native-player + controls btn:hover {
  1508. opacity: 1!important;
  1509. text-shadow: 0 0 8px hsla(0, 0%, 100%)!important;
  1510. }
  1511. video.custom-native-player.playback-rate-increased + controls btn.rate-increase,
  1512. video.custom-native-player.playback-rate-decreased + controls btn.rate-decrease {
  1513. -webkit-text-fill-color: cyan!important;
  1514. }
  1515. video.custom-native-player + controls rate {
  1516. height: 32px!important;
  1517. width: 42px!important;
  1518. margin: 0!important;
  1519. display: unset!important;
  1520. text-align: center!important;
  1521. font-size: 14px!important;
  1522. flex-shrink: 0!important;
  1523. font-weight: bold!important;
  1524. letter-spacing: .5px!important;
  1525. -webkit-text-fill-color: hsl(0, 0%, 100%)!important;
  1526. user-select: none!important;
  1527. pointer-events: none!important;
  1528. opacity: .86!important;
  1529. }
  1530. video.custom-native-player + controls rate[data-current-rate] {
  1531. pointer-events: all!important;
  1532. cursor: pointer!important;
  1533. }
  1534. video.custom-native-player + controls rate[data-current-rate]:hover {
  1535. transition: opacity .3s, text-shadow .3s!important;
  1536. opacity: 1!important;
  1537. text-shadow: 0 0 8px hsla(0, 0%, 100%)!important;
  1538. }
  1539. video.custom-native-player + controls input[type=range] {
  1540. -webkit-appearance: none!important;
  1541. background-color: transparent !important;
  1542. outline: none!important;
  1543. border: 0!important;
  1544. border-radius: 6px !important;
  1545. margin: 0!important;
  1546. top: 0!important;
  1547. bottom: 0!important;
  1548. left: 0!important;
  1549. right: 0!important;
  1550. padding: 0!important;
  1551. width: 100%!important;
  1552. position: relative!important;
  1553. }
  1554. video.custom-native-player + controls input[type='range']::-webkit-slider-thumb {
  1555. -webkit-appearance: none!important;
  1556. background-color: hsl(0, 0%, 86%)!important;
  1557. border: 0!important;
  1558. height: 14px!important;
  1559. width: 14px!important;
  1560. border-radius: 50%!important;
  1561. pointer-events: none!important;
  1562. }
  1563. video.custom-native-player.muted + controls volume input[type='range']::-webkit-slider-thumb {
  1564. background-color: hsl(0, 0%, 50%)!important;
  1565. }
  1566. video.custom-native-player + controls input[type='range']::-moz-range-thumb {
  1567. -moz-appearance: none!important;
  1568. background-color: hsl(0, 0%, 86%)!important;
  1569. border: 0!important;
  1570. height: 14px!important;
  1571. width: 14px!important;
  1572. border-radius: 50%!important;
  1573. pointer-events: none!important;
  1574. }
  1575. video.custom-native-player.muted + controls volume input[type='range']::-moz-range-thumb {
  1576. background-color: hsl(0, 0%, 50%)!important;
  1577. }
  1578. video.custom-native-player + controls currenttime,
  1579. video.custom-native-player + controls totaltime {
  1580. font-family: monospace, arial!important;
  1581. font-weight: bold!important;
  1582. font-size: 14px!important;
  1583. letter-spacing: .5px!important;
  1584. height: 100%!important;
  1585. line-height: 32px!important;
  1586. min-width: 58px!important;
  1587. display: unset!important;
  1588. -webkit-text-fill-color: hsl(0, 0%, 86%)!important;
  1589. }
  1590. video.custom-native-player + controls btn.rate-decrease,
  1591. video.custom-native-player + controls btn.rate-increase {
  1592. padding: 0!important;
  1593. flex: 1 0 14px!important;
  1594. max-width: 24px!important;
  1595. }
  1596. video.custom-native-player + controls btn.rate-decrease {
  1597. margin-left: auto!important;
  1598. }
  1599. video.custom-native-player + controls currenttime {
  1600. padding: 0 12px 0 0!important;
  1601. margin-right: 2px!important;
  1602. text-align: right!important;
  1603. }
  1604. video.custom-native-player + controls totaltime {
  1605. padding: 0 0 0 12px!important;
  1606. margin-left: 2px!important;
  1607. text-align: left!important;
  1608. }
  1609. .direct-video-top-level {
  1610. margin: 0!important;
  1611. padding: 0!important;
  1612. display: flex!important;
  1613. align-items: center!important;
  1614. justify-content: center!important;
  1615. }
  1616. .direct-video-top-level video {
  1617. height: calc(((100vw - 30px) * 9) / 16)!important;
  1618. min-height: calc(((100vw - 30px) * 9) / 16)!important;
  1619. max-height: calc(((100vw - 30px) * 9) / 16)!important;
  1620. width: calc(100vw - 30px)!important;
  1621. min-width: calc(100vw - 30px)!important;
  1622. max-width: calc(100vw - 30px)!important;
  1623. margin: auto!important;
  1624. }
  1625. .direct-video-top-level > video.custom-native-player + controls {
  1626. position: absolute!important;
  1627. left: 0!important;
  1628. right: 0!important;
  1629. margin: 0 auto !important;
  1630. width: calc(100vw - 30px)!important;
  1631. bottom: calc((100vh - (((100vw - 30px) * 9) / 16)) / 2)!important;
  1632. }
  1633. @media (min-width: 177.778vh) {
  1634. .direct-video-top-level video {
  1635. position: unset!important;
  1636. height: calc(100vh - 30px)!important;
  1637. min-height: calc(100vh - 30px)!important;
  1638. max-height: calc(100vh - 30px)!important;
  1639. width: calc(((100vh - 30px) * 16) / 9)!important;
  1640. min-width: calc(((100vh - 30px) * 16) / 9)!important;
  1641. max-width: calc(((100vh - 30px) * 16) / 9)!important;
  1642. margin: 0 auto!important;
  1643. padding: 0!important;
  1644. background-color: hsl(0, 0%, 0%)!important;
  1645. }
  1646. .direct-video-top-level > video.custom-native-player + controls {
  1647. width: calc(((100vh - 30px) * 16) / 9)!important;
  1648. min-width: calc(((100vh - 30px) * 16) / 9)!important;
  1649. max-width: calc(((100vh - 30px) * 16) / 9)!important;
  1650. bottom: 15px!important;
  1651. }
  1652. }
  1653. video::-webkit-media-controls,
  1654. .native-fullscreen > *:not(video):not(controls) {
  1655. display: none!important;
  1656. }
  1657. .native-fullscreen video.custom-native-player,
  1658. .direct-video-top-level .native-fullscreen video.custom-native-player {
  1659. height: 100vh!important;
  1660. width: 100vw!important;
  1661. max-height: 100vh!important;
  1662. max-width: 100vw!important;
  1663. min-height: 100vh!important;
  1664. min-width: 100vw!important;
  1665. margin: 0!important;
  1666. }
  1667. .native-fullscreen video.custom-native-player + controls {
  1668. position: fixed!important;
  1669. bottom: 0!important;
  1670. left: 0!important;
  1671. right: 0!important;
  1672. margin: 0!important;
  1673. width: 100vw!important;
  1674. max-width: 100vw!important;
  1675. }
  1676. video.custom-native-player + controls btn:before {
  1677. font-family: 'customNativePlayer'!important;
  1678. font-weight: 400!important;
  1679. -webkit-font-smoothing: subpixel-antialiased!important;
  1680. -moz-osx-font-smoothing: subpixel-antialiased!important;
  1681. font-size: 20px!important;
  1682. }
  1683. video.custom-native-player + controls btn.skip-short.right:before {
  1684. content: '\\e90c'!important;
  1685. }
  1686. video.custom-native-player + controls btn.skip-short.left:before {
  1687. content: '\\e90b'!important;
  1688. }
  1689. video.custom-native-player + controls btn.skip-long.right:before {
  1690. content: '\\e901'!important;
  1691. }
  1692. video.custom-native-player + controls btn.skip-long.left:before {
  1693. content: '\\e902'!important;
  1694. }
  1695. video.custom-native-player + controls btn.begin:before {
  1696. content: '\\e908'!important;
  1697. }
  1698. video.custom-native-player + controls btn.toggle-play:before {
  1699. content: '\\e906'!important;
  1700. font-size: 26px!important;
  1701. }
  1702. video.custom-native-player.playing + controls btn.toggle-play:before {
  1703. content: '\\e905'!important;
  1704. font-size: 24px!important;
  1705. }
  1706. video.custom-native-player + controls btn.rate-decrease:before {
  1707. content: '\\ea0b'!important;
  1708. font-size: 10px!important;
  1709. }
  1710. video.custom-native-player + controls btn.rate-increase:before {
  1711. content: '\\ea0a'!important;
  1712. font-size: 10px!important;
  1713. }
  1714. video.custom-native-player + controls btn.mute:before {
  1715. content: '\\e90a'!important;
  1716. font-size: 22px!important;
  1717. }
  1718. video.custom-native-player.muted + controls btn.mute:before {
  1719. content: '\\e909'!important;
  1720. font-size: 22px!important;
  1721. }
  1722. video.custom-native-player + controls btn.mute.disabled:before {
  1723. content: '\\e909'!important;
  1724. }
  1725. video.custom-native-player + controls btn.expand:before {
  1726. content: '\\e904'!important;
  1727. font-size: 24px!important;
  1728. }
  1729. .native-fullscreen video.custom-native-player + controls btn.expand:before {
  1730. content: '\\e903'!important;
  1731. font-size: 24px!important;
  1732. }
  1733. @font-face {
  1734. font-family: 'customNativePlayer';
  1735. src: url(data:application/x-font-woff;charset=utf-8;base64,d09GRgABAAAAAAe8AAsAAAAAC2gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABPUy8yAAABCAAAAEAAAABgDxIHPmNtYXAAAAFIAAAAUQAAAHTquqeaZ2FzcAAAAZwAAAAIAAAACAAAABBnbHlmAAABpAAABG0AAAcgC+w8l2hlYWQAAAYUAAAALAAAADYWP5TBaGhlYQAABkAAAAAcAAAAJAgCBBhobXR4AAAGXAAAAC8AAABcUkALAGxvY2EAAAaMAAAAMAAAADAN9g+EbWF4cAAABrwAAAAYAAAAIAAcAIxuYW1lAAAG1AAAANoAAAGGmUoJ+3Bvc3QAAAewAAAADAAAACAAAwAAeNpjYGZ+xTiBgZWBgWkm0xkGBoZ+CM34msGYkZMBFTAKoAkwODAwvNJiPvD/AIMD8wEQj4ERSVaBgQEAdCILXHjaY2BgYGaAYBkGRijNDGSBaBaGCCAtxCAAFGECiim85HnZ84r7ldorrf9///9nAAGFlwwvu19xwcUY/z8WZxFrE+MUfS/6BmoSGgAA0DQY1QAAAAABAAH//wAPeNqNVD1s20YUfo+UdJYd/dAiRdtKJVOMScWyKVs0SRuuGQ6xA8QI4CKQ4p+kMAJkSAx0SacOBdGtKNBNnTUFhTQUKNDOHDp5l5cu3r0nSyz1kZSNGHCCHqS7e3/f+967OwLC1eAAnI1I/P+6AXT4OncBUyQogiooliKYgsLXR9Aekb2NgJ3xZjSO7kPAd7gAeGCElEYBhTT28c3wN/TDOaAYGJLjEDBOy8EJxbQohoMkwIKACkUN4oCAI+RRyAoS13xSkIECzAIUTMm0VKmgRguaFi0FK5QGfvvM98+IWJvm9hlKoUAbf7jok5YkuIGZpCoFkKnSCIyPsMZ7KUyDdQpuExoXBvsEckKIBDYEgvfJENZCFXV4ILyo/gVTUMOWIfT72Op3uPZljwsTI7bGeakyqhZbeMZdXPawHvUdyYYhBvXdon6HUdhph7Y+eHyL70CDBIvJVlMuo1yURJZFllKruoG6ZqlipDWbjouOba1FWpWDwcBqGDsijR2jYcX71lzphes+euS6L0pz8Z676A0GPVHcbpCT0diWRFHabhjWzgP3eYnGc/fBTuRfinvoEyef92ACKtAEm5itaboku2iZYoqFa8xAl4oxW2SyKpiyIBNpiSjKDiapFi7YXHmNeHJnypNkubjnOF5D1zfy+ctf7NPT/uAvaaW0tFd9Zl/a+PjgAIONo5lvX7MMK6+XvNrBykPXfamq2f3M3dKuYZjo26cjambl7/zcxP5krfTM5k7rBwd/AnXWh8fE2Y7u0hLdpJAOU5NEXHCRvyIat5VJ9qeN1P3+YNDnvM2Vlc2TmGA+v6HrDc9x9opj4pxHqbnewCeOw99njvCPK1qmYeyW7mb2s6r60nUfjkmHd+JrCLh30TuAhTRy7+gJvIneC9kOyfbPtQ0Pr99SqBkFCeCDqBa6TTrTHZ1nsiLITgK6wXHQ7Qbd4XE34INwJvmS/kja8Yu/JR7jeAwif/48BkB/DIDn1wB4Ha9G34k1rY7VlCQo1dRXKBZNRRCLm9i0LUFp2lt0NfjzYbeQCTKFYTdTKGTwOBLwmATOi5bMbQ7j7xR6CeA8yNGZSSF6jKlSNihk+CAM+OhlCtx8tA2n6I6Gk8f/CHX4Br6Dn6mLVU3X1pybJxsqmvLNw8+iql/52mufd1q93asoRmZW1RqoVjVLWLM3kZJSuCSIoYn/IT3Nsllldq6aplGdm1Wy2WwtWytX7k/RuF8p19h0ujcpkNfqzOzszCrZ9WxlRp5PT0yk5+WZChPS/QilnM/l8uUofkkuFuUlNv1r6k7y/duwG2/fs0I6PTWV5lMaY+SiaNrT5WXDWF5+qmkKKShu2Xhl2+vrtv3KWK4xdsgmKFdzy/1py23SLpcrq/eeLC7W64uLT+6p5Ql2FEGVdW1P08sRxtLG+vfrG0uM/ZtMfKADpPP4kErwifzkx2Ayn8Dxd58GH9CZ5GCRzlVSdaZajm6ZsmNKDL/QsKB1cnL1G+7eVh62PnXxPkPjP6LOXdEAAAB42mNgZAADZqYpmfH8Nl8ZuFnA/JsFK5QQ9P8DLA7MB4BcDgYmkCgA/hcJqHjaY2BkYGA+8P8AAwOLAwMDmGRkQAXiAFdpAyR42mNhQAAmIGZhYLgKxKuBOBvKBmJGoDhjKJJcAwQz2gBxFAtEHwI7QGgAfJcHlwAAAAAAAAoAFAAeADgAUgBmAJAAuADMANoA6AEyAYwB1gHkAfICEgIyAmgChANOA5B42mNgZGBgEGfoYmBhAAEmBjQAABCkAKl42m3OwWrCQBSF4T8aLbXgri5czRMEhdJdt4IUNy5cN8YhBHQGxmQh9An6HF33GXuMd5mBDF/O3Ll3gDl/ZNxXxlO/39dI/jKP5XdzLnfmCS+8mqfKP80zlvzoVpY/K5nr5OGRXJvH8oc5l7/NExY481T53jzjjd+mipcYAw0VkYu+SDj4dG1icOtixQFP4qoCHajPmoLV4K3BcO/r7lwmDfV6aMeZkjRYuYmhdbUPPpWtP7njzW2ruFNZwaaf3Wp6rTahf1Gpf89J2ZGb9m3fa/foRfEP3IM9twAAeNpjYGbACwAAfQAE) format('woff'), url('customNativePlayer.ttf') format('truetype'), url('customNativePlayer.svg#customNativePlayer') format('svg');
  1736. font-weight: normal;
  1737. font-style: normal;
  1738. }`;
  1739.  
  1740. const style = newEl('style');
  1741. style.id = 'custom-native-player-style';
  1742. style.type = 'text/css';
  1743. style.className = 'stylus'; // Dark Reader won't brute force override stylus
  1744. style.textContent = css;
  1745. document.documentElement.appendChild(style);