PageSourceSearch

https://www.biosphere-expeditions.org/plugins/content/jw_allvideos/jw_allvideos/includes/js/behaviour.js?v=7.0

js biosphere-expeditions.org collected 2026-10-02 09:56:41 UTC 3,863 bytes, 104 lines download raw bytes

1/**
2 * @version    7.0
3 * @package    AllVideos (plugin)
4 * @author     JoomlaWorks - https://www.joomlaworks.net
5 * @copyright  Copyright (c) 2006 - 2025 JoomlaWorks Ltd. All rights reserved.
6 * @license    GNU/GPL license: https://www.gnu.org/copyleft/gpl.html
7 */
8
9var allvideos = {
10    ready: function(cb) {
11        /in/.test(document.readyState) ? setTimeout('allvideos.ready(' + cb + ')', 9) : cb();
12    },
13
14    getRemoteJson: function(url) {
15        var remoteJsonScript = document.createElement('script');
16        remoteJsonScript.setAttribute('charset', 'utf-8');
17        remoteJsonScript.setAttribute('type', 'text/javascript');
18        remoteJsonScript.setAttribute('async', 'true');
19        remoteJsonScript.setAttribute('src', url);
20        return remoteJsonScript;
21    },
22
23    embed: function(el) {
24        var jsonpCallback = el.callback;
25        var tempId = Math.floor(Math.random() * 1000) + 1;
26        var responseContainer = [];
27        window[jsonpCallback] = function(response) {
28            responseContainer.tempId = [response];
29        };
30        var head = document.getElementsByTagName('head')[0];
31        var jsonp = this.getRemoteJson(el.url);
32        jsonp.onloadDone = false;
33        jsonp.onload = function() {
34            if (!jsonp.onloadDone) {
35                jsonp.onloadDone = true;
36                document.getElementById(el.playerID).innerHTML = responseContainer.tempId[0].html;
37            }
38        };
39        jsonp.onreadystatechange = function() {
40            if (("loaded" === jsonp.readyState || "complete" === jsonp.readyState) && !jsonp.onloadDone) {
41                jsonp.onloadDone = true;
42                document.getElementById(el.playerID).innerHTML = responseContainer.tempId[0].html;
43            }
44        }
45        head.appendChild(jsonp);
46    }
47}
48
49function allVideosMakeVideoPoster(source, container) {
50    if (source.autoplay || source.poster) {
51        return;
52    }
53    var videoClass = source.getAttribute('class');
54    var videoStyle = source.getAttribute('style');
55    var videoURL = source.getAttribute('src');
56    var videoControls = (source.controls ? ' controls' : '');
57    var videoControlsList = (source.controlsList ? ' controlsList="' + source.controlsList + '"' : '');
58    var videoPoster = '';
59    var secToSeek = 5;
60
61    var v = document.createElement('video');
62    v.setAttribute('preload', 'metadata');
63    v.src = videoURL + '#t=' + secToSeek;
64    v.onseeked = function(e) {
65        var canvas = document.createElement('canvas');
66        canvas.width = v.videoWidth;
67        canvas.height = v.videoHeight;
68        var ctx = canvas.getContext('2d');
69        ctx.drawImage(v, 0, 0, canvas.width, canvas.height);
70        videoPoster = canvas.toDataURL();
71        container.innerHTML = '<video class="' + videoClass + '" style="' + videoStyle + '" src="' + videoURL + '" poster="' + videoPoster + '" preload="metadata"' + videoControls + '' + videoControlsList + '></video>';
72    };
73}
74
75function allVideosHelper() {
76    var i = 0,
77        j = 0,
78        deprecated = document.querySelectorAll(".avDeprecated"),
79        deprecatedCount = deprecated.length,
80        videos = document.querySelectorAll("video.avPlayer"),
81        videosCount = videos.length;
82
83    if (deprecatedCount) {
84        for (j; j < deprecatedCount; j++) {
85            var parent = deprecated[j].parentNode;
86            parent.setAttribute('class', 'avPlayerBlockDisabled');
87        }
88    }
89
90    if (videosCount) {
91        for (i; i < videosCount; i++) {
92            var container = videos[i].parentNode;
93            allVideosMakeVideoPoster(videos[i], container);
94        }
95    }
96}
97
98if (window.addEventListener) {
99    window.addEventListener("DOMContentLoaded", allVideosHelper, false);
100} else if (window.attachEvent) {
101    window.attachEvent("onload", allVideosHelper);
102} else {
103    window.onload = allVideosHelper;
104}

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.