| author | hamidouk |
| Wed, 21 Dec 2011 15:01:44 +0100 | |
| branch | lab-port |
| changeset 498 | cf2a0505cadc |
| parent 453 | 8568e47379a2 |
| child 501 | 63e7b66d2a80 |
| 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 |
|
|
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
3 |
if ( window.IriSP === undefined && window.__IriSP === undefined ) { |
|
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
4 |
var IriSP = {}; |
|
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
5 |
var __IriSP = IriSP; /* for backward compatibility */ |
|
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
6 |
} |
|
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
7 |
|
| 498 | 8 |
IriSP.loadLibs = function( libs, config, metadata_url, callback ) { |
9 |
// Localize jQuery variable |
|
|
358
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
10 |
IriSP.jQuery = null; |
| 498 | 11 |
var $L = $LAB.script(libs.jQuery).script(libs.swfObject) |
12 |
.script(libs.jQueryUI) |
|
13 |
|
|
14 |
if (config.player.type === "jwplayer") { |
|
15 |
// load our popcorn.js lookalike |
|
16 |
$L = $L.script(libs.jwplayer); |
|
17 |
} else { |
|
18 |
// load the real popcorn |
|
19 |
$L = $L.script(libs.popcorn).script(libs["popcorn.code"]); |
|
20 |
if (config.player === "youtube") |
|
21 |
$L = $L.script(libs["popcorn.youtube"]); |
|
22 |
if (config.player === "vimeo") |
|
23 |
$L = $L.script(libs["popcorn.vimeo"]); |
|
24 |
|
|
25 |
/* do nothing for html5 */ |
|
26 |
} |
|
27 |
|
|
28 |
/* widget specific requirements */ |
|
29 |
for (var idx in config.gui.widgets) { |
|
30 |
if (config.gui.widgets[idx].type === "PolemicWidget") { |
|
31 |
$L.script(libs.raphael); |
|
32 |
} |
|
33 |
} |
|
34 |
|
|
35 |
// same for modules |
|
36 |
/* |
|
37 |
for (var idx in config.modules) { |
|
38 |
if (config.modules[idx].type === "PolemicWidget") |
|
39 |
$L.script(libs.raphaelJs); |
|
40 |
} |
|
41 |
*/ |
|
|
358
430c1a7a09de
got rid of useless LdtPlayer.js -moved the necessary lines of code in main.js
hamidouk
parents:
diff
changeset
|
42 |
|
| 498 | 43 |
$L.wait(function() { |
44 |
IriSP.jQuery = window.jQuery.noConflict( true ); |
|
45 |
|
|
46 |
var css_link_jquery = IriSP.jQuery( "<link>", { |
|
47 |
rel: "stylesheet", |
|
48 |
type: "text/css", |
|
49 |
href: libs.cssjQueryUI, |
|
50 |
'class': "dynamic_css" |
|
51 |
} ); |
|
52 |
var css_link_custom = IriSP.jQuery( "<link>", { |
|
53 |
rel: "stylesheet", |
|
54 |
type: "text/css", |
|
55 |
href: config.gui.css, |
|
56 |
'class': "dynamic_css" |
|
57 |
} ); |
|
58 |
|
|
59 |
css_link_jquery.appendTo('head'); |
|
60 |
css_link_custom.appendTo('head'); |
|
61 |
|
|
62 |
IriSP.setupDataLoader(); |
|
63 |
IriSP.__dataloader.get(metadata_url, |
|
64 |
function(data) { |
|
65 |
/* save the data so that we could re-use it to |
|
66 |
configure the video |
|
67 |
*/ |
|
68 |
IriSP.__jsonMetadata = data; |
|
69 |
callback.call(window) }); |
|
70 |
}); |
|
71 |
}; |