# HG changeset patch # User veltr # Date 1346323864 -7200 # Node ID 1e64e46a954f2850032c03d5c68bc2c3df1556bf # Parent 9698ad710824c38d1f8945613c318c8616d521bd Added Vimeo Support diff -r 9698ad710824 -r 1e64e46a954f src/js/init.js --- a/src/js/init.js Wed Aug 29 18:55:55 2012 +0200 +++ b/src/js/init.js Thu Aug 30 12:51:04 2012 +0200 @@ -183,6 +183,7 @@ _types = { "html5" : /\.(ogg|ogv|webm)$/, "youtube" : /^(https?:\/\/)?(www\.)?youtube\.com/, + "vimeo" : /^(https?:\/\/)?(www\.)?vimeo\.com/, "dailymotion" : /^(https?:\/\/)?(www\.)?dailymotion\.com/ }; @@ -276,6 +277,15 @@ _pop = Popcorn.youtube("#" + containerDiv, _url); break; + case "vimeo": + // Popcorn.vimeo wants us to specify the size of the player in the style attribute of its container div. + IriSP.jQuery("#" + containerDiv).css({ + width : this.config.player.width + "px", + height : this.config.player.height + "px" + }); + _pop = Popcorn.vimeo("#" + containerDiv, this.config.player.video); + break; + case "dailymotion": _pop = new IriSP.PopcornReplacement.dailymotion("#" + containerDiv, this.config.player); break; diff -r 9698ad710824 -r 1e64e46a954f src/widgets/Renkan.js --- a/src/widgets/Renkan.js Wed Aug 29 18:55:55 2012 +0200 +++ b/src/widgets/Renkan.js Thu Aug 30 12:51:04 2012 +0200 @@ -38,6 +38,15 @@ return _ann.getMedia().id == _annmatch[1] && _ann.id == _annmatch[2]; }); _annotations.forEach(function(_ann) { + var _duration = _ann.getDuration(), + _preroll = + ( _duration < _this.min_duration ) * ( _this.min_duration / 2); + var _nt = { + selected: false, + node: _node, + begin: _ann.begin - _preroll, + end: _ann.end + _preroll + } + _this.node_times.push(_nt); _ann.on("select", function(_stop) { if (!_stop) { _node.trigger("select",true); @@ -54,6 +63,7 @@ } }); _node.on("unselect", function(_stop) { + _nt.selected = false; if (!_stop) { _ann.trigger("unselect",true); } @@ -62,14 +72,6 @@ _this.player.popcorn.currentTime(_ann.begin.getSeconds()); _this.player.popcorn.trigger("IriSP.Mediafragment.setHashToAnnotation", _ann.id); }); - var _duration = _ann.getDuration(), - _preroll = + ( _duration < _this.min_duration ) * ( _this.min_duration / 2); - _this.node_times.push({ - selected: false, - node: _node, - begin: _ann.begin - _preroll, - end: _ann.end + _preroll - }); }); } var _tagmatch = _uri.match(_this.tag_regexp); @@ -98,7 +100,6 @@ } } else { if (_nt.selected) { - _nt.selected = false; _nt.node.trigger("unselect", true); } } diff -r 9698ad710824 -r 1e64e46a954f test/ext-trace.htm --- a/test/ext-trace.htm Wed Aug 29 18:55:55 2012 +0200 +++ b/test/ext-trace.htm Thu Aug 30 12:51:04 2012 +0200 @@ -53,7 +53,7 @@ { type: "Annotation" }, { type: "CreateAnnotation", - api_endpoint_template: "http://ubuntu/pf/ldtplatform/api/ldt/annotations/{{id}}.json", + api_endpoint_template: "http://capsicum/pf/ldtplatform/api/ldt/annotations/{{id}}.json", creator_name: "Metadataplayer", creator_avatar: "https://si0.twimg.com/sticky/default_profile_images/default_profile_1_normal.png", tag_titles: ["#amateur", "#digital-humanities"] diff -r 9698ad710824 -r 1e64e46a954f test/index.htm --- a/test/index.htm Wed Aug 29 18:55:55 2012 +0200 +++ b/test/index.htm Thu Aug 30 12:51:04 2012 +0200 @@ -15,6 +15,7 @@
  • with HTML5/OGG (uses Popcorn.js, compatible with Firefox and Chrome)

  • with HTML5/MP4 (uses Popcorn.js, compatible with IE, Safari and Chrome)

  • with Youtube (uses Popcorn.js and the Popcorn Youtube plugin/player)

  • +
  • with Vimeo (uses Popcorn.js and the Popcorn Vimeo plugin/player)

  • with Dailymotion (uses custom player functions)

  • diff -r 9698ad710824 -r 1e64e46a954f test/json/ldt-vimeo.json --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/json/ldt-vimeo.json Thu Aug 30 12:51:04 2012 +0200 @@ -0,0 +1,183 @@ +{ + "views": [ + { + "id": "v_0A5EA02B-90DA-EB8E-FCFE-7709E74314BB", + "contents": ["fcc5301c-f289-11e1-a3d6-08002791f1b7"], + "annotation_types": ["c_0e9fb3c0-f28a-11e1-955e-08002791f1b7", "c_0ea02ada-f28a-11e1-955e-08002791f1b7"] + }, { + "meta": { + "stat": "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" + }, + "id": "stat", + "contents": ["fcc5301c-f289-11e1-a3d6-08002791f1b7"] + } + ], + "tags": null, + "lists": [ + { + "items": [ + { + "id-ref": "c_0e9fb3c0-f28a-11e1-955e-08002791f1b7" + }, { + "id-ref": "c_0ea02ada-f28a-11e1-955e-08002791f1b7" + } + ], + "meta": { + "dc:contributor": "undefined", + "dc:created": "2012-08-30T10:22:50.136571", + "dc:creator": "undefined", + "id-ref": "fcc5301c-f289-11e1-a3d6-08002791f1b7", + "dc:title": "Découpages personnels", + "editable": "false", + "dc:modified": "2012-08-30T10:22:50.136571", + "dc:description": "" + }, + "id": "g_0e9f2cac-f28a-11e1-955e-08002791f1b7" + } + ], + "medias": [ + { + "origin": "0", + "url": "http://vimeo.com/40855651", + "http://advene.liris.cnrs.fr/ns/frame_of_reference/ms": "o=0", + "meta": { + "dc:contributor": "IRI", + "item": { + "name": "streamer", + "value": "" + }, + "dc:created": "2012-08-30T10:04:16.143040", + "dc:duration": 1042000, + "dc:creator": "IRI", + "dc:created.contents": "2012-08-30", + "dc:title": "Ars Industrialis - Travail et Emploi", + "dc:creator.contents": "IRI", + "dc:modified": "2012-08-30T10:04:16.422413", + "dc:description": "Montage Simon Lincelles" + }, + "id": "fcc5301c-f289-11e1-a3d6-08002791f1b7", + "unit": "ms" + } + ], + "meta": { + "dc:contributor": "admin", + "dc:created": "2012-08-30T10:04:16.159226", + "dc:creator": "admin", + "main_media": { + "id-ref": "fcc5301c-f289-11e1-a3d6-08002791f1b7" + }, + "dc:description": "", + "dc:title": "front project : Ars Industrialis - Travail et Emploi", + "id": "0e907b30-f28a-11e1-955e-08002791f1b7", + "dc:modified": "2012-08-30T10:19:37.473399" + }, + "annotations": [ + { + "content": { + "mimetype": "application/x-ldt-structured", + "description": "Première partie", + "img": { + "src": "" + }, + "title": "A 1", + "color": "16763904", + "polemics": [], + "audio": { + "mimetype": "audio/mp3", + "src": "", + "href": null + } + }, + "begin": 0, + "meta": { + "dc:contributor": "perso", + "id-ref": "c_0e9fb3c0-f28a-11e1-955e-08002791f1b7", + "dc:created": "2012-08-30T10:22:50.136634", + "dc:modified": "2012-08-30T10:22:50.136634", + "dc:creator": "perso" + }, + "end": 351792, + "tags": null, + "color": "16763904", + "media": "fcc5301c-f289-11e1-a3d6-08002791f1b7", + "id": "s_520832CB-C992-A189-0086-770A103763EC" + }, { + "content": { + "mimetype": "application/x-ldt-structured", + "description": "Deuxième partie", + "img": { + "src": "" + }, + "title": "B 2", + "color": "16763904", + "polemics": [], + "audio": { + "mimetype": "audio/mp3", + "src": "", + "href": null + } + }, + "begin": 353130, + "meta": { + "dc:contributor": "perso", + "id-ref": "c_0e9fb3c0-f28a-11e1-955e-08002791f1b7", + "dc:created": "2012-08-30T10:22:50.136634", + "dc:modified": "2012-08-30T10:22:50.136634", + "dc:creator": "perso" + }, + "end": 687533, + "tags": null, + "color": "16763904", + "media": "fcc5301c-f289-11e1-a3d6-08002791f1b7", + "id": "s_30F09F49-23C6-37CC-D21F-770A1FEE49D9" + }, { + "content": { + "mimetype": "application/x-ldt-structured", + "description": "Troisième partie", + "img": { + "src": "" + }, + "title": "C 3", + "color": "16763904", + "polemics": [], + "audio": { + "mimetype": "audio/mp3", + "src": "", + "href": null + } + }, + "begin": 688870, + "meta": { + "dc:contributor": "perso", + "id-ref": "c_0e9fb3c0-f28a-11e1-955e-08002791f1b7", + "dc:created": "2012-08-30T10:22:50.136634", + "dc:modified": "2012-08-30T10:22:50.136634", + "dc:creator": "perso" + }, + "end": 1042000, + "tags": null, + "color": "16763904", + "media": "fcc5301c-f289-11e1-a3d6-08002791f1b7", + "id": "s_7D9EBBC1-7E97-E3D0-7BA9-770A308283B7" + } + ], + "annotation-types": [ + { + "dc:contributor": "perso", + "dc:creator": "perso", + "dc:title": "chapitrage", + "id": "c_0e9fb3c0-f28a-11e1-955e-08002791f1b7", + "dc:created": "2012-08-30T10:22:50.136634", + "dc:description": "", + "dc:modified": "2012-08-30T10:22:50.136634" + }, { + "dc:contributor": "perso", + "dc:creator": "perso", + "dc:title": "contributions", + "id": "c_0ea02ada-f28a-11e1-955e-08002791f1b7", + "dc:created": "2012-08-30T10:22:50.138056", + "dc:description": "", + "dc:modified": "2012-08-30T10:22:50.138056" + } + ] +} \ No newline at end of file diff -r 9698ad710824 -r 1e64e46a954f test/vimeo.htm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/vimeo.htm Thu Aug 30 12:51:04 2012 +0200 @@ -0,0 +1,21 @@ + + + + + + Metadataplayer test with Dailymotion + + + + + + + +

    Metadataplayer test with Dailymotion

    +
    +
    + + +