From 1410f699c5f89a62b5dfe89dda4b3e6e37b2b38e Mon Sep 17 00:00:00 2001 From: Tamius Han Date: Wed, 13 Jan 2021 01:11:55 +0100 Subject: [PATCH] Add video status checks --- src/ext/lib/video-data/VideoData.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/ext/lib/video-data/VideoData.js b/src/ext/lib/video-data/VideoData.js index b6797cf..8f7d727 100644 --- a/src/ext/lib/video-data/VideoData.js +++ b/src/ext/lib/video-data/VideoData.js @@ -219,7 +219,15 @@ class VideoData { } //#endregion + //#region video status + isVideoPlaying() { + return this.video && !!(this.video.currentTime > 0 && !this.video.paused && !this.video.ended && this.video.readyState > 2); + } + hasVideoStartedPlaying() { + return this.video && this.video.currentTime > 0; + } + //#endregion restoreCrop() { this.logger.log('info', 'debug', '[VideoData::restoreCrop] Attempting to reset aspect ratio.')