~ubuntu-branches/ubuntu/utopic/moodle/utopic

« back to all changes in this revision

Viewing changes to lib/flowplayer/flowplayer-3.2.12.js

  • Committer: Package Import Robot
  • Author(s): Thijs Kinkhorst
  • Date: 2014-05-12 16:10:38 UTC
  • mfrom: (36.1.3 sid)
  • Revision ID: package-import@ubuntu.com-20140512161038-puyqf65k4e0s8ytz
Tags: 2.6.3-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * flowplayer.js 3.2.12. The Flowplayer API
3
 
 *
4
 
 * Copyright 2009-2011 Flowplayer Oy
5
 
 *
6
 
 * This file is part of Flowplayer.
7
 
 *
8
 
 * Flowplayer is free software: you can redistribute it and/or modify
9
 
 * it under the terms of the GNU General Public License as published by
10
 
 * the Free Software Foundation, either version 3 of the License, or
11
 
 * (at your option) any later version.
12
 
 *
13
 
 * Flowplayer is distributed in the hope that it will be useful,
14
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 
 * GNU General Public License for more details.
17
 
 *
18
 
 * You should have received a copy of the GNU General Public License
19
 
 * along with Flowplayer.  If not, see <http://www.gnu.org/licenses/>.
20
 
 *
21
 
 * Date: ${date}
22
 
 * Revision: ${revision}
23
 
 */
24
 
