separated jwplayer code from pop.js and put it into its own folder, players/. popcorn-port
authorhamidouk
Wed, 25 Jan 2012 16:04:59 +0100
branchpopcorn-port
changeset 711 323205a7bd39
parent 710 ea5f2fa37edb
child 712 d5da7aca0f13
separated jwplayer code from pop.js and put it into its own folder, players/.
sbin/build/client.xml
src/js/players/player.jwplayer.js
src/js/pop.js
--- a/sbin/build/client.xml	Wed Jan 25 15:41:10 2012 +0100
+++ b/sbin/build/client.xml	Wed Jan 25 16:04:59 2012 +0100
@@ -61,6 +61,11 @@
       <!-- core files -->
     	<filelist dir="../../src/js" files="utils.js pop.js data.js site.js ui.js widgets.js modules.js layout.js init.js" />
 
+      <!-- players -->
+			<fileset dir="../../src/js/players" casesensitive="yes">
+					<include name="**/*.js"/>					
+			</fileset>
+
       <!-- modules -->
 			<fileset dir="../../src/js/modules" casesensitive="yes">
 					<include name="**/*.js"/>					
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/js/players/player.jwplayer.js	Wed Jan 25 16:04:59 2012 +0100
@@ -0,0 +1,27 @@
+/* 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 */
+IriSP.PopcornReplacement.jwplayer = function(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 */
+  
+  /* 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); }
+  }
+
+  options.events = this.callbacks;
+
+  jwplayer(this.container).setup(options);
+};
+
+IriSP.PopcornReplacement.jwplayer.prototype = new IriSP.PopcornReplacement.player("", {});
--- a/src/js/pop.js	Wed Jan 25 15:41:10 2012 +0100
+++ b/src/js/pop.js	Wed Jan 25 16:04:59 2012 +0100
@@ -216,32 +216,4 @@
 IriSP.PopcornReplacement.player.prototype.roundTime = function() {
   var currentTime = this.currentTime();
   return Math.round(currentTime);
-};
-
-/* To wrap a player the develop should create a new class derived from 
-   the IriSP.PopcornReplacement.player and defining the correct functions */
-
-/* Exemple with jwplayer */
-IriSP.PopcornReplacement.jwplayer = function(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 */
-  
-  /* 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); }
-  }
-
-  options.events = this.callbacks;
-
-  jwplayer(this.container).setup(options);
-};
-
-IriSP.PopcornReplacement.jwplayer.prototype = new IriSP.PopcornReplacement.player("", {});
+};
\ No newline at end of file