Updated Flowplayer initialization
authorThierry Florac <thierry.florac@onf.fr>
Wed, 09 Sep 2015 11:51:38 +0200
changeset 14 61775c0158f3
parent 13 370b8d6fc9e6
child 15 d1477fa29943
Updated Flowplayer initialization
src/pyams_media/skin/resources/js/pyams_media.js
src/pyams_media/skin/resources/js/pyams_media.min.js
--- a/src/pyams_media/skin/resources/js/pyams_media.js	Wed Sep 09 11:20:57 2015 +0200
+++ b/src/pyams_media/skin/resources/js/pyams_media.js	Wed Sep 09 11:51:38 2015 +0200
@@ -2,20 +2,15 @@
 
 	window.PyAMS_media = {
 
-		initPlayer: function(element) {
-			MyAMS.dialog.registerShownCallback(PyAMS_media.initPlayerDialog, element);
-			var players = $('.flowplayer', element);
-			if (players.exists()) {
-				players.each(function () {
-					var player = $(this);
-					var flowplayer = $(player).flowplayer();
-					var events = player.data('ams-flowplayer-events');
-					if (events) {
-						for (var event in events) {
-							flowplayer.on(event, MyAMS.getFunctionByName(events[event]));
-						}
-					}
-				});
+		initPlayer: function() {
+			var player = $(this);
+			MyAMS.dialog.registerShownCallback(PyAMS_media.initPlayerDialog, player);
+			var flowplayer = player.flowplayer();
+			var events = player.data('ams-flowplayer-events');
+			if (events) {
+				for (var event in events) {
+					flowplayer.on(event, MyAMS.getFunctionByName(events[event]));
+				}
 			}
 		},
 
--- a/src/pyams_media/skin/resources/js/pyams_media.min.js	Wed Sep 09 11:20:57 2015 +0200
+++ b/src/pyams_media/skin/resources/js/pyams_media.min.js	Wed Sep 09 11:51:38 2015 +0200
@@ -1,1 +1,1 @@
-(function(a){window.PyAMS_media={initPlayer:function(b){MyAMS.dialog.registerShownCallback(PyAMS_media.initPlayerDialog,b);var c=a(".flowplayer",b);if(c.exists()){c.each(function(){var f=a(this);var d=a(f).flowplayer();var e=f.data("ams-flowplayer-events");if(e){for(var g in e){d.on(g,MyAMS.getFunctionByName(e[g]))}}})}},initPlayerDialog:function(){var b=a(this);a(".modal-viewport",b).removeAttr("style").removeClass("modal-viewport")},getPlayerTime:function(h,f){var d=a(this);var c=d.data("flowplayer");var b=c.video.time;var g=d.parents("form");a('INPUT[name="form.widgets.time"]',g).val(b)}}})(jQuery);
\ No newline at end of file
+(function(a){window.PyAMS_media={initPlayer:function(){var d=a(this);MyAMS.dialog.registerShownCallback(PyAMS_media.initPlayerDialog,d);var b=d.flowplayer();var c=d.data("ams-flowplayer-events");if(c){for(var e in c){b.on(e,MyAMS.getFunctionByName(c[e]))}}},initPlayerDialog:function(){var b=a(this);a(".modal-viewport",b).removeAttr("style").removeClass("modal-viewport")},getPlayerTime:function(h,f){var d=a(this);var c=d.data("flowplayer");var b=c.video.time;var g=d.parents("form");a('INPUT[name="form.widgets.time"]',g).val(b)}}})(jQuery);
\ No newline at end of file