46 <p style="text-align: right;">© IRI 2012</p> |
46 <p style="text-align: right;">© IRI 2012</p> |
47 </div> |
47 </div> |
48 </div> |
48 </div> |
49 <script type="text/javascript"> |
49 <script type="text/javascript"> |
50 |
50 |
|
51 function url_transform_func(_url){ |
|
52 //_url = "rtmp://media.iri.centrepompidou.fr/ddc_player/mp4:video/ldtplatform/rsln_clay_shirky"; |
|
53 // We change the streamer if needed |
|
54 var _transformed = _url.replace(/^rtmp:\/\/media.iri.centrepompidou.fr\/ddc_player\/(mp4:)?video\//i,"http://media.iri.centrepompidou.fr/video/"); |
|
55 // Get the file name (= remove extension if necessary) |
|
56 ext = _transformed.substr(_transformed.lastIndexOf('.')+1).toLowerCase(); |
|
57 if(ext=="mp4" || ext=="f4v" || ext=="flv" || ext=="mov" || ext=="webm" || ext=="mpg4" || ext=="ogv" || ext=="ogg" || ext=="avi"){ |
|
58 _transformed = _transformed.substr(0, _transformed.lastIndexOf('.')); |
|
59 } |
|
60 // now that the file name is clean, we add all the extension and mimetype |
|
61 srcTypeArray = [ |
|
62 {src:_transformed+".mp4", type:"video/mp4"}, |
|
63 {src:_transformed+".ogv", type:"video/ogg"}, |
|
64 {src:_transformed+".webm", type:"video/webm"} |
|
65 ]; |
|
66 console.log("_transformed = " + srcTypeArray[0]["src"]); |
|
67 return srcTypeArray; |
|
68 } |
|
69 |
|
70 |
51 IriSP.libFiles.defaultDir = "../libs/"; |
71 IriSP.libFiles.defaultDir = "../libs/"; |
52 IriSP.widgetsDir = "../metadataplayer"; |
72 IriSP.widgetsDir = "../metadataplayer"; |
53 IriSP.language = 'fr'; |
73 IriSP.language = 'fr'; |
54 var _metadata = { |
74 var _metadata = { |
55 // url: 'bab_files/mashup.json', |
75 url: 'bab_files/mashup.json', |
56 // url: 'http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/cljson/id/b2754186-a0c9-11e0-b8bd-00145ea49a02?callback=?', |
76 // url: 'http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/cljson/id/b2754186-a0c9-11e0-b8bd-00145ea49a02?callback=?', |
57 url: 'http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/cljson/id/5afd8bbe-9b75-11e1-9e5d-00145ea4a2be?callback=?', |
77 // url: 'http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/cljson/id/5afd8bbe-9b75-11e1-9e5d-00145ea4a2be?callback=?', |
|
78 // url: 'http://localhost/pf/ldtplatform/ldt/mashupbytag/?tag=projection', |
|
79 // url: 'http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/mashupbytag/?tag=mashuptag&callback=?', |
|
80 // url: 'http://localhost/pf/ldtplatform/ldt/mashupbytag/?tag=mashuptag&in=240000&out=1860000', |
58 format: 'ldt' |
81 format: 'ldt' |
59 }; |
82 }; |
60 var _canPlayMp4 = document.createElement('video').canPlayType('video/mp4'); |
|
61 var _config = { |
83 var _config = { |
62 gui: { |
84 width : 630, |
63 width : 630, |
85 container : 'LdtPlayer', |
64 container : 'LdtPlayer', |
86 default_options: { |
65 default_options: { |
87 metadata: _metadata |
66 metadata: _metadata |
88 }, |
|
89 css : '../metadataplayer/LdtPlayer-core.css', |
|
90 widgets: [ |
|
91 { |
|
92 type: "MashupPlayer", |
|
93 url_transform: url_transform_func |
67 }, |
94 }, |
68 css : '../metadataplayer/LdtPlayer-core.css', |
95 { type: "Slider" }, |
69 widgets: [ |
96 { type: "Controller" }, |
70 { type: "Slider" }, |
97 { |
71 { type: "Controller" }, |
98 type: "Segments", |
72 { |
99 annotation_type: false |
73 type: "Segments", |
|
74 annotation_type: false |
|
75 }, |
|
76 { type: "Arrow" }, |
|
77 { |
|
78 type: "Annotation", |
|
79 annotation_type: false |
|
80 }, |
|
81 { |
|
82 type: "Tagger", |
|
83 api_endpoint: "../post-test.php", |
|
84 tags: ["actif","amour","bonheur","captif","charité","désir","dieu","doute","famille","idéal","internationale","passif","patrie","peur","politique","président","spleen","travail"] |
|
85 }, |
|
86 { |
|
87 type: "MediaList", |
|
88 container: "mediaList" |
|
89 }, |
|
90 { |
|
91 type: "AnnotationsList", |
|
92 container: "annotationList", |
|
93 //ajax_url: "http://ldt.iri.centrepompidou.fr/ldtplatform/api/ldt/segments/{{media}}/{{begin}}/{{end}}?callback=?", |
|
94 //ajax_granularity: 30000, |
|
95 //limit_count: 3 |
|
96 }, |
|
97 { type: "Mediafragment" } |
|
98 ] |
|
99 }, |
|
100 player:{ |
|
101 type:'mashup-html', |
|
102 url_transform: function(_url) { |
|
103 var _transformed = _url.replace(/^rtmp:\/\/media.iri.centrepompidou.fr\/ddc_player\/(mp4:)?video\//i,"http://media.iri.centrepompidou.fr/video/"); |
|
104 if (!/\.mp4$/.test(_transformed)) { |
|
105 _transformed += '.mp4'; |
|
106 } |
|
107 if (_canPlayMp4 == "") { |
|
108 _transformed = _transformed.replace(/\.mp4$/i,'.ogv'); |
|
109 } |
|
110 return _transformed; |
|
111 }, |
100 }, |
112 height: 350, |
101 { |
113 width: 630, |
102 type: "Annotation", |
114 metadata: _metadata |
103 annotation_type: false |
115 } |
104 }, |
|
105 { |
|
106 type: "Tagger", |
|
107 api_endpoint: "../post-test.php", |
|
108 tags: ["actif","amour","bonheur","captif","charité","désir","dieu","doute","famille","idéal","internationale","passif","patrie","peur","politique","président","spleen","travail"] |
|
109 }, |
|
110 { |
|
111 type: "MediaList", |
|
112 container: "mediaList" |
|
113 }, |
|
114 { |
|
115 type: "AnnotationsList", |
|
116 container: "annotationList", |
|
117 //ajax_url: "http://ldt.iri.centrepompidou.fr/ldtplatform/api/ldt/segments/{{media}}/{{begin}}/{{end}}?callback=?", |
|
118 //ajax_granularity: 30000, |
|
119 //limit_count: 3 |
|
120 }, |
|
121 { type: "Mediafragment" } |
|
122 ] |
116 }; |
123 }; |
117 |
124 |
118 _myPlayer = new IriSP.Metadataplayer(_config); |
125 _myPlayer = new IriSP.Metadataplayer(_config); |
119 |
126 |
120 </script> |
127 </script> |