Add additional video player keyboard shortcuts (#275)

*  Skip forward 10 seconds ((CMD OR CTRL) ALT right)
 Skip back 10 seconds ((CMD OR CTRL) ALT left)
 Increase video speed ((CMD OR CTRL) +)
 Decrease video speed ((CMD OR CTRL) -)

* Codestyle fix

* The 'steps' should be implemented in base2, standard players use 1x, 2x, 4x, 8x, 16x

fixed bug with shift + "=" which is "+"

* resolve conflicts

* remove ide specific data
make playback rate more granular
add to menu skip and speed entries

* intendation fix

* conflict resolve

* rename setPlaybackRate to changePlaybackRate
setRate return boolean depending on whether this cast target supports setting the playback rate.
if setRate returns false - don`t change state
redundant else if statement in changePlaybackRate function
This commit is contained in:
Sergey Bargamon
2016-05-23 10:15:57 +03:00
committed by DC
parent ffce76a9b1
commit 8af4f42c42
8 changed files with 126 additions and 4 deletions

View File

@@ -8,7 +8,8 @@ module.exports = {
play,
pause,
seek,
setVolume
setVolume,
setRate
}
var airplay = require('airplay-js')
@@ -344,6 +345,22 @@ function pause () {
}
}
function setRate (rate) {
var device
var result = true
if (state.playing.location === 'chromecast') {
// TODO find how to control playback rate on chromecast
castCallback()
result = false
} else if (state.playing.location === 'airplay') {
device = state.devices.airplay
device.rate(rate, castCallback)
} else {
result = false
}
return result
}
function seek (time) {
var device = getDevice()
if (device) {