From f94a946418f1bac0dd438768208fc45b6d71f8c7 Mon Sep 17 00:00:00 2001 From: Blake Blackshear Date: Sat, 19 Jun 2021 09:16:00 -0500 Subject: [PATCH] add fullscreen to jsmpeg player --- web/src/components/JSMpegPlayer.jsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/web/src/components/JSMpegPlayer.jsx b/web/src/components/JSMpegPlayer.jsx index 7543091ff..063c0be3c 100644 --- a/web/src/components/JSMpegPlayer.jsx +++ b/web/src/components/JSMpegPlayer.jsx @@ -15,6 +15,19 @@ export default function JSMpegPlayer({ camera }) { {protocols: [], audio: false} ); + const fullscreen = () => { + console.log("fullscreen"); + + if(video.els.canvas.webkitRequestFullScreen) { + video.els.canvas.webkitRequestFullScreen(); + } + else { + video.els.canvas.mozRequestFullScreen(); + } + } + + video.els.canvas.addEventListener("click",fullscreen) + return () => { video.destroy(); };