-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add additional video player keyboard shortcuts #275
Conversation
Skip back 10 seconds ((CMD OR CTRL) ALT left) Increase video speed ((CMD OR CTRL) +) Decrease video speed ((CMD OR CTRL) -)
} else if ((e.ctrlKey || e.metaKey) && e.altKey && e.which === 37) { | ||
dispatch('playbackJump', state.playing.currentTime - 10) | ||
} else if ((e.ctrlKey || e.metaKey) && (e.which === 107 || e.which === 171)) { /* CMD || CTRL + DOM_VK_ADD || DOM_VK_PLUS */ | ||
dispatch('setPlaybackRate', state.playing.playbackRate + 10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
playbackRate is the relative speed to normal so:
- 1.0 is normal speed
- 2.0 is double speed
- 0.5 is half speed (slow motion :D)
and the negative ones are for playing backwards so:
- -1.0 is backwards, normal speed
- -0.5 is backwards, half speed
- -2.0 is backwards, double speed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The 'steps' should be implemented in base2, standard players use 1x, 2x, 4x, 8x, 16x, so the function to modify the rate can be
- increase:
dispatch('setPlaybackRate', state.playing.playbackRate * 2)
- decrease:
dispatch('setPlaybackRate', state.playing.playbackRate / 2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, but html5 video can`t play backward.
…2x, 4x, 8x, 16x fixed bug with shift + "=" which is "+"
Sorry for the delay in reviewing this. We'll get to this soon, I promise. |
# Conflicts: # renderer/lib/cast.js # renderer/state.js # renderer/views/player.js
# Conflicts: # renderer/state.js
@@ -0,0 +1,7 @@ | |||
root = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't know if we want to add this file. There are many different editors out there, and they each have their own config file. WebTorrent Desktop is built from many npm packages, each with their own git repo.
So I don't think we want to add vim/emacs/intellij/etc configs for every editor to every repo. I recommend putting those in your home folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.editorconfig supported by many editors (http://editorconfig.org/) by default or with plugin. So maybe we should have it in repo?
Thanks for sending this! Left some comments |
@dcposch Agree with all your comments but one (about .editorconfig) More about .editorconfig you can read here http://editorconfig.org/ |
I tend not to push IDE config files. You can always have the local excludes using |
@grunjol .editorconfig not exactly IDE config file. It more like tab vs spaces thing config. And no mater what editor you use vim/emacs/intellij/atom/sublime/etc (full list: http://editorconfig.org/#download) it works. |
is it http://standardjs.com/ compatible? |
# Conflicts: # renderer/index.js
make playback rate more granular add to menu skip and speed entries
All done. |
# Conflicts: # main/menu.js # renderer/index.js
# Conflicts: # main/menu.js
|
||
function increasePlaybackRate () { | ||
if (windows.main) { | ||
windows.main.send('dispatch', 'setPlaybackRate', 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would call this changePlaybackRate
, otherwise it looks like we're setting the playback rate to 1 or -1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
} | ||
state.playing.playbackRate = rate | ||
if (lazyLoadCast().isCasting()) { | ||
Cast.setRate(rate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See below --- when Cast.setRate
returns false, let's set rate = 1
.
That way, the increase/decrease playback rate won't do anything on Chromecast (instead of showing a label that says "2X" or "0.5X" while the actual playback speed doesn't change)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
LGTM otherwise. I might merge this later today, then do a few fixes. I have access to a Chromecast, Airplay, and DLNA so I can test all the cast types. |
# Conflicts: # renderer/views/player.js
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
LGTM |
* 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
As described at #118
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) -)
Don
t tested with airplay and chromecast Video speed should be working with airplay but not with chromecast (https://github.com/mafintosh/chromecasts don
t support it)