!function () {
25
 
    function h(p) {
26
 
        console.log("$f.fireEvent", [].slice.call(p))
27
 
    }
28
 
 
29
 
    function l(r) {
30
 
        if (!r || typeof r != "object") {
31
 
            return r
32
 
        }
33
 
        var p = new r.constructor();
34
 
        for (var q in r) {
35
 
            if (r.hasOwnProperty(q)) {
36
 
                p[q] = l(r[q])
37
 
            }
38
 
        }
39
 
        return p
40
 
    }
41
 
 
42
 
    function n(u, r) {
43
 
        if (!u) {
44
 
            return
45
 
        }
46
 
        var p, q = 0, s = u.length;
47
 
        if (s === undefined) {
48
 
            for (p in u) {
49
 
                if (r.call(u[p], p, u[p]) === false) {
50
 
                    break
51
 
                }
52
 
            }
53
 
        } else {
54
 
            for (var t = u[0]; q < s && r.call(t, q, t) !== false; t = u[++q]) {
55
 
            }
56
 
        }
57
 
        return u
58
 
    }
59
 
 
60
 
    function c(p) {
61
 
        return document.getElementById(p)
62
 
    }
63
 
 
64
 
    function j(r, q, p) {
65
 
        if (typeof q != "object") {
66
 
            return r
67
 
        }
68
 
        if (r && q) {
69
 
            n(q, function (s, t) {
70
 
                if (!p || typeof t != "function") {
71
 
                    r[s] = t
72
 
                }
73
 
            })
74
 
        }
75
 
        return r
76
 
    }
77
 
 
78
 
    function o(t) {
79
 
        var r = t.indexOf(".");
80
 
        if (r != -1) {
81
 
            var q = t.slice(0, r) || "*";
82
 
            var p = t.slice(r + 1, t.length);
83
 
            var s = [];
84
 
            n(document.getElementsByTagName(q), function () {
85
 
                if (this.className && this.className.indexOf(p) != -1) {
86
 
                    s.push(this)
87
 
                }
88
 
            });
89
 
            return s
90
 
        }
91
 
    }
92
 
 
93
 
    function g(p) {
94
 
        p = p || window.event;
95
 
        if (p.preventDefault) {
96
 
            p.stopPropagation();
97
 
            p.preventDefault()
98
 
        } else {
99
 
            p.returnValue = false;
100
 
            p.cancelBubble = true
101
 
        }
102
 
        return false
103
 
    }
104
 
 
105
 
    function k(r, p, q) {
106
 
        r[p] = r[p] || [];
107
 
        r[p].push(q)
108
 
    }
109
 
 
110
 
    function e(p) {
111
 
        return p.replace(/&amp;/g, "%26").replace(/&/g, "%26").replace(/=/g, "%3D")
112
 
    }
113
 
 
114
 
    function f() {
115
 
        return"_" + ("" + Math.random()).slice(2, 10)
116
 
    }
117
 
 
118
 
    var i = function (u, s, t) {
119
 
        var r = this, q = {}, v = {};
120
 
        r.index = s;
121
 
        if (typeof u == "string") {
122
 
            u = {url: u}
123
 
        }
124
 
        j(this, u, true);
125
 
        n(("Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop").split(","), function () {
126
 
            var w = "on" + this;
127
 
            if (w.indexOf("*") != -1) {
128
 
                w = w.slice(0, w.length - 1);
129
 
                var x = "onBefore" + w.slice(2);
130
 
                r[x] = function (y) {
131
 
                    k(v, x, y);
132
 
                    return r
133
 
                }
134
 
            }
135
 
            r[w] = function (y) {
136
 
                k(v, w, y);
137
 
                return r
138
 
            };
139
 
            if (s == -1) {
140
 
                if (r[x]) {
141
 
                    t[x] = r[x]
142
 
                }
143
 
                if (r[w]) {
144
 
                    t[w] = r[w]
145
 
                }
146
 
            }
147
 
        });
148
 
        j(this, {onCuepoint: function (y, x) {
149
 
            if (arguments.length == 1) {
150
 
                q.embedded = [null, y];
151
 
                return r
152
 
            }
153
 
            if (typeof y == "number") {
154
 
                y = [y]
155
 
            }
156
 
            var w = f();
157
 
            q[w] = [y, x];
158
 
            if (t.isLoaded()) {
159
 
                t._api().fp_addCuepoints(y, s, w)
160
 
            }
161
 
            return r
162
 
        }, update: function (x) {
163
 
            j(r, x);
164
 
            if (t.isLoaded()) {
165
 
                t._api().fp_updateClip(x, s)
166
 
            }
167
 
            var w = t.getConfig();
168
 
            var y = (s == -1) ? w.clip : w.playlist[s];
169
 
            j(y, x, true)
170
 
        }, _fireEvent: function (w, z, x, B) {
171
 
            if (w == "onLoad") {
172
 
                n(q, function (C, D) {
173
 
                    if (D[0]) {
174
 
                        t._api().fp_addCuepoints(D[0], s, C)
175
 
                    }
176
 
                });
177
 
                return false
178
 
            }
179
 
            B = B || r;
180
 
            if (w == "onCuepoint") {
181
 
                var A = q[z];
182
 
                if (A) {
183
 
                    return A[1].call(t, B, x)
184
 
                }
185
 
            }
186
 
            if (z && "onBeforeBegin,onMetaData,onStart,onUpdate,onResume".indexOf(w) != -1) {
187
 
                j(B, z);
188
 
                if (z.metaData) {
189
 
                    if (!B.duration) {
190
 
                        B.duration = z.metaData.duration
191
 
                    } else {
192
 
                        B.fullDuration = z.metaData.duration
193
 
                    }
194
 
                }
195
 
            }
196
 
            var y = true;
197
 
            n(v[w], function () {
198
 
                y = this.call(t, B, z, x)
199
 
            });
200
 
            return y
201
 
        }});
202
 
        if (u.onCuepoint) {
203
 
            var p = u.onCuepoint;
204
 
            r.onCuepoint.apply(r, typeof p == "function" ? [p] : p);
205
 
            delete u.onCuepoint
206
 
        }
207
 
        n(u, function (w, x) {
208
 
            if (typeof x == "function") {
209
 
                k(v, w, x);
210
 
                delete u[w]
211
 
            }
212
 
        });
213
 
        if (s == -1) {
214
 
            t.onCuepoint = this.onCuepoint
215
 
        }
216
 
    };
217
 
    var m = function (q, s, r, u) {
218
 
        var p = this, t = {}, v = false;
219
 
        if (u) {
220
 
            j(t, u)
221
 
        }
222
 
        n(s, function (w, x) {
223
 
            if (typeof x == "function") {
224
 
                t[w] = x;
225
 
                delete s[w]
226
 
            }
227
 
        });
228
 
        j(this, {animate: function (z, A, y) {
229
 
            if (!z) {
230
 
                return p
231
 
            }
232
 
            if (typeof A == "function") {
233
 
                y = A;
234
 
                A = 500
235
 
            }
236
 
            if (typeof z == "string") {
237
 
                var x = z;
238
 
                z = {};
239
 
                z[x] = A;
240
 
                A = 500
241
 
            }
242
 
            if (y) {
243
 
                var w = f();
244
 
                t[w] = y
245
 
            }
246
 
            if (A === undefined) {
247
 
                A = 500
248
 
            }
249
 
            s = r._api().fp_animate(q, z, A, w);
250
 
            return p
251
 
        }, css: function (x, y) {
252
 
            if (y !== undefined) {
253
 
                var w = {};
254
 
                w[x] = y;
255
 
                x = w
256
 
            }
257
 
            s = r._api().fp_css(q, x);
258
 
            j(p, s);
259
 
            return p
260
 
        }, show: function () {
261
 
            this.display = "block";
262
 
            r._api().fp_showPlugin(q);
263
 
            return p
264
 
        }, hide: function () {
265
 
            this.display = "none";
266
 
            r._api().fp_hidePlugin(q);
267
 
            return p
268
 
        }, toggle: function () {
269
 
            this.display = r._api().fp_togglePlugin(q);
270
 
            return p
271
 
        }, fadeTo: function (z, y, x) {
272
 
            if (typeof y == "function") {
273
 
                x = y;
274
 
                y = 500
275
 
            }
276
 
            if (x) {
277
 
                var w = f();
278
 
                t[w] = x
279
 
            }
280
 
            this.display = r._api().fp_fadeTo(q, z, y, w);
281
 
            this.opacity = z;
282
 
            return p
283
 
        }, fadeIn: function (x, w) {
284
 
            return p.fadeTo(1, x, w)
285
 
        }, fadeOut: function (x, w) {
286
 
            return p.fadeTo(0, x, w)
287
 
        }, getName: function () {
288
 
            return q
289
 
        }, getPlayer: function () {
290
 
            return r
291
 
        }, _fireEvent: function (x, w, y) {
292
 
            if (x == "onUpdate") {
293
 
                var A = r._api().fp_getPlugin(q);
294
 
                if (!A) {
295
 
                    return
296
 
                }
297
 
                j(p, A);
298
 
                delete p.methods;
299
 
                if (!v) {
300
 
                    n(A.methods, function () {
301
 
                        var C = "" + this;
302
 
                        p[C] = function () {
303
 
                            var D = [].slice.call(arguments);
304
 
                            var E = r._api().fp_invoke(q, C, D);
305
 
                            return E === "undefined" || E === undefined ? p : E
306
 
                        }
307
 
                    });
308
 
                    v = true
309
 
                }
310
 
            }
311
 
            var B = t[x];
312
 
            if (B) {
313
 
                var z = B.apply(p, w);
314
 
                if (x.slice(0, 1) == "_") {
315
 
                    delete t[x]
316
 
                }
317
 
                return z
318
 
            }
319
 
            return p
320
 
        }})
321
 
    };
322
 
 
323
 
    function b(r, H, u) {
324
 
        var x = this, w = null, E = false, v, t, G = [], z = {}, y = {}, F, s, q, D, p, B;
325
 
        j(x, {id: function () {
326
 
            return F
327
 
        }, isLoaded: function () {
328
 
            return(w !== null && w.fp_play !== undefined && !E)
329
 
        }, getParent: function () {
330
 
            return r
331
 
        }, hide: function (I) {
332
 
            if (I) {
333
 
                r.style.height = "0px"
334
 
            }
335
 
            if (x.isLoaded()) {
336
 
                w.style.height = "0px"
337
 
            }
338
 
            return x
339
 
        }, show: function () {
340
 
            r.style.height = B + "px";
341
 
            if (x.isLoaded()) {
342
 
                w.style.height = p + "px"
343
 
            }
344
 
            return x
345
 
        }, isHidden: function () {
346
 
            return x.isLoaded() && parseInt(w.style.height, 10) === 0
347
 
        }, load: function (K) {
348
 
            if (!x.isLoaded() && x._fireEvent("onBeforeLoad") !== false) {
349
 
                var I = function () {
350
 
                    if (v && !flashembed.isSupported(H.version)) {
351
 
                        r.innerHTML = ""
352
 
                    }
353
 
                    if (K) {
354
 
                        K.cached = true;
355
 
                        k(y, "onLoad", K)
356
 
                    }
357
 
                    flashembed(r, H, {config: u})
358
 
                };
359
 
                var J = 0;
360
 
                n(a, function () {
361
 
                    this.unload(function (L) {
362
 
                        if (++J == a.length) {
363
 
                            I()
364
 
                        }
365
 
                    })
366
 
                })
367
 
            }
368
 
            return x
369
 
        }, unload: function (K) {
370
 
            if (v.replace(/\s/g, "") !== "") {
371
 
                if (x._fireEvent("onBeforeUnload") === false) {
372
 
                    if (K) {
373
 
                        K(false)
374
 
                    }
375
 
                    return x
376
 
                }
377
 
                E = true;
378
 
                try {
379
 
                    if (w) {
380
 
                        if (w.fp_isFullscreen()) {
381
 
                            w.fp_toggleFullscreen()
382
 
                        }
383
 
                        w.fp_close();
384
 
                        x._fireEvent("onUnload")
385
 
                    }
386
 
                } catch (I) {
387
 
                }
388
 
                var J = function () {
389
 
                    w = null;
390
 
                    r.innerHTML = v;
391
 
                    E = false;
392
 
                    if (K) {
393
 
                        K(true)
394
 
                    }
395
 
                };
396
 
                if (/WebKit/i.test(navigator.userAgent) && !/Chrome/i.test(navigator.userAgent)) {
397
 
                    setTimeout(J, 0)
398
 
                } else {
399
 
                    J()
400
 
                }
401
 
            } else {
402
 
                if (K) {
403
 
                    K(false)
404
 
                }
405
 
            }
406
 
            return x
407
 
        }, getClip: function (I) {
408
 
            if (I === undefined) {
409
 
                I = D
410
 
            }
411
 
            return G[I]
412
 
        }, getCommonClip: function () {
413
 
            return t
414
 
        }, getPlaylist: function () {
415
 
            return G
416
 
        }, getPlugin: function (I) {
417
 
            var K = z[I];
418
 
            if (!K && x.isLoaded()) {
419
 
                var J = x._api().fp_getPlugin(I);
420
 
                if (J) {
421
 
                    K = new m(I, J, x);
422
 
                    z[I] = K
423
 
                }
424
 
            }
425
 
            return K
426
 
        }, getScreen: function () {
427
 
            return x.getPlugin("screen")
428
 
        }, getControls: function () {
429
 
            return x.getPlugin("controls")._fireEvent("onUpdate")
430
 
        }, getLogo: function () {
431
 
            try {
432
 
                return x.getPlugin("logo")._fireEvent("onUpdate")
433
 
            } catch (I) {
434
 
            }
435
 
        }, getPlay: function () {
436
 
            return x.getPlugin("play")._fireEvent("onUpdate")
437
 
        }, getConfig: function (I) {
438
 
            return I ? l(u) : u
439
 
        }, getFlashParams: function () {
440
 
            return H
441
 
        }, loadPlugin: function (L, K, N, M) {
442
 
            if (typeof N == "function") {
443
 
                M = N;
444
 
                N = {}
445
 
            }
446
 
            var J = M ? f() : "_";
447
 
            x._api().fp_loadPlugin(L, K, N, J);
448
 
            var I = {};
449
 
            I[J] = M;
450
 
            var O = new m(L, null, x, I);
451
 
            z[L] = O;
452
 
            return O
453
 
        }, getState: function () {
454
 
            return x.isLoaded() ? w.fp_getState() : -1
455
 
        }, play: function (J, I) {
456
 
            var K = function () {
457
 
                if (J !== undefined) {
458
 
                    x._api().fp_play(J, I)
459
 
                } else {
460
 
                    x._api().fp_play()
461
 
                }
462
 
            };
463
 
            if (x.isLoaded()) {
464
 
                K()
465
 
            } else {
466
 
                if (E) {
467
 
                    setTimeout(function () {
468
 
                        x.play(J, I)
469
 
                    }, 50)
470
 
                } else {
471
 
                    x.load(function () {
472
 
                        K()
473
 
                    })
474
 
                }
475
 
            }
476
 
            return x
477
 
        }, getVersion: function () {
478
 
            var J = "flowplayer.js 3.2.12";
479
 
            if (x.isLoaded()) {
480
 
                var I = w.fp_getVersion();
481
 
                I.push(J);
482
 
                return I
483
 
            }
484
 
            return J
485
 
        }, _api: function () {
486
 
            if (!x.isLoaded()) {
487
 
                throw"Flowplayer " + x.id() + " not loaded when calling an API method"
488
 
            }
489
 
            return w
490
 
        }, setClip: function (I) {
491
 
            n(I, function (J, K) {
492
 
                if (typeof K == "function") {
493
 
                    k(y, J, K);
494
 
                    delete I[J]
495
 
                } else {
496
 
                    if (J == "onCuepoint") {
497
 
                        $f(r).getCommonClip().onCuepoint(I[J][0], I[J][1])
498
 
                    }
499
 
                }
500
 
            });
501
 
            x.setPlaylist([I]);
502
 
            return x
503
 
        }, getIndex: function () {
504
 
            return q
505
 
        }, bufferAnimate: function (I) {
506
 
            w.fp_bufferAnimate(I === undefined || I);
507
 
            return x
508
 
        }, _swfHeight: function () {
509
 
            return w.clientHeight
510
 
        }});
511
 
        n(("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,ClipAdd,Fullscreen*,FullscreenExit,Error,MouseOver,MouseOut").split(","), function () {
512
 
            var I = "on" + this;
513
 
            if (I.indexOf("*") != -1) {
514
 
                I = I.slice(0, I.length - 1);
515
 
                var J = "onBefore" + I.slice(2);
516
 
                x[J] = function (K) {
517
 
                    k(y, J, K);
518
 
                    return x
519
 
                }
520
 
            }
521
 
            x[I] = function (K) {
522
 
                k(y, I, K);
523
 
                return x
524
 
            }
525
 
        });
526
 
        n(("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,toggleFullscreen,reset,close,setPlaylist,addClip,playFeed,setKeyboardShortcutsEnabled,isKeyboardShortcutsEnabled").split(","), function () {
527
 
            var I = this;
528
 
            x[I] = function (K, J) {
529
 
                if (!x.isLoaded()) {
530
 
                    return x
531
 
                }
532
 
                var L = null;
533
 
                if (K !== undefined && J !== undefined) {
534
 
                    L = w["fp_" + I](K, J)
535
 
                } else {
536
 
                    L = (K === undefined) ? w["fp_" + I]() : w["fp_" + I](K)
537
 
                }
538
 
                return L === "undefined" || L === undefined ? x : L
539
 
            }
540
 
        });
541
 
        x._fireEvent = function (R) {
542
 
            if (typeof R == "string") {
543
 
                R = [R]
544
 
            }
545
 
            var S = R[0], P = R[1], N = R[2], M = R[3], L = 0;
546
 
            if (u.debug) {
547
 
                h(R)
548
 
            }
549
 
            if (!x.isLoaded() && S == "onLoad" && P == "player") {
550
 
                w = w || c(s);
551
 
                p = x._swfHeight();
552
 
                n(G, function () {
553
 
                    this._fireEvent("onLoad")
554
 
                });
555
 
                n(z, function (T, U) {
556
 
                    U._fireEvent("onUpdate")
557
 
                });
558
 
                t._fireEvent("onLoad")
559
 
            }
560
 
            if (S == "onLoad" && P != "player") {
561
 
                return
562
 
            }
563
 
            if (S == "onError") {
564
 
                if (typeof P == "string" || (typeof P == "number" && typeof N == "number")) {
565
 
                    P = N;
566
 
                    N = M
567
 
                }
568
 
            }
569
 
            if (S == "onContextMenu") {
570
 
                n(u.contextMenu[P], function (T, U) {
571
 
                    U.call(x)
572
 
                });
573
 
                return
574
 
            }
575
 
            if (S == "onPluginEvent" || S == "onBeforePluginEvent") {
576
 
                var I = P.name || P;
577
 
                var J = z[I];
578
 
                if (J) {
579
 
                    J._fireEvent("onUpdate", P);
580
 
                    return J._fireEvent(N, R.slice(3))
581
 
                }
582
 
                return
583
 
            }
584
 
            if (S == "onPlaylistReplace") {
585
 
                G = [];
586
 
                var O = 0;
587
 
                n(P, function () {
588
 
                    G.push(new i(this, O++, x))
589
 
                })
590
 
            }
591
 
            if (S == "onClipAdd") {
592
 
                if (P.isInStream) {
593
 
                    return
594
 
                }
595
 
                P = new i(P, N, x);
596
 
                G.splice(N, 0, P);
597
 
                for (L = N + 1; L < G.length; L++) {
598
 
                    G[L].index++
599
 
                }
600
 
            }
601
 
            var Q = true;
602
 
            if (typeof P == "number" && P < G.length) {
603
 
                D = P;
604
 
                var K = G[P];
605
 
                if (K) {
606
 
                    Q = K._fireEvent(S, N, M)
607
 
                }
608
 
                if (!K || Q !== false) {
609
 
                    Q = t._fireEvent(S, N, M, K)
610
 
                }
611
 
            }
612
 
            n(y[S], function () {
613
 
                Q = this.call(x, P, N);
614
 
                if (this.cached) {
615
 
                    y[S].splice(L, 1)
616
 
                }
617
 
                if (Q === false) {
618
 
                    return false
619
 
                }
620
 
                L++
621
 
            });
622
 
            return Q
623
 
        };
624
 
        function C() {
625
 
            r.innerHTML=''; // Moodle hack - we do not want splashscreens, unfortunately there is not switch to disable them
626
 
            if ($f(r)) {
627
 
                $f(r).getParent().innerHTML = "";
628
 
                q = $f(r).getIndex();
629
 
                a[q] = x
630
 
            } else {
631
 
                a.push(x);
632
 
                q = a.length - 1
633
 
            }
634
 
            B = parseInt(r.style.height, 10) || r.clientHeight;
635
 
            F = r.id || "fp" + f();
636
 
            s = H.id || F + "_api";
637
 
            H.id = s;
638
 
            v = r.innerHTML;
639
 
            if (typeof u == "string") {
640
 
                u = {clip: {url: u}}
641
 
            }
642
 
            u.playerId = F;
643
 
            u.clip = u.clip || {};
644
 
            if (r.getAttribute("href", 2) && !u.clip.url) {
645
 
                u.clip.url = r.getAttribute("href", 2)
646
 
            }
647
 
            if (u.clip.url) {
648
 
                u.clip.url = e(u.clip.url)
649
 
            }
650
 
            t = new i(u.clip, -1, x);
651
 
            u.playlist = u.playlist || [u.clip];
652
 
            var J = 0;
653
 
            n(u.playlist, function () {
654
 
                var M = this;
655
 
                if (typeof M == "object" && M.length) {
656
 
                    M = {url: "" + M}
657
 
                }
658
 
                if (M.url) {
659
 
                    M.url = e(M.url)
660
 
                }
661
 
                n(u.clip, function (N, O) {
662
 
                    if (O !== undefined && M[N] === undefined && typeof O != "function") {
663
 
                        M[N] = O
664
 
                    }
665
 
                });
666
 
                u.playlist[J] = M;
667
 
                M = new i(M, J, x);
668
 
                G.push(M);
669
 
                J++
670
 
            });
671
 
            n(u, function (M, N) {
672
 
                if (typeof N == "function") {
673
 
                    if (t[M]) {
674
 
                        t[M](N)
675
 
                    } else {
676
 
                        k(y, M, N)
677
 
                    }
678
 
                    delete u[M]
679
 
                }
680
 
            });
681
 
            n(u.plugins, function (M, N) {
682
 
                if (N) {
683
 
                    z[M] = new m(M, N, x)
684
 
                }
685
 
            });
686
 
            if (!u.plugins || u.plugins.controls === undefined) {
687
 
                z.controls = new m("controls", null, x)
688
 
            }
689
 
            z.canvas = new m("canvas", null, x);
690
 
            v = r.innerHTML;
691
 
            function L(M) {
692
 
                if (/iPad|iPhone|iPod/i.test(navigator.userAgent) && !/.flv$/i.test(G[0].url) && !K()) {
693
 
                    return true
694
 
                }
695
 
                if (!x.isLoaded() && x._fireEvent("onBeforeClick") !== false) {
696
 
                    x.load()
697
 
                }
698
 
                return g(M)
699
 
            }
700
 
 
701
 
            function K() {
702
 
                return x.hasiPadSupport && x.hasiPadSupport()
703
 
            }
704
 
 
705
 
            function I() {
706
 
                if (v.replace(/\s/g, "") !== "") {
707
 
                    if (r.addEventListener) {
708
 
                        r.addEventListener("click", L, false)
709
 
                    } else {
710
 
                        if (r.attachEvent) {
711
 
                            r.attachEvent("onclick", L)
712
 
                        }
713
 
                    }
714
 
                } else {
715
 
                    if (r.addEventListener && !K()) {
716
 
                        r.addEventListener("click", g, false)
717
 
                    }
718
 
                    x.load()
719
 
                }
720
 
            }
721
 
 
722
 
            setTimeout(I, 0)
723
 
        }
724
 
 
725
 
        if (typeof r == "string") {
726
 
            var A = c(r);
727
 
            if (!A) {
728
 
                throw"Flowplayer cannot access element: " + r
729
 
            }
730
 
            r = A;
731
 
            C()
732
 
        } else {
733
 
            C()
734
 
        }
735
 
    }
736
 
 
737
 
    var a = [];
738
 
 
739
 
    function d(p) {
740
 
        this.length = p.length;
741
 
        this.each = function (r) {
742
 
            n(p, r)
743
 
        };
744
 
        this.size = function () {
745
 
            return p.length
746
 
        };
747
 
        var q = this;
748
 
        for (name in b.prototype) {
749
 
            q[name] = function () {
750
 
                var r = arguments;
751
 
                q.each(function () {
752
 
                    this[name].apply(this, r)
753
 
                })
754
 
            }
755
 
        }
756
 
    }
757
 
 
758
 
    window.flowplayer = window.$f = function () {
759
 
        var q = null;
760
 
        var p = arguments[0];
761
 
        if(!flashembed.isSupported([6, 65])){return null;} // Moodle hack - we do not want the missing flash hints - we need the original links for accessibility and incompatible browsers
762
 
        if (!arguments.length) {
763
 
            n(a, function () {
764
 
                if (this.isLoaded()) {
765
 
                    q = this;
766
 
                    return false
767
 
                }
768
 
            });
769
 
            return q || a[0]
770
 
        }
771
 
        if (arguments.length == 1) {
772
 
            if (typeof p == "number") {
773
 
                return a[p]
774
 
            } else {
775
 
                if (p == "*") {
776
 
                    return new d(a)
777
 
                }
778
 
                n(a, function () {
779
 
                    if (this.id() == p.id || this.id() == p || this.getParent() == p) {
780
 
                        q = this;
781
 
                        return false
782
 
                    }
783
 
                });
784
 
                return q
785
 
            }
786
 
        }
787
 
        if (arguments.length > 1) {
788
 
            var u = arguments[1], r = (arguments.length == 3) ? arguments[2] : {};
789
 
            if (typeof u == "string") {
790
 
                u = {src: u}
791
 
            }
792
 
            u = j({bgcolor: "#000000", version: [10, 1], expressInstall: "http://releases.flowplayer.org/swf/expressinstall.swf", cachebusting: false}, u);
793
 
            if (typeof p == "string") {
794
 
                if (p.indexOf(".") != -1) {
795
 
                    var t = [];
796
 
                    n(o(p), function () {
797
 
                        t.push(new b(this, l(u), l(r)))
798
 
                    });
799
 
                    return new d(t)
800
 
                } else {
801
 
                    var s = c(p);
802
 
                    return new b(s !== null ? s : l(p), l(u), l(r))
803
 
                }
804
 
            } else {
805
 
                if (p) {
806
 
                    return new b(p, l(u), l(r))
807
 
                }
808
 
            }
809
 
        }
810
 
        return null
811
 
    };
812
 
    j(window.$f, {fireEvent: function () {
813
 
        var q = [].slice.call(arguments);
814
 
        var r = $f(q[0]);
815
 
        return r ? r._fireEvent(q.slice(1)) : null
816
 
    }, addPlugin: function (p, q) {
817
 
        b.prototype[p] = q;
818
 
        return $f
819
 
    }, each: n, extend: j});
820
 
    if (typeof jQuery == "function") {
821
 
        jQuery.fn.flowplayer = function (r, q) {
822
 
            if (!arguments.length || typeof arguments[0] == "number") {
823
 
                var p = [];
824
 
                this.each(function () {
825
 
                    var s = $f(this);
826
 
                    if (s) {
827
 
                        p.push(s)
828
 
                    }
829
 
                });
830
 
                return arguments.length ? p[arguments[0]] : new d(p)
831
 
            }
832
 
            return this.each(function () {
833
 
                $f(this, l(r), q ? l(q) : {})
834
 
            })
835
 
        }
836
 
    }
837
 
}();
838
 
