| author | hamidouk |
| Mon, 30 Jan 2012 12:30:11 +0100 | |
| branch | tmp-paths-runtime |
| changeset 742 | c0adb6674be0 |
| parent 738 | ccd571853e98 |
| permissions | -rw-r--r-- |
|
742
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
1 |
/* site.js - all our site-dependent config : player chrome, cdn locations, etc... |
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
2 |
to implement the metadataplayer on your website, you'll have to define a couple |
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
3 |
global variables : |
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
4 |
|
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
5 |
IriSP__libdir is the directory containing our js libs. |
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
6 |
IriSP__platform url is the url of teh platform |
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
7 |
IriSP__player_imgs url from which the player can get the images defined in the css |
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
8 |
IriSP__jwplayer_swf_path the path to the jwplayer swf. |
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
9 |
|
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
10 |
We have to do it this way because it's no longer feasible |
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
11 |
to configure the mdp at compile-time and then overwrite the |
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
12 |
defaults. |
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
13 |
*/ |
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
14 |
|
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
15 |
if (IriSP.null_or_undefined(IriSP__libdir)) {
|
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
16 |
IriSP.libdir = function() { return "/mdp/src/js/libs/" };
|
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
17 |
} else {
|
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
18 |
IriSP.libdir = function() { return IriSP__libdir };
|
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
19 |
} |
| 681 | 20 |
|
|
742
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
21 |
if (IriSP.null_or_undefined(IriSP__platform_url)) {
|
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
22 |
IriSP.platform_url = function() { return "http://localhost/pf"; };
|
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
23 |
} else {
|
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
24 |
IriSP.platform_url = function() { return IriSP__platform_url };
|
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
25 |
} |
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
26 |
|
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
27 |
if (IriSP.null_or_undefined(IriSP__jwplayer_swf_path)) {
|
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
28 |
IriSP._jwplayer_swf_path = function() { return "/mdp/test/libs/player.swf"; };
|
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
29 |
} else {
|
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
30 |
IriSP._jwplayer_swf_path = function() { return IriSP__jwplayer_swf_path };
|
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
31 |
} |
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
32 |
|
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
33 |
// the rest of the code doesn't need to know that the path is computed at |
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
34 |
// run time. |
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
35 |
IriSP.jwplayer_swf_path = IriSP._jwplayer_swf_path(); |
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
36 |
|
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
37 |
if (IriSP.null_or_undefined(IriSP__player_imgs)) {
|
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
38 |
IriSP._player_imgs = function() { return "/mdp/src/css/imgs"; };
|
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
39 |
} else {
|
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
40 |
IriSP._player_imgs = function() { return IriSP__player_imgs };
|
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
41 |
} |
| 681 | 42 |
|
43 |
IriSP.lib = {
|
|
44 |
jQuery : "http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.js", |
|
45 |
jQueryUI : "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/jquery-ui.js", |
|
46 |
jQueryToolTip : "http://cdn.jquerytools.org/1.2.4/all/jquery.tools.min.js", |
|
47 |
swfObject : "http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js", |
|
48 |
cssjQueryUI : "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.4/themes/base/jquery-ui.css", |
|
|
742
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
49 |
popcorn : IriSP.libdir() + "popcorn.js", |
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
50 |
jwplayer : IriSP.libdir() + "jwplayer.js", |
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
51 |
popcornReplacement: IriSP.libdir() + "pop.js", |
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
52 |
raphael: IriSP.libdir() + "raphael.js", |
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
53 |
jquery_sparkline: IriSP.libdir() + "jquery.sparkline.js", |
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
54 |
"popcorn.mediafragment" : IriSP.libdir() + "popcorn.mediafragment.js", |
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
55 |
"popcorn.code" : IriSP.libdir() + "popcorn.code.js", |
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
56 |
"popcorn.jwplayer": IriSP.libdir() + "popcorn.jwplayer.js", |
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
57 |
"popcorn.youtube": IriSP.libdir() + "popcorn.youtube.js" |
| 681 | 58 |
}; |
59 |
||
60 |
//Configuration for the player and utility functions. |
|
61 |
IriSP.config = {};
|
|
62 |
||
63 |
IriSP.config.shortener = {
|
|
64 |
// function to call to shorten an url. |
|
65 |
//shortening_function : IriSP.platform_shorten_url |
|
66 |
}; |
|
67 |
||
68 |
IriSP.widgetsDefaults = {
|
|
69 |
"LayoutManager" : {spacer_div_height : "0px" },
|
|
70 |
"PlayerWidget" : {},
|
|
71 |
"AnnotationsWidget": {
|
|
72 |
"share_text" : "I'm watching ", |
|
73 |
"fb_link" : "http://www.facebook.com/share.php?u=", |
|
74 |
"tw_link" : "http://twitter.com/home?status=", |
|
75 |
"gplus_link" : "" |
|
76 |
}, |
|
77 |
"TweetsWidget" : {
|
|
78 |
default_profile_picture : "https://si0.twimg.com/sticky/default_profile_images/default_profile_1_normal.png", |
|
79 |
tweet_display_period: 10000, // how long do we show a tweet ? |
|
80 |
||
81 |
}, |
|
82 |
"SliderWidget" : {
|
|
83 |
minimize_period: 850 // how long does the slider stays maximized after the user leaves the zone ? |
|
84 |
}, |
|
85 |
"createAnnotationWidget" : {
|
|
86 |
keywords: ["#faux-raccord", "#mot-clef"], |
|
| 738 | 87 |
polemic_mode: true, /* enable polemics ? */ |
|
742
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
88 |
polemics: {"++" : "positive", "--" : "negative", "==" : "reference", "??" : "question"},
|
| 681 | 89 |
cinecast_version: true /* put to false to enable the platform version, true for the festival cinecast one. */ |
90 |
}, |
|
91 |
"SparklineWidget" : {
|
|
92 |
column_width: 10 // the width of a column in pixels. |
|
93 |
}, |
|
94 |
"Main" : {
|
|
95 |
autoplay: true |
|
96 |
}, |
|
97 |
"AnnotationsListWidget" : {
|
|
98 |
ajax_mode: true, /* use ajax to get information about the annotations. |
|
99 |
if set to false, only search in the annotations for the |
|
100 |
current project. */ |
|
|
742
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
101 |
ajax_url: IriSP.platform_url() + "ldtplatform/api/ldt/segments/", /* partial |
| 681 | 102 |
url of |
103 |
where to |
|
104 |
get the |
|
105 |
ajax */ |
|
| 738 | 106 |
ajax_granularity: 10000, /* how much ms should we look before and after the |
| 681 | 107 |
current timecode */ |
|
742
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
108 |
|
|
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
109 |
project_url: IriSP.platform_url() + "/ldtplatform/ldt/front/player/" /* the beginning |
| 718 | 110 |
of a link to the |
111 |
new front */ |
|
| 681 | 112 |
}, |
113 |
}; |
|
114 |
||
115 |
IriSP.paths = {
|
|
116 |
// "imgs": "/tweetlive/res/metadataplayer/src/css/imgs" |
|
|
742
c0adb6674be0
determine paths at runtime instead of at compile time
hamidouk
parents:
738
diff
changeset
|
117 |
"imgs": IriSP._player_imgs; |
| 681 | 118 |
}; |
119 |
IriSP.default_templates_vars = {
|
|
120 |
"img_dir" : IriSP.paths.imgs |
|
121 |
}; |
|
122 |