diff --git a/client/assets/js/main.js b/client/assets/js/main.js index 11349ac..613a472 100644 --- a/client/assets/js/main.js +++ b/client/assets/js/main.js @@ -187,20 +187,29 @@ var pointerTouchMoveHandler = function(e) { ws.send(msg); } -var liveClickHandler = function(e) { +var liveHqClickHandler = function(e) { + return liveClickHandler(e, 'hq') +} + +var liveLqClickHandler = function(e) { + return liveClickHandler(e, 'lq') +} + +var liveClickHandler = function(e, quality) { if (isLive) { isLive = false; - $(this).text('Live'); + $('#live-hq').text(`Live HQ`); + $('#live-lq').text(`Live LQ`); return; } isLive = true; - $(this).text('Stop live'); + $(e.target).text('Stop live'); var doScreenshot = function() { if (isLive) { - ws.send('{"type":"screenshot"}'); + ws.send(`{"type":"screenshot","quality":"${quality}"}`); window.setTimeout(doScreenshot, 100); } @@ -272,7 +281,8 @@ var addListeners = function() { .on('touchstart', pointerTouchStartHandler) .on('touchmove', pointerTouchMoveHandler); - $('#live').click(liveClickHandler); + $('#live-hq').click(liveHqClickHandler); + $('#live-lq').click(liveLqClickHandler); $('.btn-fullscreen').click(fullscreenHandler) } diff --git a/client/index.html b/client/index.html index cac003e..6f5b981 100644 --- a/client/index.html +++ b/client/index.html @@ -213,8 +213,10 @@
Desktop