!function () {
839
 
    var h = document.all, j = "http://get.adobe.com/flashplayer", c = typeof jQuery == "function", e = /(\d+)[^\d]+(\d+)[^\d]*(\d*)/, b = {width: "100%", height: "100%", id: "_" + ("" + Math.random()).slice(9), allowfullscreen: true, allowscriptaccess: "always", quality: "high", version: [3, 0], onFail: null, expressInstall: null, w3c: false, cachebusting: false};
840
 
    if (window.attachEvent) {
841
 
        window.attachEvent("onbeforeunload", function () {
842
 
            __flash_unloadHandler = function () {
843
 
            };
844
 
            __flash_savedUnloadHandler = function () {
845
 
            }
846
 
        })
847
 
    }
848
 
    function i(m, l) {
849
 
        if (l) {
850
 
            for (var f in l) {
851
 
                if (l.hasOwnProperty(f)) {
852
 
                    m[f] = l[f]
853
 
                }
854
 
            }
855
 
        }
856
 
        return m
857
 
    }
858
 
 
859
 
    function a(f, n) {
860
 
        var m = [];
861
 
        for (var l in f) {
862
 
            if (f.hasOwnProperty(l)) {
863
 
                m[l] = n(f[l])
864
 
            }
865
 
        }
866
 
        return m
867
 
    }
868
 
 
869
 
    window.flashembed = function (f, m, l) {
870
 
        if (typeof f == "string") {
871
 
            f = document.getElementById(f.replace("#", ""))
872
 
        }
873
 
        if (!f) {
874
 
            return
875
 
        }
876
 
        if (typeof m == "string") {
877
 
            m = {src: m}
878
 
        }
879
 
        return new d(f, i(i({}, b), m), l)
880
 
    };
881
 
    var g = i(window.flashembed, {conf: b, getVersion: function () {
882
 
        var m, f;
883
 
        try {
884
 
            f = navigator.plugins["Shockwave Flash"].description.slice(16)
885
 
        } catch (o) {
886
 
            try {
887
 
                m = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
888
 
                f = m && m.GetVariable("$version")
889
 
            } catch (n) {
890
 
                try {
891
 
                    m = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
892
 
                    f = m && m.GetVariable("$version")
893
 
                } catch (l) {
894
 
                }
895
 
            }
896
 
        }
897
 
        f = e.exec(f);
898
 
        return f ? [1 * f[1], 1 * f[(f[1] * 1 > 9 ? 2 : 3)] * 1] : [0, 0]
899
 
    }, asString: function (l) {
900
 
        if (l === null || l === undefined) {
901
 
            return null
902
 
        }
903
 
        var f = typeof l;
904
 
        if (f == "object" && l.push) {
905
 
            f = "array"
906
 
        }
907
 
        switch (f) {
908
 
            case"string":
909
 
                l = l.replace(new RegExp('(["\\\\])', "g"), "\\$1");
910
 
                l = l.replace(/^\s?(\d+\.?\d*)%/, "$1pct");
911
 
                return'"' + l + '"';
912
 
            case"array":
913
 
                return"[" + a(l,function (o) {
914
 
                    return g.asString(o)
915
 
                }).join(",") + "]";
916
 
            case"function":
917
 
                return'"function()"';
918
 
            case"object":
919
 
                var m = [];
920
 
                for (var n in l) {
921
 
                    if (l.hasOwnProperty(n)) {
922
 
                        m.push('"' + n + '":' + g.asString(l[n]))
923
 
                    }
924
 
                }
925
 
                return"{" + m.join(",") + "}"
926
 
        }
927
 
        return String(l).replace(/\s/g, " ").replace(/\'/g, '"')
928
 
    }, getHTML: function (o, l) {
929
 
        o = i({}, o);
930
 
        var n = '<object width="' + o.width + '" height="' + o.height + '" id="' + o.id + '" name="' + o.id + '"';
931
 
        if (o.cachebusting) {
932
 
            o.src += ((o.src.indexOf("?") != -1 ? "&" : "?") + Math.random())
933
 
        }
934
 
        if (o.w3c || !h) {
935
 
            n += ' data="' + o.src + '" type="application/x-shockwave-flash"'
936
 
        } else {
937
 
            n += ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
938
 
        }
939
 
        n += ">";
940
 
        if (o.w3c || h) {
941
 
            n += '<param name="movie" value="' + o.src + '" />'
942
 
        }
943
 
        o.width = o.height = o.id = o.w3c = o.src = null;
944
 
        o.onFail = o.version = o.expressInstall = null;
945
 
        for (var m in o) {
946
 
            if (o[m]) {
947
 
                n += '<param name="' + m + '" value="' + o[m] + '" />'
948
 
            }
949
 
        }
950
 
        var p = "";
951
 
        if (l) {
952
 
            for (var f in l) {
953
 
                if (l[f]) {
954
 
                    var q = l[f];
955
 
                    p += f + "=" + (/function|object/.test(typeof q) ? g.asString(q) : q) + "&"
956
 
                }
957
 
            }
958
 
            p = p.slice(0, -1);
959
 
            n += '<param name="flashvars" value=\'' + p + "' />"
960
 
        }
961
 
        n += "</object>";
962
 
        return n
963
 
    }, isSupported: function (f) {
964
 
        return k[0] > f[0] || k[0] == f[0] && k[1] >= f[1]
965
 
    }});
966
 
    var k = g.getVersion();
967
 
 
968
 
    function d(f, n, m) {
969
 
        if (g.isSupported(n.version)) {
970
 
            f.innerHTML = g.getHTML(n, m)
971
 
        } else {
972
 
            if (n.expressInstall && g.isSupported([6, 65])) {
973
 
                f.innerHTML = g.getHTML(i(n, {src: n.expressInstall}), {MMredirectURL: encodeURIComponent(location.href), MMplayerType: "PlugIn", MMdoctitle: document.title})
974
 
            } else {
975
 
                if (!f.innerHTML.replace(/\s/g, "")) {
976
 
                    f.innerHTML = "<h2>Flash version " + n.version + " or greater is required</h2><h3>" + (k[0] > 0 ? "Your version is " + k : "You have no flash plugin installed") + "</h3>" + (f.tagName == "A" ? "<p>Click here to download latest version</p>" : "<p>Download latest version from <a href='" + j + "'>here</a></p>");
977
 
                    if (f.tagName == "A" || f.tagName == "DIV") {
978
 
                        f.onclick = function () {
979
 
                            location.href = j
980
 
                        }
981
 
                    }
982
 
                }
983
 
                if (n.onFail) {
984
 
                    var l = n.onFail.call(this);
985
 
                    if (typeof l == "string") {
986
 
                        f.innerHTML = l
987
 
                    }
988
 
                }
989
 
            }
990
 
        }
991
 
        if (h) {
992
 
            window[n.id] = document.getElementById(n.id)
993
 
        }
994
 
        i(this, {getRoot: function () {
995
 
            return f
996
 
        }, getOptions: function () {
997
 
            return n
998
 
        }, getConf: function () {
999
 
            return m
1000
 
        }, getApi: function () {
1001
 
            return f.firstChild
1002
 
        }})
1003
 
    }
1004
 
 
1005
 
    if (c) {
1006
 
        jQuery.tools = jQuery.tools || {version: "3.2.12"};
1007
 
        jQuery.tools.flashembed = {conf: b};
1008
 
        jQuery.fn.flashembed = function (l, f) {
1009
 
            return this.each(function () {
1010
 
                $(this).data("flashembed", flashembed(this, l, f))
1011
 
            })
1012
 
        }
1013
 
    }
1014
 
}();
 
 
b'\\ No newline at end of file'