From e389208d7c114f6986056670d8bf86e0f0414452 Mon Sep 17 00:00:00 2001 From: Jagua Date: Wed, 22 Apr 2015 00:52:20 +0900 Subject: add playOrPause command as combining both play and pause. --- video-controller.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'video-controller.js') 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); -- cgit v1.2.3