From 2270c988cb530f854271a24ad36b399e6754be67 Mon Sep 17 00:00:00 2001 From: filesite Date: Tue, 16 Jul 2024 18:32:31 +0800 Subject: [PATCH] add delay for video screenshot get --- www/js/beauty.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/www/js/beauty.js b/www/js/beauty.js index 1429609..2069a30 100644 --- a/www/js/beauty.js +++ b/www/js/beauty.js @@ -331,8 +331,8 @@ if ($('#my-player').length > 0 && typeof(videojs) != 'undefined') { preload: 'auto' }); - myPlayer.one('playing', function() { - myPlayer.pause(); + var takeScreenshot = function() { + //myPlayer.pause(); var height = myPlayer.videoHeight(), width = myPlayer.videoWidth(), aspect = height / width; @@ -354,6 +354,10 @@ if ($('#my-player').length > 0 && typeof(videojs) != 'undefined') { }); } - myPlayer.play(); + //myPlayer.play(); + }; + + myPlayer.one('playing', function() { + setTimeout(takeScreenshot, 1000); }); } \ No newline at end of file