PageUp and PageDown shortcut keys for volume control

This commit is contained in:
sanj 2010-02-23 12:21:06 +05:30
parent e106f39f25
commit 35f74aa1ed
3 changed files with 49 additions and 29 deletions

View File

@ -12,7 +12,8 @@ Player.prototype.get = function() { }
Player.prototype.listener = function() { } Player.prototype.listener = function() { }
Player.prototype.set = function(pos) { } Player.prototype.set = function(pos) { }
Player.prototype.mute = function(pos) { } Player.prototype.mute = function(pos) { }
Player.prototype.volUp = function() { }
Player.prototype.volDown = function() { }
Player.prototype.seekFwd = function(ms) { Player.prototype.seekFwd = function(ms) {
var currentMs = this.get(); var currentMs = this.get();
var newMs = currentMs + ms; var newMs = currentMs + ms;
@ -47,6 +48,20 @@ VideoPlayer.prototype.init = function(elemID) {
this.height = $(this.player).attr('height'); 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) { VideoPlayer.prototype.set = function(pos) {
/* var url = this.url(pos); /* var url = this.url(pos);
var autoplay = 'true'; var autoplay = 'true';

View File

@ -102,7 +102,19 @@ $(document).ready(function() {
if (e.keyCode == 32 && textArea.hasFocus == false) { if (e.keyCode == 32 && textArea.hasFocus == false) {
Video.togglePause(); Video.togglePause();
} }
//PageUp - volume Up:
if (e.keyCode == 33) {
Video.volUp();
return false;
}
if (e.keyCode == 34) {
Video.volDown();
return false;
}
}); });
$('#fillMeta').click(function() { $('#fillMeta').click(function() {
$('#txtWrapper').hide(); $('#txtWrapper').hide();
$('#eventMetadata').show(); $('#eventMetadata').show();

View File

@ -1,29 +1,22 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<RDF:RDF xmlns:em="http://www.mozilla.org/2004/em-rdf#"
<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:NC="http://home.netscape.com/NC-rdf#"
xmlns:em="http://www.mozilla.org/2004/em-rdf#"> xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<RDF:Description RDF:about="urn:mozilla:install-manifest"
<Description about="urn:mozilla:install-manifest"> em:id="b@pad.ma"
<em:id>b@pad.ma</em:id> em:version="0.2"
<em:version>0.2</em:version> em:type="2"
<em:type>2</em:type> em:name="pad.ma transcription client"
em:description="pad.ma offline transcription client"
<!-- Target Application this extension can install into, em:creator="pad.ma"
with minimum and maximum supported versions. --> em:updateURL="http://files.pad.ma/speedtrans/update.rdf"
<em:targetApplication> em:homepageURL="http://files.pad.ma/speedtrans/"
<Description> em:iconURL="chrome://speedtrans/content/icon.png"
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> em:updateKey="MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDZutlQBmSw+Pc2G6DvJkhOFsKrh5bcGqnzCOvgZiRCgFVKYKM0M0h9zosV9t/pfUIfHHDeYp9L1GR6gPJnwWdDTC/LCV2K7M9K5L5cF5et+0Tf0yfchOnCx+SAQyJ++8DAyN2mgNtNPXfZrpz1vCePf6TLQuKciobrXPJa+aji2wIDAQAB">
<em:minVersion>1.5</em:minVersion> <em:targetApplication RDF:resource="rdf:#$uOho32"/>
<em:maxVersion>3.9</em:maxVersion> </RDF:Description>
</Description> <RDF:Description RDF:about="rdf:#$uOho32"
</em:targetApplication> em:id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}"
<!-- Front End MetaData --> em:minVersion="1.5"
<em:name>pad.ma transcription client</em:name> em:maxVersion="3.9" />
<em:description>pad.ma offline transcription client</em:description> </RDF:RDF>
<em:creator>pad.ma</em:creator>
<em:updateURL>http://files.pad.ma/annot/update.rdf</em:updateURL>
<em:updateKey>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCcI+EIEmZ2UMEMzksirJQ6rbRZebeQzM9LCf9i7EZny5umQOF+92G+DxlKrk1BC+B1ZhXHMZNBRWEhn9kuW8mgXL1JBKVPbg4RjbJ39XigtXL5wNWU6EVdUvzFH1D49HwGpDRWJhnlUTMFhJL2FW47Qg1yCttQSEYmmSum3Y77rwIDAQAB</em:updateKey>
<em:homepageURL>http://wiki.pad.ma/wiki/Annot</em:homepageURL>
<em:iconURL>chrome://annot/content/icon.png</em:iconURL>
</Description>
</RDF>