From 35f74aa1ed016c25f14e061e6aba4faa617bde61 Mon Sep 17 00:00:00 2001 From: sanj Date: Tue, 23 Feb 2010 12:21:06 +0530 Subject: [PATCH] PageUp and PageDown shortcut keys for volume control --- chrome/content/player.js | 17 +++++++++++- chrome/content/transcribe.html | 12 +++++++++ install.rdf | 49 +++++++++++++++------------------- 3 files changed, 49 insertions(+), 29 deletions(-) diff --git a/chrome/content/player.js b/chrome/content/player.js index fe9572c..294ad9e 100755 --- a/chrome/content/player.js +++ b/chrome/content/player.js @@ -12,7 +12,8 @@ Player.prototype.get = function() { } Player.prototype.listener = function() { } Player.prototype.set = function(pos) { } Player.prototype.mute = function(pos) { } - +Player.prototype.volUp = function() { } +Player.prototype.volDown = function() { } Player.prototype.seekFwd = function(ms) { var currentMs = this.get(); var newMs = currentMs + ms; @@ -47,6 +48,20 @@ VideoPlayer.prototype.init = function(elemID) { this.height = $(this.player).attr('height'); } +VideoPlayer.prototype.volUp = function() { + var vol = this.player.volume; + if (vol <= 0.9) { var newVol = vol + 0.1 } else { return false; } + this.player.volume = newVol; + return true; + } + +VideoPlayer.prototype.volDown = function() { + var vol = this.player.volume; + if (vol >= 0.1) { var newVol = vol - 0.1 } else { return false; } + this.player.volume = newVol; + return true; + } + VideoPlayer.prototype.set = function(pos) { /* var url = this.url(pos); var autoplay = 'true'; diff --git a/chrome/content/transcribe.html b/chrome/content/transcribe.html index 78fa305..a99aa57 100755 --- a/chrome/content/transcribe.html +++ b/chrome/content/transcribe.html @@ -102,7 +102,19 @@ $(document).ready(function() { if (e.keyCode == 32 && textArea.hasFocus == false) { Video.togglePause(); } + + //PageUp - volume Up: + if (e.keyCode == 33) { + Video.volUp(); + return false; + } + + if (e.keyCode == 34) { + Video.volDown(); + return false; + } }); + $('#fillMeta').click(function() { $('#txtWrapper').hide(); $('#eventMetadata').show(); diff --git a/install.rdf b/install.rdf index 7db23cc..64184df 100644 --- a/install.rdf +++ b/install.rdf @@ -1,29 +1,22 @@ - - - - - b@pad.ma - 0.2 - 2 - - - - - {ec8030f7-c20a-464f-9b0e-13a3a9e97384} - 1.5 - 3.9 - - - - pad.ma transcription client - pad.ma offline transcription client - pad.ma - http://files.pad.ma/annot/update.rdf - MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCcI+EIEmZ2UMEMzksirJQ6rbRZebeQzM9LCf9i7EZny5umQOF+92G+DxlKrk1BC+B1ZhXHMZNBRWEhn9kuW8mgXL1JBKVPbg4RjbJ39XigtXL5wNWU6EVdUvzFH1D49HwGpDRWJhnlUTMFhJL2FW47Qg1yCttQSEYmmSum3Y77rwIDAQAB - http://wiki.pad.ma/wiki/Annot - chrome://annot/content/icon.png - - + + + + + +