')
- .addClass("Ldt-Slice")
+ this.renderTemplate();
+
+ this.$slider = this.$.find(".Ldt-Slice");
- this.$.append(this.$slider);
+ if (this.show_arrow) {
+ this.insertSubwidget(this.$.find(".Ldt-Slice-Arrow"), { type: "Arrow" },"arrow");
+ }
this.min = 0;
- this.max = this.source.getDuration().valueOf();
+ this.max = this.media.duration.valueOf();
var _this = this,
_currentTime;
this.$slider.slider({
range: true,
- values: [0, 0],
+ values: [0, this.max],
min: 0,
max: this.max,
change: function(event, ui) {
- _this.player.trigger("Arrow.updatePosition",{
- widget:_this.type,
- time:Math.floor((ui.values[0]+ui.values[1])/2)
- });
- _this.player.trigger("Slice.boundsChanged",[ui.values[0], ui.values[1]]);
+ if (_this.arrow) {
+ _this.arrow.moveToTime((ui.values[0]+ui.values[1])/2)
+ }
+ if (_this.onBoundsChanged) {
+ _this.onBoundsChanged(ui.values[0],ui.values[1]);
+ }
},
start: function() {
_this.sliding = true;
@@ -54,9 +54,6 @@
_currentTime = _this.media.getCurrentTime();
},
slide: function(event, ui) {
- if (!_this.override_bounds && (ui.value < _this.min || ui.value > _this.max)) {
- return false;
- }
_this.media.setCurrentTime(ui.value);
},
stop: function() {
@@ -64,36 +61,21 @@
_this.media.setCurrentTime(_currentTime);
}
});
+
this.$slider.find(".ui-slider-handle:first").addClass("Ldt-Slice-left-handle");
this.$slider.find(".ui-slider-handle:last").addClass("Ldt-Slice-right-handle");
- if (this.start_visible) {
- this.show();
- } else {
- this.hide();
- }
- this.onMdpEvent("Slice.show","show");
- this.onMdpEvent("Slice.hide","hide");
- this.onMdpEvent("Annotation.boundsChanged","storeBounds");
- this.player.trigger("Annotation.getBounds");
+
+ this.getWidgetAnnotations().forEach(function(_a) {
+ _a.on("enter", function() {
+ _this.$slider.slider("values",[_a.begin, _a.end]);
+ });
+ });
};
IriSP.Widgets.Slice.prototype.show = function() {
this.$slider.show();
- this.player.trigger("Arrow.takeover",this.type);
- this.$slider.slider("values", [this.min, this.max]);
}
IriSP.Widgets.Slice.prototype.hide = function() {
this.$slider.hide();
- this.player.trigger("Arrow.release");
}
-
-IriSP.Widgets.Slice.prototype.storeBounds = function(_values) {
- if (!this.media.getPaused() && (this.min != _values[0] || this.max != _values[1])) {
- this.min = _values[0];
- this.max = _values[1];
- if (this.live_update && !this.sliding) {
- this.$slider.slider("values", [this.min, this.max]);
- }
- }
-}
\ No newline at end of file
diff -r d7d56ea2d0a6 -r eadb7290c325 src/widgets/Slider.css
--- a/src/widgets/Slider.css Fri Sep 21 11:18:57 2012 +0900
+++ b/src/widgets/Slider.css Mon Sep 24 18:32:22 2012 +0200
@@ -12,3 +12,8 @@
background: #747474;
}
+.Ldt-Slider-Time {
+ position: absolute; top: -16px; background: #ffffc0; color: #000000; border-radius: 3px; z-index: 8;
+ font-size: 9px; width: 34px; border: 1px solid #999999; padding: 1px; margin-left: -20px;
+ display: none; text-align: center; font-weight: bold;
+}
diff -r d7d56ea2d0a6 -r eadb7290c325 src/widgets/Slider.js
--- a/src/widgets/Slider.js Fri Sep 21 11:18:57 2012 +0900
+++ b/src/widgets/Slider.js Mon Sep 24 18:32:22 2012 +0200
@@ -15,12 +15,16 @@
set to zero for fixed slider */
};
+IriSP.Widgets.Slider.prototype.template =
+ '
'
+
IriSP.Widgets.Slider.prototype.draw = function() {
- this.$slider = IriSP.jQuery('
')
- .addClass("Ldt-Slider");
+ this.renderTemplate();
- this.$.append(this.$slider);
+ this.$time = this.$.find(".Ldt-Slider-Time");
+
+ this.$slider = this.$.find(".Ldt-Slider");
var _this = this;
@@ -45,13 +49,21 @@
this.$slider.css(this.calculateSliderCss(this.minimized_height));
this.$handle.css(this.calculateHandleCss(this.minimized_height));
- this.$
- .mouseover(this.functionWrapper("onMouseover"))
- .mouseout(this.functionWrapper("onMouseout"));
-
this.maximized = false;
this.timeoutId = false;
}
+
+ this.$
+ .mouseover(function() {
+ _this.$time.show();
+ _this.onMouseover();
+ })
+ .mouseout(this.functionWrapper("onMouseout"))
+ .mousemove(function(_e) {
+ var _x = _e.pageX - _this.$.offset().left,
+ _t = new IriSP.Model.Time(_this.media.duration * _x / _this.width);
+ _this.$time.text(_t.toString()).css("left",_x);
+ });
};
IriSP.Widgets.Slider.prototype.onTimeupdate = function(_time) {
@@ -73,6 +85,7 @@
}
IriSP.Widgets.Slider.prototype.onMouseout = function() {
+ this.$time.hide();
if (this.minimize_timeout) {
if (this.timeoutId) {
window.clearTimeout(this.timeoutId);
diff -r d7d56ea2d0a6 -r eadb7290c325 src/widgets/Slideshare.js
--- a/src/widgets/Slideshare.js Fri Sep 21 11:18:57 2012 +0900
+++ b/src/widgets/Slideshare.js Mon Sep 24 18:32:22 2012 +0200
@@ -2,12 +2,6 @@
IriSP.Widgets.Slideshare = function(player, config) {
IriSP.Widgets.Widget.call(this, player, config);
- this.lastSlide = {
- presentation: "",
- slide: 0
- }
- this.embedObject = null;
- this.oembedCache = {}
}
IriSP.Widgets.Slideshare.prototype = new IriSP.Widgets.Widget();
@@ -32,99 +26,94 @@
'
';
IriSP.Widgets.Slideshare.prototype.draw = function() {
- var _hide = false;
- if (typeof this.annotation_type !== "undefined" && this.annotation_type) {
- var _annType = this.source.getAnnotationTypes().searchByTitle(this.annotation_type);
- _hide = !_annType.length;
+
+ var _embedObject = null,
+ $container,
+ _lastEmbedded = "",
+ _this = this;
+
+ function insertSlideshare(_presentation, _slide) {
+ if (_lastEmbedded === _presentation) {
+ if (_.embedObject && typeof _embedObject.jumpTo === "function") {
+ _embedObject.jumpTo(parseInt(_slide));
+ }
+ } else {
+ _lastEmbedded = _presentation;
+ var _id = IriSP.Model.getUID(),
+ _params = {
+ allowScriptAccess: "always"
+ }
+ _atts = {
+ id: _id
+ },
+ _flashvars = {
+ doc : _presentation,
+ startSlide : _slide
+ };
+ $container.html('
');
+ swfobject.embedSWF(
+ "http://static.slidesharecdn.com/swf/ssplayer2.swf",
+ _id,
+ _this.embed_width,
+ _this.embed_height,
+ "8",
+ null,
+ _flashvars,
+ _params,
+ _atts
+ );
+ _embedObject = document.getElementById(_id);
+ }
+ $container.show();
}
- if (_hide) {
+
+ var _annotations = this.getWidgetAnnotations();
+ if (!_annotations.length) {
this.$.hide();
} else {
this.renderTemplate();
- this.$container = this.$.find(".Ldt-SlideShare-Container");
- this.onMediaEvent("timeupdate","onTimeupdate");
- this.onTimeupdate(0);
+ var _lastPres = "",
+ _embedObject = null,
+ _oembedCache = {},
+ _this = this;
+ $container = this.$.find(".Ldt-SlideShare-Container");
+ _annotations.forEach(function(_a) {
+ _a.on("leave", function() {
+ $container.hide();
+ _lastPres = "";
+ });
+ _a.on("enter", function() {
+ var _description = _a.description,
+ _isurl = /^https?:\/\//.test(_description),
+ _presentation = _description.replace(/#.*$/,''),
+ _slidematch = _description.match(/(#|\?|&)id=(\d+)/),
+ _slide = parseInt(_slidematch && _slidematch.length > 2 ? _slidematch[2] : 1);
+ if (_presentation !== _lastPres) {
+ if (_isurl) {
+ if (typeof _oembedCache[_presentation] === "undefined") {
+ var _ajaxUrl = "http://www.slideshare.net/api/oembed/1?url="
+ + encodeURIComponent(_presentation)
+ + "&format=jsonp&callback=?";
+ IriSP.jQuery.getJSON(_ajaxUrl, function(_oembedData) {
+ var _presmatch = _oembedData.html.match(/doc=([a-z0-9\-_%]+)/i);
+ if (_presmatch && _presmatch.length > 1) {
+ _oembedCache[_presentation] = _presmatch[1];
+ insertSlideshare(_presmatch[1], _slide);
+ }
+ });
+ } else {
+ insertSlideshare(_oembedCache[_presentation], _slide);
+ }
+ } else {
+ insertSlideshare(_presentation, _slide);
+ }
+ }
+ if (_this.sync && _embedObject && typeof _embedObject.jumpTo === "function") {
+ _embedObject.jumpTo(parseInt(_slide));
+ }
+ _lastPres = _presentation;
+
+ })
+ })
}
}
-
-IriSP.Widgets.Slideshare.prototype.onTimeupdate = function(_time) {
- var _list = this.getWidgetAnnotationsAtTime();
- if (_list.length) {
- var _description = _list[0].description,
- _isurl = /^https?:\/\//.test(_description),
- _presentation = _description.replace(/#.*$/,''),
- _slidematch = _description.match(/(#|\?|&)id=(\d+)/),
- _slide = parseInt(_slidematch && _slidematch.length > 2 ? _slidematch[2] : 1),
- _this = this;
- if (_presentation !== this.lastSlide.presentation) {
- if (_isurl) {
- if (typeof this.oembedCache[_presentation] === "undefined") {
- var _ajaxUrl = "http://www.slideshare.net/api/oembed/1?url="
- + encodeURIComponent(_presentation)
- + "&format=jsonp&callback=?";
- IriSP.jQuery.getJSON(_ajaxUrl, function(_oembedData) {
- var _presmatch = _oembedData.html.match(/doc=([a-z0-9\-_%]+)/i);
- if (_presmatch && _presmatch.length > 1) {
- _this.oembedCache[_presentation] = _presmatch[1];
- _this.insertSlideshare(_presmatch[1], _slide);
- }
- });
- } else {
- this.insertSlideshare(this.oembedCache[_presentation], _slide);
- }
- } else {
- this.insertSlideshare(_presentation, _slide);
- }
- }
- if (_slide != this.lastSlide.slide && this.sync && this.embedObject && typeof this.embedObject.jumpTo === "function") {
- this.embedObject.jumpTo(parseInt(_slide));
- }
- this.lastSlide = {
- presentation: _presentation,
- slide: _slide
- }
- } else {
- if (this.lastSlide.presentation) {
- this.$container.hide();
- this.lastSlide = {
- presentation: "",
- slide: 0
- }
- }
- }
-}
-
-IriSP.Widgets.Slideshare.prototype.insertSlideshare = function(_presentation, _slide) {
- if (this.lastEmbedded === _presentation) {
- if (this.embedObject && typeof this.embedObject.jumpTo === "function") {
- this.embedObject.jumpTo(parseInt(_slide));
- }
- } else {
- this.lastEmbedded = _presentation;
- var _id = IriSP.Model.getUID(),
- _params = {
- allowScriptAccess: "always"
- }
- _atts = {
- id: _id
- },
- _flashvars = {
- doc : _presentation,
- startSlide : _slide
- };
- this.$container.html('
');
- swfobject.embedSWF(
- "http://static.slidesharecdn.com/swf/ssplayer2.swf",
- _id,
- this.embed_width,
- this.embed_height,
- "8",
- null,
- _flashvars,
- _params,
- _atts
- );
- this.embedObject = document.getElementById(_id);
- }
- this.$container.show();
-}
diff -r d7d56ea2d0a6 -r eadb7290c325 src/widgets/Tagcloud.js
--- a/src/widgets/Tagcloud.js Fri Sep 21 11:18:57 2012 +0900
+++ b/src/widgets/Tagcloud.js Mon Sep 24 18:32:22 2012 +0200
@@ -44,35 +44,27 @@
this.onMdpEvent("search.cleared", "onSearch");
if (this.segment_annotation_type) {
- this.onMediaEvent("timeupdate","onTimeupdate");
+ var _this = this;
+ this.source.getAnnotationsByTypeTitle(this.segment_annotation_type).forEach(function(_a) {
+ _a.on("enter", function() {
+ _this.redraw(_a.begin, _a.end);
+ })
+ });
} else {
this.redraw();
}
}
-IriSP.Widgets.Tagcloud.prototype.onTimeupdate = function(_time) {
- var _list = this.source.getAnnotationsByTypeTitle(this.segment_annotation_type).filter(function(_annotation) {
- return _annotation.begin <= _time && _annotation.end > _time;
- });
- if (_list.length) {
- if (_list[0].begin !== this.begin_time || _list[0].end !== this.end_time) {
- this.begin_time = _list[0].begin;
- this.end_time = _list[0].end;
- this.redraw();
- }
- }
-}
-
-IriSP.Widgets.Tagcloud.prototype.redraw = function() {
+IriSP.Widgets.Tagcloud.prototype.redraw = function(_from, _to) {
var _urlRegExp = /https?:\/\/[0-9a-zA-Z\.%\/-_]+/g,
_regexpword = /[^\s\.&;,'"!\?\d\(\)\+\[\]\\\…\-«»:\/]{3,}/g,
_words = {},
_this = this,
_annotations = this.getWidgetAnnotations();
- if (typeof this.begin_time !== "undefined" && typeof this.end_time !== "undefined") {
+ if (typeof _from !== "undefined" && typeof _to !== "undefined") {
_annotations = _annotations.filter(function(_annotation) {
- return _annotation.begin >= _this.begin_time && _annotation.end <= _this.end_time;
+ return _annotation.begin >= _from && _annotation.end <= _to;
})
}
diff -r d7d56ea2d0a6 -r eadb7290c325 src/widgets/Tagger.css
--- a/src/widgets/Tagger.css Fri Sep 21 11:18:57 2012 +0900
+++ b/src/widgets/Tagger.css Mon Sep 24 18:32:22 2012 +0200
@@ -1,3 +1,14 @@
-/*
- *
- */
\ No newline at end of file
+
+.Ldt-Tagger {
+ border-style: solid;
+ border-width: 1px;
+ border-color: #b7b7b7;
+ padding: 1px;
+ margin: 0;
+}
+
+.Ldt-Tagger-Inner {
+ background: url(img/pinstripe.png);
+ padding: 5px;
+ margin: 0;
+}
diff -r d7d56ea2d0a6 -r eadb7290c325 src/widgets/Tagger.js
--- a/src/widgets/Tagger.js Fri Sep 21 11:18:57 2012 +0900
+++ b/src/widgets/Tagger.js Mon Sep 24 18:32:22 2012 +0200
@@ -26,8 +26,8 @@
}
IriSP.Widgets.Tagger.prototype.template =
- '
';
+ '
';
IriSP.Widgets.Tagger.prototype.draw = function() {
this.renderTemplate();
@@ -39,7 +39,7 @@
});
if (this.pause_on_write) {
_input.keyup(function() {
- _this.player.popcorn.pause();
+ _this.media.pause();
});
}
this.$.find(".Ldt-Tagger").submit(function() {
@@ -72,7 +72,7 @@
* Nous remplissons les données de l'annotation générée à la volée
* ATTENTION: Si nous sommes sur un MASHUP, ces éléments doivent se référer AU MEDIA D'ORIGINE
* */
- var _now = 1000*_this.player.popcorn.currentTime(),
+ var _now = _this.media.getCurrentTime(),
_pilotAnnotation = null;
if (_this.source.currentMedia.elementType == "mashup") {
/* Si c'est un mashup, on récupère l'annotation d'origine pour caler le temps */
@@ -126,8 +126,8 @@
_export.deSerialize(_data);
/* On récupère les données réimportées dans l'espace global des données */
_this.source.merge(_export);
- if (_this.pause_on_write && _this.player.popcorn.media.paused) {
- _this.player.popcorn.play();
+ if (_this.pause_on_write && _this.media.getPaused()) {
+ _this.media.play();
}
/* On force le rafraîchissement du widget AnnotationsList */
_this.player.trigger("AnnotationsList.refresh");
diff -r d7d56ea2d0a6 -r eadb7290c325 test/dailymotion.htm
--- a/test/dailymotion.htm Fri Sep 21 11:18:57 2012 +0900
+++ b/test/dailymotion.htm Mon Sep 24 18:32:22 2012 +0200
@@ -35,8 +35,6 @@
{ type: "Controller" },
{ type: "Polemic" },
{ type: "Segments" },
- { type: "Slice" },
- { type: "Arrow" },
{ type: "Annotation" },
{ type: "CreateAnnotation" },
{ type: "Tweet" },
diff -r d7d56ea2d0a6 -r eadb7290c325 test/jwplayer.htm
--- a/test/jwplayer.htm Fri Sep 21 11:18:57 2012 +0900
+++ b/test/jwplayer.htm Mon Sep 24 18:32:22 2012 +0200
@@ -50,11 +50,6 @@
{ type: "Controller" },
{ type: "Polemic" },
{ type: "Segments" },
- { type: "Slice" },
- {
- type: "Arrow",
- base_height: 4
- },
{ type: "Annotation" },
{
type: "CreateAnnotation",
@@ -75,9 +70,8 @@
type: "AnnotationsList",
container: "AnnotationsListContainer",
default_thumbnail : "http://ldt.iri.centrepompidou.fr/static/site/ldt/css/imgs/video_sequence.png",
- ajax_url: "/pf/ldtplatform/api/ldt/segments/{{media}}/{{begin}}/{{end}}",
- ajax_granularity : 300000,
- default_thumbnail : "http://capsicum//pf/static/site/ldt/css/imgs/video_sequence.png"
+ //ajax_url: "/pf/ldtplatform/api/ldt/segments/{{media}}/{{begin}}/{{end}}",
+ //ajax_granularity : 300000
},
{ type: "Mediafragment"}
]
diff -r d7d56ea2d0a6 -r eadb7290c325 test/mashup/moon.htm
--- a/test/mashup/moon.htm Fri Sep 21 11:18:57 2012 +0900
+++ b/test/mashup/moon.htm Mon Sep 24 18:32:22 2012 +0200
@@ -64,6 +64,7 @@
widgets: [
{
type: "MashupPlayer",
+// split_screen: true,
url_transform: function(_url) {
if (_canPlayMp4 == "maybe" || _canPlayMp4 == "probably") {
return _url.replace(/\.webm$/i,'.mp4');
@@ -79,7 +80,6 @@
type: "Segments",
annotation_type: false
},
- { type: "Arrow" },
{
type: "Annotation",
annotation_type: false
diff -r d7d56ea2d0a6 -r eadb7290c325 test/mashup/player-html.htm
--- a/test/mashup/player-html.htm Fri Sep 21 11:18:57 2012 +0900
+++ b/test/mashup/player-html.htm Mon Sep 24 18:32:22 2012 +0200
@@ -98,7 +98,6 @@
type: "Segments",
annotation_type: false
},
- { type: "Arrow" },
{
type: "Annotation",
annotation_type: false
diff -r d7d56ea2d0a6 -r eadb7290c325 test/mashup/player-jwpmashup.htm
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test/mashup/player-jwpmashup.htm Mon Sep 24 18:32:22 2012 +0200
@@ -0,0 +1,119 @@
+
+
+
+
Preuve de concept Mashup
+
+
+
+
+
+
+
+
+
Créer un Hash-cut en 3 étapes :
+
+
+
+
S'inscrire et
créer un projet
+
+
+
+
+
Découper et
Assembler
+
+
+
+
+
Partager et
regarder !
+
+
+
+
+
Mon HashCut, avec des instances de Jw Player
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff -r d7d56ea2d0a6 -r eadb7290c325 test/mashup/player-local-html.htm
--- a/test/mashup/player-local-html.htm Fri Sep 21 11:18:57 2012 +0900
+++ b/test/mashup/player-local-html.htm Mon Sep 24 18:32:22 2012 +0200
@@ -70,7 +70,6 @@
type: "Segments",
annotation_type: false
},
- { type: "Arrow" },
{
type: "Annotation",
annotation_type: false
diff -r d7d56ea2d0a6 -r eadb7290c325 test/mp4video.htm
--- a/test/mp4video.htm Fri Sep 21 11:18:57 2012 +0900
+++ b/test/mp4video.htm Mon Sep 24 18:32:22 2012 +0200
@@ -37,10 +37,7 @@
{ type: "Controller" },
{ type: "Polemic" },
{ type: "Segments" },
- { type: "Slice" },
- { type: "Arrow" },
{ type: "Annotation" },
- { type: "CreateAnnotation" },
{ type: "Tweet" },
{ type: "Tagcloud" },
{
diff -r d7d56ea2d0a6 -r eadb7290c325 test/oggvideo.htm
--- a/test/oggvideo.htm Fri Sep 21 11:18:57 2012 +0900
+++ b/test/oggvideo.htm Mon Sep 24 18:32:22 2012 +0200
@@ -34,10 +34,7 @@
{ type: "Controller" },
{ type: "Polemic" },
{ type: "Segments" },
- { type: "Slice" },
- { type: "Arrow" },
{ type: "Annotation" },
- { type: "CreateAnnotation" },
{ type: "Tweet" },
{ type: "Tagcloud" },
{
diff -r d7d56ea2d0a6 -r eadb7290c325 test/renkan.htm
--- a/test/renkan.htm Fri Sep 21 11:18:57 2012 +0900
+++ b/test/renkan.htm Mon Sep 24 18:32:22 2012 +0200
@@ -63,11 +63,6 @@
{ type: "Controller" },
{ type: "Polemic" },
{ type: "Segments" },
- { type: "Slice" },
- {
- type: "Arrow",
- base_height: 4
- },
{ type: "Annotation" },
{ type: "Tweet" },
{
diff -r d7d56ea2d0a6 -r eadb7290c325 test/slideshare.htm
--- a/test/slideshare.htm Fri Sep 21 11:18:57 2012 +0900
+++ b/test/slideshare.htm Mon Sep 24 18:32:22 2012 +0200
@@ -56,13 +56,10 @@
{ type: "Controller" },
{ type: "Polemic" },
{ type: "Segments" },
- { type: "Slice" },
- { type: "Arrow" },
{ type: "Annotation" },
{
- type: "CreateAnnotation",
- api_endpoint_template: "/pf/ldtplatform/api/ldt/annotations/{{id}}.json",
- creator_name: "Metadataplayer"
+ type: "Segments",
+ annotation_type: "Slide"
},
{ type: "Tweet" },
{
diff -r d7d56ea2d0a6 -r eadb7290c325 test/vimeo.htm
--- a/test/vimeo.htm Fri Sep 21 11:18:57 2012 +0900
+++ b/test/vimeo.htm Mon Sep 24 18:32:22 2012 +0200
@@ -34,8 +34,6 @@
{ type: "Controller" },
{ type: "Polemic" },
{ type: "Segments" },
- { type: "Slice" },
- { type: "Arrow" },
{ type: "Annotation" },
{ type: "CreateAnnotation" },
{ type: "Tweet" },
diff -r d7d56ea2d0a6 -r eadb7290c325 test/youtube.htm
--- a/test/youtube.htm Fri Sep 21 11:18:57 2012 +0900
+++ b/test/youtube.htm Mon Sep 24 18:32:22 2012 +0200
@@ -34,8 +34,6 @@
{ type: "Controller" },
{ type: "Polemic" },
{ type: "Segments" },
- { type: "Slice" },
- { type: "Arrow" },
{ type: "Annotation" },
{ type: "CreateAnnotation" },
{ type: "Tweet" },