--- a/metadataplayer/mashup/player-html.htm Fri Aug 31 17:43:31 2012 +0200
+++ b/metadataplayer/mashup/player-html.htm Thu Sep 27 12:23:41 2012 +0200
@@ -48,71 +48,78 @@
</div>
<script type="text/javascript">
+function url_transform_func(_url){
+ //_url = "rtmp://media.iri.centrepompidou.fr/ddc_player/mp4:video/ldtplatform/rsln_clay_shirky";
+ // We change the streamer if needed
+ var _transformed = _url.replace(/^rtmp:\/\/media.iri.centrepompidou.fr\/ddc_player\/(mp4:)?video\//i,"http://media.iri.centrepompidou.fr/video/");
+ // Get the file name (= remove extension if necessary)
+ ext = _transformed.substr(_transformed.lastIndexOf('.')+1).toLowerCase();
+ if(ext=="mp4" || ext=="f4v" || ext=="flv" || ext=="mov" || ext=="webm" || ext=="mpg4" || ext=="ogv" || ext=="ogg" || ext=="avi"){
+ _transformed = _transformed.substr(0, _transformed.lastIndexOf('.'));
+ }
+ // now that the file name is clean, we add all the extension and mimetype
+ srcTypeArray = [
+ {src:_transformed+".mp4", type:"video/mp4"},
+ {src:_transformed+".ogv", type:"video/ogg"},
+ {src:_transformed+".webm", type:"video/webm"}
+ ];
+ console.log("_transformed = " + srcTypeArray[0]["src"]);
+ return srcTypeArray;
+}
+
+
IriSP.libFiles.defaultDir = "../libs/";
IriSP.widgetsDir = "../metadataplayer";
IriSP.language = 'fr';
var _metadata = {
-// url: 'bab_files/mashup.json',
+ url: 'bab_files/mashup.json',
// url: 'http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/cljson/id/b2754186-a0c9-11e0-b8bd-00145ea49a02?callback=?',
- url: 'http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/cljson/id/5afd8bbe-9b75-11e1-9e5d-00145ea4a2be?callback=?',
+// url: 'http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/cljson/id/5afd8bbe-9b75-11e1-9e5d-00145ea4a2be?callback=?',
+// url: 'http://localhost/pf/ldtplatform/ldt/mashupbytag/?tag=projection',
+// url: 'http://ldt.iri.centrepompidou.fr/ldtplatform/ldt/mashupbytag/?tag=mashuptag&callback=?',
+// url: 'http://localhost/pf/ldtplatform/ldt/mashupbytag/?tag=mashuptag&in=240000&out=1860000',
format: 'ldt'
};
-var _canPlayMp4 = document.createElement('video').canPlayType('video/mp4');
var _config = {
- gui: {
- width : 630,
- container : 'LdtPlayer',
- default_options: {
- metadata: _metadata
+ width : 630,
+ container : 'LdtPlayer',
+ default_options: {
+ metadata: _metadata
+ },
+ css : '../metadataplayer/LdtPlayer-core.css',
+ widgets: [
+ {
+ type: "MashupPlayer",
+ url_transform: url_transform_func
+ },
+ { type: "Slider" },
+ { type: "Controller" },
+ {
+ type: "Segments",
+ annotation_type: false
},
- css : '../metadataplayer/LdtPlayer-core.css',
- widgets: [
- { type: "Slider" },
- { type: "Controller" },
- {
- type: "Segments",
- annotation_type: false
- },
- { type: "Arrow" },
- {
- type: "Annotation",
- annotation_type: false
- },
- {
- type: "Tagger",
- api_endpoint: "../post-test.php",
- tags: ["actif","amour","bonheur","captif","charité","désir","dieu","doute","famille","idéal","internationale","passif","patrie","peur","politique","président","spleen","travail"]
- },
- {
- type: "MediaList",
- container: "mediaList"
- },
- {
- type: "AnnotationsList",
- container: "annotationList",
- //ajax_url: "http://ldt.iri.centrepompidou.fr/ldtplatform/api/ldt/segments/{{media}}/{{begin}}/{{end}}?callback=?",
- //ajax_granularity: 30000,
- //limit_count: 3
- },
- { type: "Mediafragment" }
- ]
- },
- player:{
- type:'mashup-html',
- url_transform: function(_url) {
- var _transformed = _url.replace(/^rtmp:\/\/media.iri.centrepompidou.fr\/ddc_player\/(mp4:)?video\//i,"http://media.iri.centrepompidou.fr/video/");
- if (!/\.mp4$/.test(_transformed)) {
- _transformed += '.mp4';
- }
- if (_canPlayMp4 == "") {
- _transformed = _transformed.replace(/\.mp4$/i,'.ogv');
- }
- return _transformed;
+ {
+ type: "Annotation",
+ annotation_type: false
+ },
+ {
+ type: "Tagger",
+ api_endpoint: "../post-test.php",
+ tags: ["actif","amour","bonheur","captif","charité","désir","dieu","doute","famille","idéal","internationale","passif","patrie","peur","politique","président","spleen","travail"]
},
- height: 350,
- width: 630,
- metadata: _metadata
- }
+ {
+ type: "MediaList",
+ container: "mediaList"
+ },
+ {
+ type: "AnnotationsList",
+ container: "annotationList",
+ //ajax_url: "http://ldt.iri.centrepompidou.fr/ldtplatform/api/ldt/segments/{{media}}/{{begin}}/{{end}}?callback=?",
+ //ajax_granularity: 30000,
+ //limit_count: 3
+ },
+ { type: "Mediafragment" }
+ ]
};
_myPlayer = new IriSP.Metadataplayer(_config);