mirror of
https://github.com/overleaf/overleaf.git
synced 2025-02-23 11:51:08 +00:00
Merge pull request #16805 from overleaf/tm-website-redesign-ios-video-tweaks
Website redesign - video autoplay tweaks primarily to fix playback on iOS GitOrigin-RevId: ba2844b8af64627512470d0f27ec450ee2d86b09
This commit is contained in:
parent
7f9d105d8c
commit
93976a2748
6 changed files with 2 additions and 9 deletions
|
@ -19,7 +19,6 @@ function setup(videoEl) {
|
|||
const INTERSECTION_THRESHOLD = 0.7
|
||||
|
||||
let videoIsVisible
|
||||
let canPlayListenerAdded
|
||||
|
||||
videoEl.addEventListener('ended', () => {
|
||||
setTimeout(() => {
|
||||
|
@ -36,17 +35,11 @@ function setup(videoEl) {
|
|||
if (change.isIntersecting) {
|
||||
videoIsVisible = true
|
||||
if (videoEl.readyState >= videoEl.HAVE_FUTURE_DATA) {
|
||||
if (videoEl.paused && !videoEl.ended) {
|
||||
if (!videoEl.ended) {
|
||||
videoEl.play()
|
||||
}
|
||||
} else {
|
||||
if (!canPlayListenerAdded) {
|
||||
canPlayListenerAdded = true
|
||||
videoEl.addEventListener('canplay', function playWhenReady() {
|
||||
videoEl.play()
|
||||
videoEl.removeEventListener('canplay', playWhenReady)
|
||||
})
|
||||
}
|
||||
videoEl.play()
|
||||
}
|
||||
} else {
|
||||
videoIsVisible = false
|
||||
|
|
BIN
services/web/public/img/website-redesign/commenting-poster.png
Normal file
BIN
services/web/public/img/website-redesign/commenting-poster.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 95 KiB |
BIN
services/web/public/img/website-redesign/compiling-poster.png
Normal file
BIN
services/web/public/img/website-redesign/compiling-poster.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 250 KiB |
Binary file not shown.
After Width: | Height: | Size: 245 KiB |
Binary file not shown.
After Width: | Height: | Size: 48 KiB |
Binary file not shown.
After Width: | Height: | Size: 121 KiB |
Loading…
Reference in a new issue