function $ (selector, event, func) { if (!document.querySelectorAll) return false; var tab = document.querySelectorAll(selector); for (var i=0; i=3600? h + ':' :'') + (m<10?'0':'') +m + ':' + (s<10?'0':'') +s; } function mmChangeSeek (mm, play, seek, seeklbl, vol, vollbl) { mm.currentTime = seek.value/1000.0; mmUpdate(mm, play, seek, seeklbl, false); } function mmChangeVol (mm, play, seek, seeklbl, vol, vollbl) { mm.volume = vol.value/100.0; var text = Math.round(mm.volume*100) +'%'; vollbl.innerHTML = text; vol.setAttribute('aria-valuenow', vol.value); vol.setAttribute('aria-valuetext', text); } function mmKeyDown (e, mm, play, seek, seeklbl, vol, vollbl) { var k = e.keyCode || e.which; if (k==37) { mm.currentTime = Math.max(mm.currentTime -5, 0); mmUpdate(mm, play, seek, seeklbl, false); if (this.select) this.select(); return false; } else if (k==39) { mm.currentTime = Math.min(mm.currentTime +5, mm.duration); mmUpdate(mm, play, seek, seeklbl, false); if (this.select) this.select(); return false; } else if (k==33) { mm.currentTime = Math.max(mm.currentTime -30, 0); mmUpdate(mm, play, seek, seeklbl, false); if (this.select) this.select(); return false; } else if (k==34) { mm.currentTime = Math.min(mm.currentTime +30, mm.duration); mmUpdate(mm, play, seek, seeklbl, false); if (this.select) this.select(); return false; } else if (k==36) { mm.currentTime = 0; mmUpdate(mm, play, seek, seeklbl, false); if (this.select) this.select(); return false; } else if (k==35) { mm.currentTime = mm.duration; mmUpdate(mm, play, seek, seeklbl, false); if (this.select) this.select(); return false; } else if (k==38) { mm.volume = Math.min(mm.volume +0.025, 1); vol.value = Math.round(100*mm.volume); var text = Math.round(100*mm.volume) + '%'; vol.setAttribute('aria-valuenow', vol.value); vol.setAttribute('aria-valuetext', text); if (this.select) this.select(); return false; } else if (k==40) { mm.volume = Math.max(mm.volume -0.025, 0); vol.value = Math.round(100*mm.volume); var text = Math.round(100*mm.volume) + '%'; vol.setAttribute('aria-valuenow', vol.value); vol.setAttribute('aria-valuetext', text); if (this.select) this.select(); return false; } //else if (k>=33 && k<48) alert(k); //other keys } if (!window.onloads) window.onloads = []; if (!window.mmctls) { window.onloads.push(mmInit); window.mmctls=true; }