PageSourceSearch

https://laziar.com/assets/videojs/plugins/cjs/videojs.skipintro.js

js laziar.com collected 2026-09-28 08:59:02 UTC 2,161 bytes, 64 lines download raw bytes

1/**
2 * Copyright (c) 2023 The Nuevodevel Team. All rights reserved.
3 * SkipIntro plugin for video.js
4 * Version 1.0.0
5 */
6/* eslint-disable */ /* eslint-env node */ function _interopDefault(e) {
7  return e && 'object' === typeof e && 'default' in e ? e.default : e;
8}
9var videojs = _interopDefault(require('video.js'));
10const defaults = { skipStart: 0, skipDuration: 5, skipTarget: 0, skipText: 'Skip Intro' };
11window.skipintro = { version: '1.0' };
12const onPlayerReady = (i, t) => {
13    try {
14      t = videojs.obj.merge(defaults, t);
15    } catch (i) {
16      t = videojs.mergeOptions(defaults, t);
17    }
18    let e,
19      r = !1;
20    if (t.skipStart > 0 && t.skipDuration > 0 && t.skipTarget > 0) {
21      (e = document.createElement('div')).className = 'vast-skip-button vjs-hidden';
22      e.innerHTML = '<p class="vast-skip-button-text">' + t.skipText + '</p>';
23      e.style.cursor = 'pointer';
24      e.tabIndex = 0;
25      e.role = 'button';
26      e.ariaDisabled = 'false';
27      i.el().appendChild(e);
28      if (t.skipStart + t.skipDuration > t.skipTarget) t.skipDuration = t.skipTarget - t.skipStart;
29      i.on('timeupdate', function () {
30        if (i.currentTime() > t.skipTarget) {
31          r = !0;
32          i.el().removeChild(e);
33        }
34        if (!0 !== r) {
35          if (i.currentTime() > t.skipStart && i.currentTime() < t.skipStart + t.skipDuration) {
36            videojs.dom.removeClass(e, 'vjs-hidden');
37            e.onkeydown = function (i) {
38              i.preventDefault();
39              i.stopPropagation();
40              e.click();
41            };
42            e.onclick = function () {
43              r = !0;
44              i.currentTime(t.skipTarget);
45              i.el().removeChild(e);
46            };
47          }
48          if (i.currentTime() > t.skipStart + t.skipDuration) {
49            r = !0;
50            i.el().removeChild(e);
51          }
52        }
53      });
54    }
55    return this;
56  },
57  skipintro = function (i) {
58    this.ready(function () {
59      onPlayerReady(this, i);
60    });
61  };
62if ('undefined' !== typeof window) videojs.registerPlugin('skipintro', skipintro);
63skipintro.VERSION = '1.0';
64module.exports = skipintro;

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.