diff options
| author | Pepper <pepper@scannerjammer.com> | 2015-05-20 11:16:13 -0400 |
|---|---|---|
| committer | Pepper <pepper@scannerjammer.com> | 2015-05-20 11:16:13 -0400 |
| commit | a4916103efb2d97896c456ff0e83064b21e85d25 (patch) | |
| tree | b3eb529e4b96375109626bbeada35d4f8a2667ee /frontend/static/js/src/vimeo.js | |
| parent | 3790eedc2f48c725c586b8c7b924875fedbeb7b4 (diff) | |
first commit in a while
Diffstat (limited to 'frontend/static/js/src/vimeo.js')
| -rw-r--r-- | frontend/static/js/src/vimeo.js | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/frontend/static/js/src/vimeo.js b/frontend/static/js/src/vimeo.js new file mode 100644 index 0000000..9680b00 --- /dev/null +++ b/frontend/static/js/src/vimeo.js @@ -0,0 +1,99 @@ +var Vimeo = + { + type: "vimeo", + loaded: false, + pending: false, + playing: false, + player: null, + playerId: null, + timeout: null, + video: null, + width: "100%", + height: "100%", + volume: 1,//from 100...some sort of error + play: function (video) + { + d.warn("VIMEO PLAY "+video.key) + if (video.error) + return Vimeo.error() + if (Vimeo.playing) + Vimeo.stop() + $("#screen").html("<div id='vimeo'></div>") + Vimeo.video = video + Vimeo.playing = true + var params = { allowScriptAccess: "always", wmode: "opaque", } + var atts = { id: "vimeo" } + var flashvars = { api: 1 } + swfobject.embedSWF("http://vimeo.com/moogaloop.swf?clip_id="+video.name+"&server=vimeo.com&color=00adef&api=1", + "vimeo", "100%","100%", "8", null, flashvars, params, atts) + // $("#vimeo").html('<iframe src="http://player.vimeo.com/video/'+video.name+'?api=1" width="100%" height="100%" frameborder="0"></iframe>') + }, + toggle: function () + { + if (Vimeo.player.api_paused()) + return Vimeo.resume() + else + return Vimeo.pause() + }, + error: function (s) + { + Player.error("VIMEO "+s) + Vimeo.finish() + }, + setVolume: function (vol) + { + Vimeo.volume = vol + Vimeo.player.api_setVolume(vol) + }, + pause: function () + { + d.warn("PAUSED PLAYBACK") + Vimeo.playing = false + Vimeo.player.api_pause() + return true + }, + resume: function () + { + d.warn("RESUME PLAYBACK") + Vimeo.playing = true + Vimeo.player.api_play() + return false + }, + stop: function () + { + d.warn("VIMEO STOP") + Vimeo.playing = false + }, + finish: function () + { + d.warn("VIMEO FINISH") + Vimeo.playing = false + swfobject.removeSWF("vimeo") + Player.finish() + }, + load: function () + { + d.warn("LOADING VIMEO") + Vimeo.loaded = true + }, + unload: function () + { + d.warn("VIMEO UNLOADED") + swfobject.removeSWF("vimeo") + Vimeo.loaded = false + }, + init: function () + { + d.warn("VIMEO INIT") + } + } +function vimeo_player_loaded() + { + d.warn("VIMEO LOADED") + Vimeo.player = document.getElementById('vimeo') + Vimeo.player.api_play() + // Vimeo.player.addEventListener("finish", "Vimeo.finish") + Vimeo.player.api_addEventListener("finish", "Vimeo.finish") + Vimeo.player.api_setVolume(Vimeo.volume) + } +Player.register(Vimeo) |
