| author | veltr |
| Tue, 12 Jun 2012 19:44:20 +0200 | |
| branch | new-model |
| changeset 916 | ec6849bbbdcc |
| parent 914 | 3238d1625df9 |
| child 919 | 972099304059 |
| 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) { |
| 914 | 6 |
/* appel du parent pour initialiser les structures communes à tous les players */ |
7 |
IriSP.PopcornReplacement.player.call(this, container, options); |
|
|
711
323205a7bd39
separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff
changeset
|
8 |
|
| 914 | 9 |
this.media.duration = options.duration; /* optional */ |
10 |
|
|
11 |
var _player = jwplayer(this.container); |
|
|
711
323205a7bd39
separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff
changeset
|
12 |
|
|
323205a7bd39
separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff
changeset
|
13 |
/* Définition des fonctions de l'API - */ |
| 914 | 14 |
this.playerFns = { |
15 |
play: function() { return _player.play(); }, |
|
16 |
pause: function() { return _player.pause(); }, |
|
17 |
getPosition: function() { return _player.getPosition(); }, |
|
18 |
seek: function(pos) { return _player.seek(pos); }, |
|
19 |
getMute: function() { return _player.getMute() }, |
|
20 |
setMute: function(p) { return _player.setMute(p); }, |
|
21 |
getVolume: function() { return _player.getVolume() / 100; }, |
|
22 |
setVolume: function(p) { return _player.setVolume(Math.floor(100*p)); } |
|
23 |
} |
|
|
711
323205a7bd39
separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff
changeset
|
24 |
|
| 914 | 25 |
options.events = this.callbacks; |
|
711
323205a7bd39
separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff
changeset
|
26 |
|
| 914 | 27 |
_player.setup(options); |
|
711
323205a7bd39
separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff
changeset
|
28 |
}; |
|
323205a7bd39
separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff
changeset
|
29 |
|
|
323205a7bd39
separated jwplayer code from pop.js and put it into its own folder, players/.
hamidouk
parents:
diff
changeset
|
30 |
IriSP.PopcornReplacement.jwplayer.prototype = new IriSP.PopcornReplacement.player("", {}); |