forked from webmademovies/popcorn-js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
popcorn.unit.setup.js
58 lines (43 loc) · 1.28 KB
/
popcorn.unit.setup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
if ( !window[ "console" ] ) {
jQuery.getScript( "https://getfirebug.com/firebug-lite-debug.js" );
}
(function( global ) {
// Store the number of global properties that exist prior to Popcorn API definition
var Setup = {
hasRun: false,
globalSize: 0,
globalCache: [],
globalDiff: []
};
Setup.getGlobalSize = function() {
var size = 0, prop;
for ( prop in window ) {
if ( prop !== "_firebug" ) {
size++;
if ( !Setup.hasRun ) {
Setup.globalCache.push( prop );
} else {
if ( Setup.globalCache.indexOf( prop ) === -1 ) {
Setup.globalDiff.push( prop );
}
}
}
}
// account for self
size++;
// Store the number of global properties internally
if ( !Setup.globalSize ) {
Setup.globalSize = size;
}
if ( !Setup.hasRun ) {
Setup.hasRun = true;
}
return size;
};
Setup.eventset = "loadstart progress suspend emptied stalled play pause " +
"loadedmetadata loadeddata waiting playing canplay canplaythrough " +
"seeking seeked timeupdate ended ratechange durationchange volumechange";
Setup.events = Setup.eventset.split(/\s+/g);
global.Setup = Setup;
})( window );
Setup.getGlobalSize();