Fix duplicate play commands in full-screen mode of Vidieo (#3968)

* fix

* changelog

* Update CHANGELOG.md

---------

Co-authored-by: Freddy Boulton <alfonsoboulton@gmail.com>
Co-authored-by: pngwn <hello@pngwn.io>
This commit is contained in:
Greysuki 2023-04-27 02:33:53 +08:00 committed by GitHub
parent f886045535
commit 88a2b20997
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 8 deletions

View File

@ -6,6 +6,7 @@
No changes to highlight.
## Bug Fixes:
- Fix duplicate play commands in full-screen mode of 'video'. by [@tomchang25](https://github.com/tomchang25) in [PR 3968](https://github.com/gradio-app/gradio/pull/3968).
- Fix the issue of the UI stuck caused by the 'selected' of DataFrame not being reset. by [@tomchang25](https://github.com/tomchang25) in [PR 3916](https://github.com/gradio-app/gradio/pull/3916).
- Fix issue where `gr.Video()` would not work inside a `gr.Tab()` by [@dawoodkhan82](https://github.com/dawoodkhan82) in [PR 3891](https://github.com/gradio-app/gradio/pull/3891)
- Fixed issue with old_value check in File. by [@tomchang25](https://github.com/tomchang25) in [PR 3859](https://github.com/gradio-app/gradio/pull/3859).

View File

@ -41,15 +41,17 @@
}
async function play_pause() {
const isPlaying =
video.currentTime > 0 &&
!video.paused &&
!video.ended &&
video.readyState > video.HAVE_CURRENT_DATA;
if (document.fullscreenElement != video) {
const isPlaying =
video.currentTime > 0 &&
!video.paused &&
!video.ended &&
video.readyState > video.HAVE_CURRENT_DATA;
if (!isPlaying) {
await video.play();
} else video.pause();
if (!isPlaying) {
await video.play();
} else video.pause();
}
}
function handle_click(e: MouseEvent) {