aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJagua2015-04-22 00:52:20 +0900
committerJagua2015-04-22 00:52:20 +0900
commite389208d7c114f6986056670d8bf86e0f0414452 (patch)
tree16d3a6bc6e8687cc9f8dfe5439f04a5ae9345edd
parentae6bdd7987b08cc821b34832b27d05a107f53c3c (diff)
downloadvimperator-plugins-e389208d7c114f6986056670d8bf86e0f0414452.tar.bz2
add playOrPause command as combining both play and pause.
-rw-r--r--video-controller.js7
1 files changed, 2 insertions, 5 deletions
diff --git a/video-controller.js b/video-controller.js
index 2a104f4..facc0cb 100644
--- a/video-controller.js
+++ b/video-controller.js
@@ -86,11 +86,8 @@ let INFO = xml`
let lastCommand = null;
let controlls = {
__proto__: null,
- play: function (elem) {
- elem.play();
- },
- pause: function (elem) {
- elem.pause();
+ playOrPause: function (elem) {
+ elem.paused ? elem.play() : elem.pause();
},
volume: function (elem, value) {
value = parseFloat(value);