From 2782a1dd08955f2b4d5c0ec27026fed4d904f75f Mon Sep 17 00:00:00 2001 From: m1k1o Date: Thu, 18 Feb 2021 20:07:06 +0100 Subject: [PATCH] requestFullscreen compatibility. --- README.md | 1 + client/src/components/video.vue | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 3dd2e59..f3ec6d5 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ This app uses Web RTC to stream a desktop inside of a docker container. This is - Disable debug mode by default. - Remove HTML tags from user name. - Upgraded `pion/webrtc` to v3 (by @mbattista). +- Added `requestFullscreen` compatibility for older browsers. # Getting started & FAQ diff --git a/client/src/components/video.vue b/client/src/components/video.vue index 7c709b4..5aee4f6 100644 --- a/client/src/components/video.vue +++ b/client/src/components/video.vue @@ -476,7 +476,22 @@ } requestFullscreen() { - this._player.requestFullscreen() + if (typeof this._player.requestFullscreen === 'function') { + this._player.requestFullscreen() + //@ts-ignore + } else if (typeof this._player.webkitRequestFullscreen === 'function') { + //@ts-ignore + this._player.webkitRequestFullscreen() + //@ts-ignore + } else if (typeof this._player.webkitEnterFullscreen === 'function') { + //@ts-ignore + this._player.webkitEnterFullscreen() + //@ts-ignore + } else if (typeof this._player.msRequestFullScreen === 'function') { + //@ts-ignore + this._player.msRequestFullScreen() + } + this.onResise() }