| author | hamidouk |
| Tue, 03 Jan 2012 16:19:24 +0100 | |
| branch | popcorn-port |
| changeset 574 | 5770c64e2ec6 |
| parent 572 | 5597a15fe9d0 |
| child 662 | 5e10069c5c21 |
| permissions | -rw-r--r-- |
|
358
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
1 |
/* main file */ |
|
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
2 |
|
|
520
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
511
diff
changeset
|
3 |
|
|
358
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
4 |
if ( window.IriSP === undefined && window.__IriSP === undefined ) { |
|
520
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
511
diff
changeset
|
5 |
/** |
| 531 | 6 |
@class |
7 |
the object under which everything goes. |
|
|
520
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
511
diff
changeset
|
8 |
*/ |
| 531 | 9 |
IriSP = {}; |
10 |
|
|
11 |
/** Alias to IriSP for backward compatibility */ |
|
12 |
__IriSP = IriSP; |
|
|
358
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
13 |
} |
|
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
14 |
|
| 498 | 15 |
IriSP.loadLibs = function( libs, config, metadata_url, callback ) { |
16 |
// Localize jQuery variable |
|
|
358
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
17 |
IriSP.jQuery = null; |
| 574 | 18 |
var $L = $LAB.script(libs.jQuery).script(libs.swfObject).wait() |
19 |
.script(libs.jQueryUI); |
|
| 498 | 20 |
|
21 |
if (config.player.type === "jwplayer") { |
|
22 |
// load our popcorn.js lookalike |
|
23 |
$L = $L.script(libs.jwplayer); |
|
24 |
} else { |
|
25 |
// load the real popcorn |
|
26 |
$L = $L.script(libs.popcorn).script(libs["popcorn.code"]); |
|
| 501 | 27 |
if (config.player.type === "youtube") { |
| 498 | 28 |
$L = $L.script(libs["popcorn.youtube"]); |
| 501 | 29 |
} |
30 |
if (config.player.type === "vimeo") |
|
| 498 | 31 |
$L = $L.script(libs["popcorn.vimeo"]); |
32 |
|
|
33 |
/* do nothing for html5 */ |
|
34 |
} |
|
35 |
|
|
36 |
/* widget specific requirements */ |
|
37 |
for (var idx in config.gui.widgets) { |
|
38 |
if (config.gui.widgets[idx].type === "PolemicWidget") { |
|
39 |
$L.script(libs.raphael); |
|
40 |
} |
|
| 523 | 41 |
|
42 |
if (config.gui.widgets[idx].type === "SparklineWidget") { |
|
43 |
$L.script(libs.jquery_sparkline); |
|
44 |
} |
|
| 498 | 45 |
} |
46 |
|
|
47 |
// same for modules |
|
48 |
/* |
|
49 |
for (var idx in config.modules) { |
|
50 |
if (config.modules[idx].type === "PolemicWidget") |
|
51 |
$L.script(libs.raphaelJs); |
|
52 |
} |
|
53 |
*/ |
|
|
358
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
54 |
|
| 498 | 55 |
$L.wait(function() { |
56 |
IriSP.jQuery = window.jQuery.noConflict( true ); |
|
| 511 | 57 |
IriSP._ = window._.noConflict(); |
58 |
IriSP.underscore = IriSP._; |
|
| 498 | 59 |
|
60 |
var css_link_jquery = IriSP.jQuery( "<link>", { |
|
61 |
rel: "stylesheet", |
|
62 |
type: "text/css", |
|
63 |
href: libs.cssjQueryUI, |
|
64 |
'class': "dynamic_css" |
|
65 |
} ); |
|
66 |
var css_link_custom = IriSP.jQuery( "<link>", { |
|
67 |
rel: "stylesheet", |
|
68 |
type: "text/css", |
|
69 |
href: config.gui.css, |
|
70 |
'class': "dynamic_css" |
|
71 |
} ); |
|
72 |
|
|
73 |
css_link_jquery.appendTo('head'); |
|
74 |
css_link_custom.appendTo('head'); |
|
75 |
|
|
76 |
IriSP.setupDataLoader(); |
|
77 |
IriSP.__dataloader.get(metadata_url, |
|
78 |
function(data) { |
|
79 |
/* save the data so that we could re-use it to |
|
80 |
configure the video |
|
81 |
*/ |
|
82 |
IriSP.__jsonMetadata = data; |
|
83 |
callback.call(window) }); |
|
84 |
}); |
|
85 |
}; |