src/js/players/player.jwplayer.js
author hamidouk
Wed, 25 Jan 2012 16:04:59 +0100
branchpopcorn-port
changeset 711 323205a7bd39
child 839 4357aac4eb19
permissions -rw-r--r--
separated jwplayer code from pop.js and put it into its own folder, players/.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
711
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
     1
/* To wrap a player the develop should create a new class derived from 
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
     2
   the IriSP.PopcornReplacement.player and defining the correct functions */
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
     3
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
     4
/** jwplayer player wrapper */
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
     5
IriSP.PopcornReplacement.jwplayer = function(container, options) {
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
     6
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
     7
  /* appel du parent pour initialiser les structures communes à tous les players */
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
     8
  IriSP.PopcornReplacement.player.call(this, container, options);
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
     9
  
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
    10
  this.media.duration = options.duration; /* optional */
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
    11
  
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
    12
  /* Définition des fonctions de l'API -  */
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
    13
  this.playerFns = {
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
    14
    play: function() { return jwplayer(this.container).play(); },
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
    15
    pause: function() { return jwplayer(this.container).pause(); },
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
    16
    getPosition: function() { return jwplayer(this.container).getPosition(); },
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
    17
    seek: function(pos) { return jwplayer(this.container).seek(pos); },
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
    18
    getMute: function() { return jwplayer(this.container).getMute() },
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
    19
    setMute: function(p) { return jwplayer(this.container).setMute(p); }
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
    20
  }
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
    21
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
    22
  options.events = this.callbacks;
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
    23
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
    24
  jwplayer(this.container).setup(options);
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
    25
};
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
    26
323205a7bd39 separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff changeset
    27
IriSP.PopcornReplacement.jwplayer.prototype = new IriSP.PopcornReplacement.player("", {});