mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-25 10:10:08 +02: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:
@@ -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 |
Reference in New Issue
Block a user