# HG changeset patch
# User verrierj
# Date 1328796863 -3600
# Node ID 2cea1d92b19db9ddd24a51801f9dda7b929a0bf2
# Parent 0313c23ffe7e89363606d56510e79d9968ef990a# Parent f051a2432970e5bbda2fcff5625d4c22d9b56368
Merge with f051a2432970e5bbda2fcff5625d4c22d9b56368
diff -r 0313c23ffe7e -r 2cea1d92b19d src/ldt/ldt/static/ldt/css/LdtPlayer.css
--- a/src/ldt/ldt/static/ldt/css/LdtPlayer.css Thu Feb 09 15:13:32 2012 +0100
+++ b/src/ldt/ldt/static/ldt/css/LdtPlayer.css Thu Feb 09 15:14:23 2012 +0100
@@ -110,13 +110,8 @@
font-size:12px;
}
-.Ldt-SaKeyword{
- background-color:#b9b9b9;
- color:#4D4D4D;
- padding:5px;
- font-weight:bold;
- text-align:left;
- float:left;
+.Ldt-SaKeywords {
+ font-weight:bold;
font-size:10px;
}
diff -r 0313c23ffe7e -r 2cea1d92b19d src/ldt/ldt/static/ldt/css/imgs/user_default_icon.png
Binary file src/ldt/ldt/static/ldt/css/imgs/user_default_icon.png has changed
diff -r 0313c23ffe7e -r 2cea1d92b19d src/ldt/ldt/static/ldt/css/imgs/video_sequence.png
Binary file src/ldt/ldt/static/ldt/css/imgs/video_sequence.png has changed
diff -r 0313c23ffe7e -r 2cea1d92b19d src/ldt/ldt/static/ldt/js/LdtPlayer-release.js
--- a/src/ldt/ldt/static/ldt/js/LdtPlayer-release.js Thu Feb 09 15:13:32 2012 +0100
+++ b/src/ldt/ldt/static/ldt/js/LdtPlayer-release.js Thu Feb 09 15:14:23 2012 +0100
@@ -1090,7 +1090,7 @@
IriSP.annotation_template = "{{! template for an annotation displayed in a segmentWidget }}
";
IriSP.annotationWidget_template = "{{! template for the annotation widget }}";
IriSP.annotation_loading_template = "{{! template shown while the annotation widget is loading }}";
-IriSP.annotationsListWidget_template = "{{! template for the annotation list widget }}";
+IriSP.annotationsListWidget_template = "{{! template for the annotation list widget }}";
IriSP.arrowWidget_template = "";
IriSP.createAnnotationWidget_template = "{{! template for the annotation creation widget }}";
IriSP.createAnnotationWidget_festivalCinecast_template = "{{! template for the annotation creation widget specific for the cinecast festival}}";
@@ -1731,17 +1731,22 @@
"imgs": "/mdp/src/css/imgs"
};
-IriSP.user = {
- "name" : "loic",
- "avatar" : "http://a1.twimg.com/profile_images/39270812/loicempuria_normal.jpg"
-};
-
IriSP.defaults.default_templates_vars = function() {
return {
"img_dir" : IriSP.paths.imgs
};
}
+/*
+Override this if you want to change the info the player receives about the user.
+It's typically overrided in server-side templates with user-specific data.
+*/
+IriSP.defaults.user = function() {
+ return {
+ "name" : "Anonymous user",
+ "avatar" : IriSP.paths.imgs + "/user_default_icon.png"
+ }
+};
/* the widget classes and definitions */
/**
@@ -2056,7 +2061,9 @@
/** configure modules. @see configureWidgets */
IriSP.configureModules = function (popcornInstance, modulesList) {
-
+ if (IriSP.null_or_undefined(modulesList))
+ return;
+
var serialFactory = new IriSP.SerializerFactory(IriSP.__dataloader);
var ret_modules = [];
var index;
@@ -2145,6 +2152,11 @@
IriSP.paths = IriSP.underscore.defaults(IriSP.paths, IriSP.defaults.paths);
IriSP.default_templates_vars = IriSP.underscore.defaults(IriSP.default_templates_vars,
IriSP.defaults.default_templates_vars());
+
+ if (IriSP.null_or_undefined(IriSP.user))
+ IriSP.user = {};
+
+ IriSP.user = IriSP.underscore.defaults(IriSP.user, IriSP.defaults.user());
};
/** single point of entry for the metadataplayer */
@@ -2165,31 +2177,56 @@
/** jwplayer player wrapper */
IriSP.PopcornReplacement.dailymotion = function(container, options) {
+ console.log("Calling");
/* appel du parent pour initialiser les structures communes à tous les players */
- IriSP.PopcornReplacement.player.call(this, container, options);
-
+ IriSP.PopcornReplacement.player.call(this, container, options);
+
var _this = this;
/* Définition des fonctions de l'API - */
this.playerFns = {
play : function() {
- return _this.player.playVideo();
+ if (_this.player) {
+ return _this.player.playVideo();
+ } else {
+ return false;
+ }
},
pause : function() {
- return _this.player.pauseVideo();
+ if (_this.player) {
+ return _this.player.pauseVideo();
+ } else {
+ return false;
+ }
},
getPosition : function() {
- return _this.player.getCurrentTime();
+ if (_this.player) {
+ return _this.player.getCurrentTime();
+ } else {
+ return 0;
+ }
},
seek : function(pos) {
- return _this.player.seekTo(pos);
+ if (_this.player) {
+ return _this.player.seekTo(pos);
+ } else {
+ return false;
+ }
},
getMute : function() {
- return _this.player.isMuted();
+ if (_this.player) {
+ return _this.player.isMuted();
+ } else {
+ return false;
+ }
},
setMute : function(p) {
- return p ? _this.player.mute() : _this.player.unMute();
+ if (_this.player) {
+ return p ? _this.player.mute() : _this.player.unMute();
+ } else {
+ return false;
+ }
}
}
@@ -2198,7 +2235,8 @@
window.onDailymotionVideoProgress = IriSP.wrap(this, this.progressHandler);
var params = {
- allowScriptAccess : "always"
+ "allowScriptAccess" : "always",
+ "wmode": "opaque"
};
var atts = {
id : this.container
@@ -2215,7 +2253,9 @@
this.player.addEventListener("onStateChange", "onDailymotionStateChange");
this.player.addEventListener("onVideoProgress", "onDailymotionVideoProgress");
- this.player.loadVideoByUrl(this._options.video);
+ this.player.cueVideoByUrl(this._options.video);
+
+ this.callbacks.onReady();
};
IriSP.PopcornReplacement.dailymotion.prototype.progressHandler = function(progressInfo) {
@@ -2237,16 +2277,19 @@
break;
case 3:
- this.callbacks.onSeek();
+ this.callbacks.onSeek({
+ position: this.player.getCurrentTime()
+ });
break;
+ /*
case 5:
this.callbacks.onReady();
break;
+ */
}
-};
-/* To wrap a player the develop should create a new class derived from
+};/* To wrap a player the develop should create a new class derived from
the IriSP.PopcornReplacement.player and defining the correct functions */
/** jwplayer player wrapper */
@@ -2919,17 +2962,17 @@
}
_this.selector.find(".Ldt-createAnnotation-Description").val(newVal);
- // we use a custom event because there's no simple way to test for a js
- // change in a textfield.
- _this.selector.find(".Ldt-createAnnotation-Description").trigger("js_mod");
+
// also call our update function.
_this.handleTextChanges();
}
}(polemic));
}
+ // js_mod is a custom event because there's no simple way to test for a js
+ // change in a textfield.
this.selector.find(".Ldt-createAnnotation-Description")
- .bind("propertychange keyup input paste", IriSP.wrap(this, this.handleTextChanges));
+ .bind("propertychange keyup input paste js_mod", IriSP.wrap(this, this.handleTextChanges));
/* the cinecast version of the player is supposed to pause when the user clicks on the button */
if (this.cinecast_version) {
@@ -4668,9 +4711,16 @@
var duration = +this._serializer.currentMedia().meta["dc:duration"];
var time_step = Math.round(duration / num_columns); /* the time interval between two columns */
var begin = +annotation.begin;
-
- var index = Math.floor(begin / time_step);
- this._results[index]++;
+ var end = +annotation.end;
+
+ /* increment all the values between the beginning and the end of the annotation */
+ var index_begin = Math.floor(begin / time_step);
+ var index_end = Math.floor(end / time_step);
+
+ for (var i = index_begin; i < Math.min(index_end, this._results.length); i++) {
+ this._results[i]++;
+ }
+
this.selector.find(".Ldt-sparkLine").sparkline(this._results, {lineColor: "#7492b4", fillColor: "#aeaeb8",
spotColor: "#b70056",
width: this.width, height: this.height});