add fullscreen to jsmpeg player

This commit is contained in:
Blake Blackshear 2021-06-19 09:16:00 -05:00
parent b3ee2de079
commit f94a946418

View File

@ -15,6 +15,19 @@ export default function JSMpegPlayer({ camera }) {
{protocols: [], audio: false} {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 () => { return () => {
video.destroy(); video.destroy();
}; };