Skip to content

Commit

Permalink
fix(fullscreen videos): getting replaced
Browse files Browse the repository at this point in the history
  • Loading branch information
AlejandroAkbal committed Mar 1, 2024
1 parent f6caf7a commit 69987f5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions components/pages/posts/post/PostMedia.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ const { isPremium } = useUserData()
}
function onMediaIntersectionObserver(entries: IntersectionObserverEntry[]) {
// Skip on fullscreen
if (document.fullscreenElement) {
return
}
// Smallest video & image possible - https://stackoverflow.com/a/36610159/11398632
const smallestImage =
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVQYV2NgYAAAAAMAAWgmWQ0AAAAASUVORK5CYII='
Expand Down Expand Up @@ -91,6 +97,12 @@ const { isPremium } = useUserData()
* Stops videos when they are out of the viewport
*/
function onVideoIntersectionObserver(entries: IntersectionObserverEntry[]) {
// Skip on fullscreen
if (document.fullscreenElement) {
return
}
const entry = entries[0]
const videoElement = entry.target as HTMLVideoElement
Expand Down

0 comments on commit 69987f5

Please sign in to comment.