feat: add new preference to unmute videos by default (#3218)

This commit is contained in:
TAKAHASHI Shuuji 2025-03-02 23:55:00 +09:00 committed by GitHub
parent 60b1d0224c
commit 41379627b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 12 additions and 2 deletions

View file

@ -71,6 +71,7 @@ const isVideo = computed(() => attachment.type === 'video')
const isGif = computed(() => attachment.type === 'gifv')
const enableAutoplay = usePreferences('enableAutoplay')
const unmuteVideos = usePreferences('unmuteVideos')
useIntersectionObserver(video, (entries) => {
const ready = video.value?.dataset.ready === 'true'
@ -132,7 +133,7 @@ watch(shouldLoadAttachment, () => {
ref="video"
preload="none"
:poster="videoThumbnail"
muted
:muted="!unmuteVideos"
loop
playsinline
:controls="shouldLoadAttachment"
@ -172,7 +173,7 @@ watch(shouldLoadAttachment, () => {
ref="video"
preload="none"
:poster="videoThumbnail"
muted
:muted="!unmuteVideos"
loop
playsinline
rounded-lg