--- a/src/js/players/player.jwplayer.js Wed Jun 06 19:36:55 2012 +0200
+++ b/src/js/players/player.jwplayer.js Thu Jun 07 18:52:46 2012 +0200
@@ -3,26 +3,28 @@
/** jwplayer player wrapper */
IriSP.PopcornReplacement.jwplayer = function(container, options) {
- /* appel du parent pour initialiser les structures communes à tous les players */
- IriSP.PopcornReplacement.player.call(this, container, options);
+ /* appel du parent pour initialiser les structures communes à tous les players */
+ IriSP.PopcornReplacement.player.call(this, container, options);
- this.media.duration = options.duration; /* optional */
+ this.media.duration = options.duration; /* optional */
+
+ var _player = jwplayer(this.container);
/* Définition des fonctions de l'API - */
- this.playerFns = {
- play: function() { return jwplayer(this.container).play(); },
- pause: function() { return jwplayer(this.container).pause(); },
- getPosition: function() { return jwplayer(this.container).getPosition(); },
- seek: function(pos) { return jwplayer(this.container).seek(pos); },
- getMute: function() { return jwplayer(this.container).getMute() },
- setMute: function(p) { return jwplayer(this.container).setMute(p); },
- getVolume: function() { return jwplayer(this.container).getVolume() / 100; },
- setVolume: function(p) { return jwplayer(this.container).setVolume(Math.floor(100*p)); }
- }
+ this.playerFns = {
+ play: function() { return _player.play(); },
+ pause: function() { return _player.pause(); },
+ getPosition: function() { return _player.getPosition(); },
+ seek: function(pos) { return _player.seek(pos); },
+ getMute: function() { return _player.getMute() },
+ setMute: function(p) { return _player.setMute(p); },
+ getVolume: function() { return _player.getVolume() / 100; },
+ setVolume: function(p) { return _player.setVolume(Math.floor(100*p)); }
+ }
- options.events = this.callbacks;
+ options.events = this.callbacks;
- jwplayer(this.container).setup(options);
+ _player.setup(options);
};
IriSP.PopcornReplacement.jwplayer.prototype = new IriSP.PopcornReplacement.player("", {});
--- a/src/js/serializers/ldt.js Wed Jun 06 19:36:55 2012 +0200
+++ b/src/js/serializers/ldt.js Thu Jun 07 18:52:46 2012 +0200
@@ -99,8 +99,8 @@
if (typeof _data.meta["dc:source"] !== "undefined" && typeof _data.meta["dc:source"].content !== "undefined") {
_res.source = JSON.parse(_data.meta["dc:source"].content);
}
- if (typeof _data.audio !== "undefined" && _data.audio.href) {
- _res.audio = _data.audio;
+ if (typeof _data.content.audio !== "undefined" && _data.content.audio.href) {
+ _res.audio = _data.content.audio;
}
return _res;
},
@@ -111,7 +111,8 @@
end : _data.end.milliseconds,
content : {
title : _data.title,
- description : _data.description
+ description : _data.description,
+ audio : _data.audio
},
media : _source.unNamespace(_data.media.id),
meta : {
@@ -124,8 +125,7 @@
return {
"id-ref" : _source.unNamespace(_id)
}
- }),
- audio : _data.audio
+ })
}
}
},