| author | cavaliet |
| Thu, 10 May 2012 18:36:38 +0200 | |
| changeset 886 | ab69ff6fa02b |
| parent 839 | 4357aac4eb19 |
| child 914 | 3238d1625df9 |
| permissions | -rw-r--r-- |
|
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 |
/* 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
|
7 |
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
|
8 |
|
|
323205a7bd39
separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff
changeset
|
9 |
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
|
10 |
|
|
323205a7bd39
separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff
changeset
|
11 |
/* 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
|
12 |
this.playerFns = { |
|
323205a7bd39
separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff
changeset
|
13 |
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
|
14 |
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
|
15 |
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
|
16 |
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
|
17 |
getMute: function() { return jwplayer(this.container).getMute() }, |
| 839 | 18 |
setMute: function(p) { return jwplayer(this.container).setMute(p); }, |
19 |
getVolume: function() { return jwplayer(this.container).getVolume() / 100; }, |
|
20 |
setVolume: function(p) { return jwplayer(this.container).setVolume(Math.floor(100*p)); } |
|
|
711
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 |
|
|
323205a7bd39
separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff
changeset
|
23 |
options.events = this.callbacks; |
|
323205a7bd39
separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff
changeset
|
24 |
|
|
323205a7bd39
separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff
changeset
|
25 |
jwplayer(this.container).setup(options); |
|
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 |
|
|
323205a7bd39
separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff
changeset
|
28 |
IriSP.PopcornReplacement.jwplayer.prototype = new IriSP.PopcornReplacement.player("", {}); |