# HG changeset patch # User hamidouk # Date 1328025248 -3600 # Node ID d60401f66984d5edf513b324e005540d60866c88 # Parent b119a956b6473fc45b337669e8177e232d6aef34 first version of the youtube compatible player. diff -r b119a956b647 -r d60401f66984 src/js/players/player.youtube.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/js/players/player.youtube.js Tue Jan 31 16:54:08 2012 +0100 @@ -0,0 +1,35 @@ +/* To wrap a player the develop should create a new class derived from + the IriSP.PopcornReplacement.player and defining the correct functions */ + +/** youtube player wrapper */ +IriSP.PopcornReplacement.youtube = 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; + var params = { allowScriptAccess: "always" }; + var atts = { id: "ytplayer" }; + swfobject.embedSWF("http://www.youtube.com/v/QH2-TGUlwu4?enablejsapi=1&playerapiid=ytplayer&version=3", + container, "425", "356", "8", null, null, params, atts); + +}; + +IriSP.PopcornReplacement.jwplayer.prototype = new IriSP.PopcornReplacement.player("", {}); + +IriSP.PopcornReplacement.jwplayer.prototype.stateHandler = function(state) { + +}; \ No newline at end of file