PageSourceSearch

https://bayerwaldhof.de/files/bwh/src/js/audiojs/audio.min.js

js bayerwaldhof.de collected 2026-09-30 19:54:53 UTC 24,820 bytes, 476 lines download raw bytes

1(function (h, o, g) {
2    var p = function () {
3        for (var b = /audio(.min)?.js.*/, a = document.getElementsByTagName("script"), c = 0, d = a.length; c < d; c++) {
4            var e = a[c].getAttribute("src");
5            if (b.test(e)) return e.replace(b, "")
6        }
7    }();
8    g[h] = {
9        instanceCount: 0
10        , instances: {}
11        , flashSource: '      <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="$1" width="1" height="1" name="$1" style="position: absolute; left: -1px;">         <param name="movie" value="$2?playerInstance=' + h + '.instances[\'$1\']&datetime=$3">         <param name="allowscriptaccess" value="always">         <embed name="$1" src="$2?playerInstance=' + h + '.instances[\'$1\']&datetime=$3" width="1" height="1" allowscriptaccess="always">       </object>'
12        , settings: {
13            autoplay: false
14            , loop: false
15            , preload: true
16            , imageLocation: p + "player-graphics.gif"
17            , swfLocation: p + "audiojs.swf"
18            , useFlash: function () {
19                var b = document.createElement("audio");
20                return !(b.canPlayType && b.canPlayType("audio/mpeg;").replace(/no/, ""))
21            }()
22            , hasFlash: function () {
23                if (navigator.plugins && navigator.plugins.length && navigator.plugins["Shockwave Flash"]) return true;
24                else if (navigator.mimeTypes && navigator.mimeTypes.length) {
25                    var b = navigator.mimeTypes["application/x-shockwave-flash"];
26                    return b && b.enabledPlugin
27                }
28                else try {
29                    new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
30                    return true
31                }
32                catch (a) {}
33                return false
34            }()
35            , createPlayer: {
36                markup: '          <div class="play-pause">             <p class="play"></p>             <p class="pause"></p>             <p class="loading"></p>             <p class="error"></p>           </div>           <div class="scrubber">             <div class="progress"></div>             <div class="loaded"></div>           </div>           <div class="time">             <em class="played">00:00</em>/<strong class="duration">00:00</strong>           </div>           <div class="error-message"></div>'
37                , playPauseClass: "play-pause"
38                , scrubberClass: "scrubber"
39                , progressClass: "progress"
40                , loaderClass: "loaded"
41                , timeClass: "time"
42                , durationClass: "duration"
43                , playedClass: "played"
44                , errorMessageClass: "error-message"
45                , playingClass: "playing"
46                , loadingClass: "loading"
47                , errorClass: "error"
48            }
49            , css: '        .audiojs audio { position: absolute; left: -1px; }         .audiojs { width: 460px; height: 36px; background: #404040; overflow: hidden; font-family: monospace; font-size: 12px;           background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #444), color-stop(0.5, #555), color-stop(0.51, #444), color-stop(1, #444));           background-image: -moz-linear-gradient(center top, #444 0%, #555 50%, #444 51%, #444 100%);           -webkit-box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.3); -moz-box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.3);           -o-box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.3); box-shadow: 1px 1px 8px rgba(0, 0, 0, 0.3); }         .audiojs .play-pause { width: 25px; height: 40px; padding: 4px 6px; margin: 0px; float: left; overflow: hidden; border-right: 1px solid #000; }         .audiojs p { display: none; width: 25px; height: 40px; margin: 0px; cursor: pointer; }         .audiojs .play { display: block; }         .audiojs .scrubber { position: relative; float: left; width: 280px; background: #5a5a5a; height: 14px; margin: 10px; border-top: 1px solid #3f3f3f; border-left: 0px; border-bottom: 0px; overflow: hidden; }         .audiojs .progress { position: absolute; top: 0px; left: 0px; height: 14px; width: 0px; background: #ccc; z-index: 1;           background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #ccc), color-stop(0.5, #ddd), color-stop(0.51, #ccc), color-stop(1, #ccc));           background-image: -moz-linear-gradient(center top, #ccc 0%, #ddd 50%, #ccc 51%, #ccc 100%); }         .audiojs .loaded { position: absolute; top: 0px; left: 0px; height: 14px; width: 0px; background: #000;           background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #222), color-stop(0.5, #333), color-stop(0.51, #222), color-stop(1, #222));           background-image: -moz-linear-gradient(center top, #222 0%, #333 50%, #222 51%, #222 100%); }         .audiojs .time { float: left; height: 36px; line-height: 36px; margin: 0px 0px 0px 6px; padding: 0px 6px 0px 12px; border-left: 1px solid #000; color: #ddd; text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.5); }         .audiojs .time em { padding: 0px 2px 0px 0px; color: #f9f9f9; font-style: normal; }         .audiojs .time strong { padding: 0px 0px 0px 2px; font-weight: normal; }         .audiojs .error-message { float: left; display: none; margin: 0px 10px; height: 36px; width: 400px; overflow: hidden; line-height: 36px; white-space: nowrap; color: #fff;           text-overflow: ellipsis; -o-text-overflow: ellipsis; -icab-text-overflow: ellipsis; -khtml-text-overflow: ellipsis; -moz-text-overflow: ellipsis; -webkit-text-overflow: ellipsis; }         .audiojs .error-message a { color: #eee; text-decoration: none; padding-bottom: 1px; border-bottom: 1px solid #999; white-space: wrap; }                 .audiojs .play { background: url("$1") -2px -1px no-repeat; }         .audiojs .loading { background: url("$1") -2px -31px no-repeat; }         .audiojs .error { background: url("$1") -2px -61px no-repeat; }         .audiojs .pause { background: url("$1") -2px -91px no-repeat; }                 .playing .play, .playing .loading, .playing .error { display: none; }         .playing .pause { display: block; }                 .loading .play, .loading .pause, .loading .error { display: none; }         .loading .loading { display: block; }                 .error .time, .error .play, .error .pause, .error .scrubber, .error .loading { display: none; }         .error .error { display: block; }         .error .play-pause p { cursor: auto; }         .error .error-message { display: block; }'
50            , trackEnded: function () {}
51            , flashError: function () {
52                var b = this.settings.createPlayer
53                    , a = j(b.errorMessageClass, this.wrapper)
54                    , c = 'Missing <a href="http://get.adobe.com/flashplayer/">
54flash player</a> plugin.';
55                if (this.mp3) c += ' <a href="' + this.mp3 + '">Download audio file</a>.';
56                g[h].helpers.removeClass(this.wrapper, b.loadingClass);
57                g[h].helpers.addClass(this.wrapper, b.errorClass);
58                a.innerHTML = c
59            }
60            , loadError: function () {
61                var b = this.settings.createPlayer
62                    , a = j(b.errorMessageClass, this.wrapper);
63                g[h].helpers.removeClass(this.wrapper, b.loadingClass);
64                g[h].helpers.addClass(this.wrapper, b.errorClass);
65                a.innerHTML = 'Error loading: "' + this.mp3 + '"'
66            }
67            , init: function () {
68                g[h].helpers.addClass(this.wrapper, this.settings.createPlayer.loadingClass)
69            }
70            , loadStarted: function () {
71                var b = this.settings.createPlayer
72                    , a = j(b.durationClass, this.wrapper)
73                    , c = Math.floor(this.duration / 60)
74                    , d = Math.floor(this.duration % 60);
75                g[h].helpers.removeClass(this.wrapper, b.loadingClass);
76                a.innerHTML = (c < 10 ? "0" : "") + c + ":" + (d < 10 ? "0" : "") + d
77            }
78            , loadProgress: function (b) {
79                var a = this.settings.createPlayer
80                    , c = j(a.scrubberClass, this.wrapper);
81                j(a.loaderClass, this.wrapper).style.width = c.offsetWidth * b + "px"
82            }
83            , playPause: function () {
84                this.playing ? this.settings.play() : this.settings.pause()
85            }
86            , play: function () {
87                g[h].helpers.addClass(this.wrapper, this.settings.createPlayer.playingClass)
88            }
89            , pause: function () {
90                g[h].helpers.removeClass(this.wrapper, this.settings.createPlayer.playingClass)
91            }
92            , updatePlayhead: function (b) {
93                var a = this.settings.createPlayer
94                    , c = j(a.scrubberClass, this.wrapper);
95                j(a.progressClass, this.wrapper).style.width = c.offsetWidth * b + "px";
96                a = j(a.playedClass, this.wrapper);
97                c = this.duration * b;
98                b = Math.floor(c / 60);
99                c = Math.floor(c % 60);
100                a.innerHTML = (b < 10 ? "0" : "") + b + ":" + (c < 10 ? "0" : "") + c
101            }
102        }
103        , create: function (b, a) {
104            a = a || {};
105            return b.length ? this.createAll(a, b) : this.newInstance(b, a)
106        }
107        , createAll: function (b, a) {
108            var c = a || document.getElementsByTagName("audio")
109                , d = [];
110            b = b || {};
111            for (var e = 0, i = c.length; e < i; e++) d.push(this.newInstance(c[e], b));
112            return d
113        }
114        , newInstance: function (b, a) {
115            var c = this.helpers.clone(this.settings)
116                , d = "audiojs" + this.instanceCount
117                , e = "audiojs_wrapper" + this.instanceCount;
118            this.instanceCount++;
119            if (b.getAttribute("autoplay") != null) c.autoplay = true;
120            if (b.getAttribute("loop") != null) c.loop = true;
121            if (b.getAttribute("preload") == "none") c.preload = false;
122            a && this.helpers.merge(c, a);
123            if (c.createPlayer.markup) b = this.createPlayer(b, c.createPlayer, e);
124            else b.parentNode.setAttribute("id", e);
125            e = new g[o](b, c);
126            c.css && this.helpers.injectCss(e, c.css);
127            if (c.useFlash && c.hasFlash) {
128                this.injectFlash(e, d);
129                this.attachFlashEvents(e.wrapper, e)
130            }
131            else c.useFlash && !c.hasFlash && this.settings.flashError.apply(e);
132            if (!c.useFlash || c.useFlash && c.hasFlash) this.attachEvents(e.wrapper, e);
133            return this.instances[d] = e
134        }
135        , createPlayer: function (b, a, c) {
136            var d = document.createElement("div")
137                , e = b.cloneNode(true);
138            d.setAttribute("class", "audiojs");
139            d.setAttribute("className", "audiojs");
140            d.setAttribute("id", c);
141            if (e.outerHTML && !document.createElement("audio").canPlayType) {
142                e = this.helpers.cloneHtml5Node(b);
143                d.innerHTML = a.markup;
144                d.appendChild(e);
145                b.outerHTML = d.outerHTML;
146                d = document.getElementById(c)
147            }
148            else {
149                d.appendChild(e);
150                d.innerHTML += a.markup;
151                b.parentNode.replaceChild(d, b)
152            }
153            return d.getElementsByTagName("audio")[0]
154        }
155        , attachEvents: function (b, a) {
156            if (a.settings.createPlayer) {
157                var c = a.settings.createPlayer
158                    , d = j(c.playPauseClass, b)
159                    , e = j(c.scrubberClass, b);
160                g[h].events.addListener(d, "click", function () {
161                    a.playPause.apply(a)
162                });
163                g[h].events.addListener(e, "click", function (i) {
164                    i = i.clientX;
165                    var f = this
166                        , k = 0;
167                    if (f.offsetParent) {
168                        do k += f.offsetLeft; while (f = f.offsetParent)
169                    }
170                    a.skipTo((i - k) / e.offsetWidth)
171                });
172                if (!a.settings.useFlash) {
173                    g[h].events.trackLoadProgress(a);
174                    g[h].events.addListener(a.element, "timeupdate", function () {
175                        a.updatePlayhead.apply(a)
176                    });
177                    g[h].events.addListener(a.element, "ended", function () {
178                        a.trackEnded.apply(a)
179                    });
180                    g[h].events.addListener(a.source, "error", function () {
181                        clearInterval(a.readyTimer);
182                        clearInterval(a.loadTimer);
183                        a.settings.loadError.apply(a)
184                    })
185                }
186            }
187        }
188        , attachFlashEvents: function (b, a) {
189            a.swfReady = false;
190            a.load = function (c) {
191                a.mp3 = c;
192                a.swfReady && a.element.load(c)
193            };
194            a.loadProgress = function (c, d) {
195                a.loadedPercent = c;
196                a.duration = d;
197                a.settings.loadStarted.apply(a);
198                a.settings.loadProgress.apply(a, [c])
199            };
200            a.skipTo = function (c) {
201                if (!(c > a.loadedPercent)) {
202                    a.updatePlayhead.call(a, [c]);
203                    a.element.skipTo(c)
204                }
205            };
206            a.updatePlayhead = function (c) {
207                a.settings.updatePlayhead.apply(a, [c])
208            };
209            a.play = function () {
210                if (!a.settings.preload) {
211                    a.settings.preload = true;
212                    a.element.init(a.mp3)
213                }
214                a.playing = true;
215                a.element.pplay();
216                a.settings.play.apply(a)
217            };
218            a.pause = function () {
219                a.playing = false;
220                a.element.ppause();
221                a.settings.pause.apply(a)
222            };
223            a.setVolume = function (c) {
224                a.element.setVolume(c)
225            };
226            a.loadStarted = function () {
227                a.swfReady = true;
228                a.settings.preload && a.element.init(a.mp3);
229                a.settings.autoplay && a.play.apply(a)
230            }
231        }
232        , injectFlash: function (b, a) {
233            var c = this.flashSource.replace(/\$1/g, a);
234            c = c.replace(/\$2/g, b.settings.swfLocation);
235            c = c.replace(/\$3/g, +new Date + Math.random());
236            var d = b.wrapper.innerHTML
237                , e = document.createElement("div");
238            e.innerHTML = c + d;
239            b.wrapper.innerHTML = e.innerHTML;
240            b.element = this.helpers.getSwf(a)
241        }
242        , helpers: {
243            merge: function (b, a) {
244                for (attr in a)
245                    if (b.hasOwnProperty(attr) || a.hasOwnProperty(attr)) b[attr] = a[attr]
246            }
247            , clone: function (b) {
248                if (b == null || typeof b !== "object") return b;
249                var a = new b.constructor
250                    , c;
251                for (c in b) a[c] = arguments.callee(b[c]);
252                return a
253            }
254            , addClass: function (b, a) {
255                RegExp("(\\s|^)" + a + "(\\s|$)").test(b.className) || (b.className += " " + a)
256            }
257            , removeClass: function (b, a) {
258                b.className = b.className.replace(RegExp("(\\s|^)" + a + "(\\s|$)"), " ")
259            }
260            , injectCss: function (b, a) {
261                for (var c = "", d = document.getElementsByTagName("style"), e = a.replace(/\$1/g, b.settings.imageLocation), i = 0, f = d.length; i < f; i++) {
262                    var k = d[i].getAttribute("title");
263                    if (k && ~k.indexOf("audiojs")) {
264                        f = d[i];
265                        if (f.innerHTML === e) return;
266                        c = f.innerHTML;
267                        break
268                    }
269                }
270                d = document.getElementsByTagName("head")[0];
271                i = d.firstChild;
272                f = document.createElement("style");
273                if (d) {
274                    f.setAttribute("type", "text/css");
275                    f.setAttribute("title", "audiojs");
276                    if (f.styleSheet) f.styleSheet.cssText = c + e;
277                    else f.appendChild(document.createTextNode(c + e));
278                    i ? d.insertBefore(f, i) : d.appendChild(styleElement)
279                }
280            }
281            , cloneHtml5Node: function (b) {
282                var a = document.createDocumentFragment()
283                    , c = a.createElement ? a : document;
284                c.createElement("audio");
285                c = c.createElement("div");
286                a.appendChild(c);
287                c.innerHTML = b.outerHTML;
288                return c.firstChild
289            }
290            , getSwf: function (b) {
291                b = document[b] || window[b];
292                return b.length > 1 ? b[b.length - 1] : b
293            }
294        }
295        , events: {
296            memoryLeaking: false
297            , listeners: []
298            , addListener: function (b, a, c) {
299                if (b.addEventListener) b.addEventListener(a, c, false);
300                else if (b.attachEvent) {
301                    this.listeners.push(b);
302                    if (!this.memoryLeaking) {
303                        window.attachEvent("onunload", function () {
304                            if (this.listeners)
305                                for (var d = 0, e = this.listeners.length; d < e; d++) g[h].events.purge(this.listeners[d])
306                        });
307                        this.memoryLeaking = true
308                    }
309                    b.attachEvent("on" + a, function () {
310                        c.call(b, window.event)
311                    })
312                }
313            }
314            , trackLoadProgress: function (b) {
315                if (b.settings.preload) {
316                    var a, c;
317                    b = b;
318                    var d = /(ipod|iphone|ipad)/i.test(navigator.userAgent);
319                    a = setInterval(function () {
320                        if (b.element.readyState >
320 -1) d || b.init.apply(b);
321                        if (b.element.readyState > 1) {
322                            b.settings.autoplay && b.play.apply(b);
323                            clearInterval(a);
324                            c = setInterval(function () {
325                                b.loadProgress.apply(b);
326                                b.loadedPercent >= 1 && clearInterval(c)
327                            })
328                        }
329                    }, 10);
330                    b.readyTimer = a;
331                    b.loadTimer = c
332                }
333            }
334            , purge: function (b) {
335                var a = b.attributes
336                    , c;
337                if (a)
338                    for (c = 0; c < a.length; c += 1)
339                        if (typeof b[a[c].name] === "function") b[a[c].name] = null;
340                if (a = b.childNodes)
341                    for (c = 0; c < a.length; c += 1) purge(b.childNodes[c])
342            }
343            , ready: function () {
344                return function (b) {
345                    var a = window
346                        , c = false
347                        , d = true
348                        , e = a.document
349                        , i = e.documentElement
350                        , f = e.addEventListener ? "addEventListener" : "attachEvent"
351                        , k = e.addEventListener ? "removeEventListener" : "detachEvent"
352                        , n = e.addEventListener ? "" : "on"
353                        , m = function (l) {
354                            if (!(l.type == "readystatechange" && e.readyState != "complete")) {
355                                (l.type == "load" ? a : e)[k](n + l.type, m, false);
356                                if (!c && (c = true)) b.call(a, l.type || l)
357                            }
358                        }
359                        , q = function () {
360                            try {
361                                i.doScroll("left")
362                            }
363                            catch (l) {
364                                setTimeout(q, 50);
365                                return
366                            }
367                            m("poll")
368                        };
369                    if (e.readyState == "complete") b.call(a, "lazy");
370                    else {
371                        if (e.createEventObject && i.doScroll) {
372                            try {
373                                d = !a.frameElement
374                            }
375                            catch (r) {}
376                            d && q()
377                        }
378                        e[f](n + "DOMContentLoaded", m, false);
379                        e[f](n + "readystatechange", m, false);
380                        a[f](n + "load", m, false)
381                    }
382                }
383            }()
384        }
385    };
386    g[o] = function (b, a) {
387        this.element = b;
388        this.wrapper = b.parentNode;
389        this.source = b.getElementsByTagName("source")[0] || b;
390        this.mp3 = function (c) {
391            var d = c.getElementsByTagName("source")[0];
392            return c.getAttribute("src") || (d ? d.getAttribute("src") : null)
393        }(b);
394        this.settings = a;
395        this.loadStartedCalled = false;
396        this.loadedPercent = 0;
397        this.duration = 1;
398        this.playing = false
399    };
400    g[o].prototype = {
401        updatePlayhead: function () {
402            this.settings.updatePlayhead.apply(this, [this.element.currentTime / this.duration])
403        }
404        , skipTo: function (b) {
405            if (!(b > this.loadedPercent)) {
406                this.element.currentTime = this.duration * b;
407                this.updatePlayhead()
408            }
409        }
410        , load: function (b) {
411            this.loadStartedCalled = false;
412            this.source.setAttribute("src", b);
413            this.element.load();
414            this.mp3 = b;
415            g[h].events.trackLoadProgress(this)
416        }
417        , loadError: function () {
418            this.settings.loadError.apply(this)
419        }
420        , init: function () {
421            this.settings.init.apply(this)
422        }
423        , loadStarted: function () {
424            if (!this.element.duration) return false;
425            this.duration = this.element.duration;
426            this.updatePlayhead();
427            this.settings.loadStarted.apply(this)
428        }
429        , loadProgress: function () {
430            if (this.element.buffered != null && this.element.buffered.length) {
431                if (!this.loadStartedCalled) this.loadStartedCalled = this.loadStarted();
432                this.loadedPercent = this.element.buffered.end(this.element.buffered.length - 1) / this.duration;
433                this.settings.loadProgress.apply(this, [this.loadedPercent])
434            }
435        }
436        , playPause: function () {
437            this.playing ? this.pause() : this.play()
438        }
439        , play: function () {
440            /(ipod|iphone|ipad)/i.test(navigator.userAgent) && this.element.readyState == 0 && this.init.apply(this);
441            if (!this.settings.preload) {
442                this.settings.preload = true;
443                this.element.setAttribute("preload", "auto");
444                g[h].events.trackLoadProgress(this)
445            }
446            this.playing = true;
447            this.element.play();
448            this.settings.play.apply(this)
449        }
450        , pause: function () {
451            this.playing = false;
452            this.element.pause();
453            this.settings.pause.apply(this)
454        }
455        , setVolume: function (b) {
456            this.element.volume = b
457        }
458        , trackEnded: function () {
459            this.skipTo.apply(this, [0]);
460            this.settings.loop || this.pause.apply(this);
461            this.settings.trackEnded.apply(this)
462        }
463    };
464    var j = function (b, a) {
465        var c = [];
466        a = a || document;
467        if (a.getElementsByClassName) c = a.getElementsByClassName(b);
468        else {
469            var d, e, i = a.getElementsByTagName("*")
470                , f = RegExp("(^|\\s)" + b + "(\\s|$)");
471            d = 0;
472            for (e = i.length; d < e; d++) f.test(i[d].className) && c.push(i[d])
473        }
474        return c.length > 1 ? c : c[0]
475    }
476})("audiojs", "audiojsInstance", this);

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.