# HG changeset patch # User veltr # Date 1349194085 -7200 # Node ID 353b0881a0b96c2443cec368381e97df76f6cdcc # Parent 03c88ba5de2cecf43f8ad38484222c0b9eb9e46f Added On-the-fly (file-less) metadata generation test diff -r 03c88ba5de2c -r 353b0881a0b9 .hgignore --- a/.hgignore Tue Oct 02 12:44:37 2012 +0200 +++ b/.hgignore Tue Oct 02 18:08:05 2012 +0200 @@ -34,4 +34,6 @@ syntax: regexp \.webm$ syntax: regexp -^downloads/.+\.zip$ \ No newline at end of file +^downloads/.+\.zip$ +syntax: regexp +^sbin/build/compil-to-polemic-tweet\.sh$ \ No newline at end of file diff -r 03c88ba5de2c -r 353b0881a0b9 sbin/build/compil-to-polemic-tweet.sh.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/sbin/build/compil-to-polemic-tweet.sh.tmpl Tue Oct 02 18:08:05 2012 +0200 @@ -0,0 +1,16 @@ +#!/bin/bash + +echo "Compiling Metadataplayer" + +sh ../res/ant/bin/ant -f client.xml + +echo "Copying to Polemic Tweet :" + +echo " Copying core files and widgets" + +cp -R ../../test/metadataplayer/* ~/shared/tweet_live/web/res/metadataplayer + +echo " Copying libs" + +cp -R ../../src/js/libs/* ~/shared/tweet_live/web/res/js + diff -r 03c88ba5de2c -r 353b0881a0b9 src/js/init.js --- a/src/js/init.js Tue Oct 02 12:44:37 2012 +0200 +++ b/src/js/init.js Tue Oct 02 18:08:05 2012 +0200 @@ -102,12 +102,12 @@ } IriSP.Metadataplayer.prototype.loadMetadata = function(_metadataInfo) { + if (_metadataInfo.elementType === "source") { + return _metadataInfo; + } if (typeof _metadataInfo.serializer === "undefined" && typeof _metadataInfo.format !== "undefined") { _metadataInfo.serializer = IriSP.serializers[_metadataInfo.format]; } - if (typeof _metadataInfo.url === "undefined" && typeof _metadataInfo.src !== "undefined") { - _metadataInfo.url = _metadataInfo.src; - } if (typeof _metadataInfo.url !== "undefined" && typeof _metadataInfo.serializer !== "undefined") { return this.sourceManager.remoteSource(_metadataInfo); } else { diff -r 03c88ba5de2c -r 353b0881a0b9 src/js/model.js --- a/src/js/model.js Tue Oct 02 12:44:37 2012 +0200 +++ b/src/js/model.js Tue Oct 02 18:08:05 2012 +0200 @@ -267,6 +267,14 @@ this.__events[_event].push(_callback); } +IriSP.Model.List.prototype.off = function(_event, _callback) { + if (typeof this.__events[_event] !== "undefined") { + this.__events[_event] = IriSP._(this.__events[_event]).reject(function(_fn) { + return _fn === _callback; + }); + } +} + IriSP.Model.List.prototype.trigger = function(_event, _data) { var _list = this; IriSP._(this.__events[_event]).each(function(_callback) { @@ -421,7 +429,7 @@ var _this = this; return this.source.getList(_elementType, _global).filter(function(_el) { var _ref = _el[_this.elementType]; - return _ref.isOrHasId(_this.id); + return _ref && _ref.isOrHasId(_this.id); }); } @@ -432,6 +440,14 @@ this.__events[_event].push(_callback); } +IriSP.Model.Element.prototype.off = function(_event, _callback) { + if (typeof this.__events[_event] !== "undefined") { + this.__events[_event] = IriSP._(this.__events[_event]).reject(function(_fn) { + return _fn === _callback; + }); + } +} + IriSP.Model.Element.prototype.trigger = function(_event, _data) { var _element = this; IriSP._(this.__events[_event]).each(function(_callback) { @@ -535,6 +551,7 @@ this.elementType = 'annotation'; this.begin = new IriSP.Model.Time(); this.end = new IriSP.Model.Time(); + this.tag = new IriSP.Model.Reference(_source, []); this.playing = false; var _this = this; this.on("click", function() { @@ -733,6 +750,7 @@ IriSP.Model.Source = function(_config) { this.status = IriSP.Model._SOURCE_STATUS_EMPTY; + this.elementType = "source"; if (typeof _config !== "undefined") { var _this = this; IriSP._(_config).forEach(function(_v, _k) { @@ -744,6 +762,8 @@ } } +IriSP.Model.Source.prototype = new IriSP.Model.Element(); + IriSP.Model.Source.prototype.addList = function(_listId, _contents) { if (typeof this.contents[_listId] === "undefined") { this.contents[_listId] = new IriSP.Model.List(this.directory); @@ -860,7 +880,7 @@ } else { var _medias = this.getMedias(); if (_medias.length) { - _media = _medias[0]; + this.currentMedia = _medias[0]; } } } diff -r 03c88ba5de2c -r 353b0881a0b9 src/widgets/AnnotationsList.js --- a/src/widgets/AnnotationsList.js Tue Oct 02 12:44:37 2012 +0200 +++ b/src/widgets/AnnotationsList.js Tue Oct 02 18:08:05 2012 +0200 @@ -223,8 +223,15 @@ audio : (_this.show_audio && _annotation.audio && _annotation.audio.href && _annotation.audio.href != "null" ? _annotation.audio.href : undefined), l10n: _this.l10n }; - var _html = Mustache.to_html(_this.annotationTemplate, _data); - var _el = IriSP.jQuery(_html); + var _html = Mustache.to_html(_this.annotationTemplate, _data), + _el = IriSP.jQuery(_html), + _onselect = function() { + _this.annotations_$.removeClass("selected"); + _el.addClass("selected"); + }, + _onunselect = function() { + _this.annotations_$.removeClass("selected"); + }; _el.mouseover(function() { _annotation.trigger("select"); }) @@ -232,13 +239,12 @@ _annotation.trigger("unselect"); }) .appendTo(_this.list_$); - _annotation.on("select", function() { - _this.annotations_$.removeClass("selected"); - _el.addClass("selected"); + _el.on("remove", function() { + _annotation.off("select", _onselect); + _annotation.off("unselect", _onunselect); }); - _annotation.on("unselect", function() { - _this.annotations_$.removeClass("selected"); - });; + _annotation.on("select", _onselect); + _annotation.on("unselect", _onunselect); }); this.annotations_$ = this.$.find('.Ldt-AnnotationsList-li'); @@ -247,7 +253,7 @@ this.$.find('.Ldt-AnnotationsList-Tag-Li').each(function() { var _el = IriSP.jQuery(this); if (!_el.text().replace(/(^\s+|\s+$)/g,'')) { - _el.detach(); + _el.remove(); } }); diff -r 03c88ba5de2c -r 353b0881a0b9 src/widgets/JwpPlayer.js --- a/src/widgets/JwpPlayer.js Tue Oct 02 12:44:37 2012 +0200 +++ b/src/widgets/JwpPlayer.js Tue Oct 02 18:08:05 2012 +0200 @@ -19,6 +19,10 @@ this.video = this.media.video; } + if (typeof this.streamer === "undefined") { + this.streamer = this.media.streamer; + } + if (typeof this.streamer === "function") { this.streamer = this.streamer(this.video); } diff -r 03c88ba5de2c -r 353b0881a0b9 test/dailymotion.htm --- a/test/dailymotion.htm Tue Oct 02 12:44:37 2012 +0200 +++ b/test/dailymotion.htm Tue Oct 02 18:08:05 2012 +0200 @@ -7,7 +7,6 @@ - diff -r 03c88ba5de2c -r 353b0881a0b9 test/jwplayer-audio.htm --- a/test/jwplayer-audio.htm Tue Oct 02 12:44:37 2012 +0200 +++ b/test/jwplayer-audio.htm Tue Oct 02 18:08:05 2012 +0200 @@ -7,7 +7,6 @@ - diff -r 03c88ba5de2c -r 353b0881a0b9 test/jwplayer.htm --- a/test/jwplayer.htm Tue Oct 02 12:44:37 2012 +0200 +++ b/test/jwplayer.htm Tue Oct 02 18:08:05 2012 +0200 @@ -7,7 +7,6 @@ - @@ -36,15 +35,7 @@ live: true, width: 550, provider: "rtmp", - autostart: true, - streamer: function(_url) { - var _matches = _url.match(/^[^\/]+\/\/[^\/]+\/[^\/]+\//); - if (_matches) { - return _matches[0]; - } else { - return _url; - } - } + autostart: true }, { type: "Slider" }, { type: "Controller" }, diff -r 03c88ba5de2c -r 353b0881a0b9 test/onthefly.htm --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/test/onthefly.htm Tue Oct 02 18:08:05 2012 +0200 @@ -0,0 +1,71 @@ + + + + + + + Metadataplayer test with HTML5 / OGG Video + + + + + + + +

Metadataplayer test with HTML5 / H.264 Video - Uses Popcorn with compatible browsers, JwPlayer with others

+
+
+ + +