diff --git a/src/components/VideoPlayer/index.tsx b/src/components/VideoPlayer/index.tsx index 86b420e..e5ecff9 100644 --- a/src/components/VideoPlayer/index.tsx +++ b/src/components/VideoPlayer/index.tsx @@ -6,7 +6,7 @@ import { useEffect, useRef, useState } from 'react' import ExternalLink from '../ExternalLink' export default function VideoPlayer({ src, className }: { src: string; className?: string }) { - const { autoplay } = useContentPolicy() + const { autoplay, videoLoop } = useContentPolicy() const { muteMedia, updateMuteMedia } = useUserPreferences() const [error, setError] = useState(false) const videoRef = useRef(null) @@ -79,6 +79,7 @@ export default function VideoPlayer({ src, className }: { src: string; className ref={videoRef} controls playsInline + loop={videoLoop} className={cn('max-h-[80vh] rounded-xl border sm:max-h-[60vh]', className)} src={src} onClick={(e) => e.stopPropagation()} diff --git a/src/constants.ts b/src/constants.ts index e4e948e..0a569dd 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -24,6 +24,7 @@ export const StorageKey = { LAST_READ_NOTIFICATION_TIME_MAP: 'lastReadNotificationTimeMap', ACCOUNT_FEED_INFO_MAP: 'accountFeedInfoMap', AUTOPLAY: 'autoplay', + VIDEO_LOOP: 'videoLoop', TRANSLATION_SERVICE_CONFIG_MAP: 'translationServiceConfigMap', MEDIA_UPLOAD_SERVICE_CONFIG_MAP: 'mediaUploadServiceConfigMap', DISMISSED_TOO_MANY_RELAYS_ALERT: 'dismissedTooManyRelaysAlert', diff --git a/src/i18n/locales/ar.ts b/src/i18n/locales/ar.ts index 99b3f39..1ea497f 100644 --- a/src/i18n/locales/ar.ts +++ b/src/i18n/locales/ar.ts @@ -668,6 +668,8 @@ export default { 'No notes found': 'لم يتم العثور على ملاحظات', 'Try again later or check your connection': 'حاول مرة أخرى لاحقًا أو تحقق من اتصالك', 'Hide indirect': 'إخفاء غير المباشرة', - 'Copy note content': 'نسخ محتوى الملاحظة' + 'Copy note content': 'نسخ محتوى الملاحظة', + 'Video loop': 'تكرار الفيديو', + 'Automatically replay videos when they end': 'إعادة تشغيل مقاطع الفيديو تلقائيًا عند انتهائها' } } diff --git a/src/i18n/locales/de.ts b/src/i18n/locales/de.ts index b203d98..a5036ae 100644 --- a/src/i18n/locales/de.ts +++ b/src/i18n/locales/de.ts @@ -692,6 +692,8 @@ export default { 'Try again later or check your connection': 'Versuchen Sie es später erneut oder überprüfen Sie Ihre Verbindung', 'Hide indirect': 'Indirekte ausblenden', - 'Copy note content': 'Notizinhalt kopieren' + 'Copy note content': 'Notizinhalt kopieren', + 'Video loop': 'Video-Schleife', + 'Automatically replay videos when they end': 'Videos automatisch wiederholen, wenn sie enden' } } diff --git a/src/i18n/locales/en.ts b/src/i18n/locales/en.ts index 3dc725f..891a001 100644 --- a/src/i18n/locales/en.ts +++ b/src/i18n/locales/en.ts @@ -674,6 +674,8 @@ export default { 'No notes found': 'No notes found', 'Try again later or check your connection': 'Try again later or check your connection', 'Hide indirect': 'Hide indirect', - 'Copy note content': 'Copy note content' + 'Copy note content': 'Copy note content', + 'Video loop': 'Video loop', + 'Automatically replay videos when they end': 'Automatically replay videos when they end' } } diff --git a/src/i18n/locales/es.ts b/src/i18n/locales/es.ts index 397eb45..264f0cd 100644 --- a/src/i18n/locales/es.ts +++ b/src/i18n/locales/es.ts @@ -685,6 +685,8 @@ export default { 'No notes found': 'No se encontraron notas', 'Try again later or check your connection': 'Inténtalo más tarde o verifica tu conexión', 'Hide indirect': 'Ocultar indirectas', - 'Copy note content': 'Copiar contenido de la nota' + 'Copy note content': 'Copiar contenido de la nota', + 'Video loop': 'Repetir video', + 'Automatically replay videos when they end': 'Reproducir automáticamente los videos cuando terminen' } } diff --git a/src/i18n/locales/fa.ts b/src/i18n/locales/fa.ts index f277363..8d4ef6b 100644 --- a/src/i18n/locales/fa.ts +++ b/src/i18n/locales/fa.ts @@ -680,6 +680,8 @@ export default { 'Try again later or check your connection': 'بعداً دوباره امتحان کنید یا اتصال خود را بررسی کنید', 'Hide indirect': 'پنهان کردن غیرمستقیم', - 'Copy note content': 'کپی محتوای یادداشت' + 'Copy note content': 'کپی محتوای یادداشت', + 'Video loop': 'تکرار ویدیو', + 'Automatically replay videos when they end': 'پخش خودکار ویدیوها پس از پایان' } } diff --git a/src/i18n/locales/fr.ts b/src/i18n/locales/fr.ts index dbcdd35..163963f 100644 --- a/src/i18n/locales/fr.ts +++ b/src/i18n/locales/fr.ts @@ -689,6 +689,8 @@ export default { 'No notes found': 'Aucune note trouvée', 'Try again later or check your connection': 'Réessayez plus tard ou vérifiez votre connexion', 'Hide indirect': 'Masquer indirects', - 'Copy note content': 'Copier le contenu de la note' + 'Copy note content': 'Copier le contenu de la note', + 'Video loop': 'Boucle vidéo', + 'Automatically replay videos when they end': 'Rejouer automatiquement les vidéos à la fin' } } diff --git a/src/i18n/locales/hi.ts b/src/i18n/locales/hi.ts index e1275bf..2a698d8 100644 --- a/src/i18n/locales/hi.ts +++ b/src/i18n/locales/hi.ts @@ -680,6 +680,8 @@ export default { 'No notes found': 'कोई नोट्स नहीं मिले', 'Try again later or check your connection': 'बाद में पुनः प्रयास करें या अपना कनेक्शन जाँचें', 'Hide indirect': 'अप्रत्यक्ष छुपाएं', - 'Copy note content': 'नोट सामग्री कॉपी करें' + 'Copy note content': 'नोट सामग्री कॉपी करें', + 'Video loop': 'वीडियो लूप', + 'Automatically replay videos when they end': 'वीडियो समाप्त होने पर स्वचालित रूप से दोबारा चलाएं' } } diff --git a/src/i18n/locales/hu.ts b/src/i18n/locales/hu.ts index 916cef0..f8c6e53 100644 --- a/src/i18n/locales/hu.ts +++ b/src/i18n/locales/hu.ts @@ -674,6 +674,8 @@ export default { 'No notes found': 'Nem található jegyzet', 'Try again later or check your connection': 'Próbáld újra később vagy ellenőrizd a kapcsolatot', 'Hide indirect': 'Közvetettek elrejtése', - 'Copy note content': 'Jegyzet tartalmának másolása' + 'Copy note content': 'Jegyzet tartalmának másolása', + 'Video loop': 'Videó ismétlése', + 'Automatically replay videos when they end': 'Videók automatikus újrajátszása, amikor véget érnek' } } diff --git a/src/i18n/locales/it.ts b/src/i18n/locales/it.ts index ff1965f..a3be547 100644 --- a/src/i18n/locales/it.ts +++ b/src/i18n/locales/it.ts @@ -685,6 +685,8 @@ export default { 'No notes found': 'Nessuna nota trovata', 'Try again later or check your connection': 'Riprova più tardi o controlla la connessione', 'Hide indirect': 'Nascondi indirette', - 'Copy note content': 'Copia contenuto della nota' + 'Copy note content': 'Copia contenuto della nota', + 'Video loop': 'Ripetizione video', + 'Automatically replay videos when they end': 'Riprodurre automaticamente i video quando terminano' } } diff --git a/src/i18n/locales/ja.ts b/src/i18n/locales/ja.ts index 301c0aa..063ac42 100644 --- a/src/i18n/locales/ja.ts +++ b/src/i18n/locales/ja.ts @@ -680,6 +680,8 @@ export default { 'Try again later or check your connection': '後でもう一度お試しいただくか、接続を確認してください', 'Hide indirect': '間接通知を非表示', - 'Copy note content': 'ノート内容をコピー' + 'Copy note content': 'ノート内容をコピー', + 'Video loop': 'ビデオループ', + 'Automatically replay videos when they end': 'ビデオ終了時に自動的にリプレイする' } } diff --git a/src/i18n/locales/ko.ts b/src/i18n/locales/ko.ts index 3401dbc..f8f299f 100644 --- a/src/i18n/locales/ko.ts +++ b/src/i18n/locales/ko.ts @@ -674,6 +674,8 @@ export default { 'No notes found': '노트를 찾을 수 없습니다', 'Try again later or check your connection': '나중에 다시 시도하거나 연결을 확인하세요', 'Hide indirect': '간접 숨기기', - 'Copy note content': '노트 내용 복사' + 'Copy note content': '노트 내용 복사', + 'Video loop': '비디오 반복', + 'Automatically replay videos when they end': '비디오가 끝나면 자동으로 다시 재생' } } diff --git a/src/i18n/locales/pl.ts b/src/i18n/locales/pl.ts index 56469c9..eab8699 100644 --- a/src/i18n/locales/pl.ts +++ b/src/i18n/locales/pl.ts @@ -686,6 +686,8 @@ export default { 'No notes found': 'Nie znaleziono notatek', 'Try again later or check your connection': 'Spróbuj ponownie później lub sprawdź połączenie', 'Hide indirect': 'Ukryj pośrednie', - 'Copy note content': 'Kopiuj treść notatki' + 'Copy note content': 'Kopiuj treść notatki', + 'Video loop': 'Zapętlanie wideo', + 'Automatically replay videos when they end': 'Automatycznie powtarzaj filmy po zakończeniu' } } diff --git a/src/i18n/locales/pt-BR.ts b/src/i18n/locales/pt-BR.ts index dee71bc..f3f4958 100644 --- a/src/i18n/locales/pt-BR.ts +++ b/src/i18n/locales/pt-BR.ts @@ -683,6 +683,8 @@ export default { 'Try again later or check your connection': 'Tente novamente mais tarde ou verifique sua conexão', 'Hide indirect': 'Ocultar indiretas', - 'Copy note content': 'Copiar conteúdo da nota' + 'Copy note content': 'Copiar conteúdo da nota', + 'Video loop': 'Repetir vídeo', + 'Automatically replay videos when they end': 'Reproduzir automaticamente os vídeos quando terminarem' } } diff --git a/src/i18n/locales/pt-PT.ts b/src/i18n/locales/pt-PT.ts index a53a73d..0312df8 100644 --- a/src/i18n/locales/pt-PT.ts +++ b/src/i18n/locales/pt-PT.ts @@ -686,6 +686,8 @@ export default { 'Try again later or check your connection': 'Tente novamente mais tarde ou verifique a sua ligação', 'Hide indirect': 'Ocultar indiretas', - 'Copy note content': 'Copiar conteúdo da nota' + 'Copy note content': 'Copiar conteúdo da nota', + 'Video loop': 'Repetir vídeo', + 'Automatically replay videos when they end': 'Reproduzir automaticamente os vídeos quando terminarem' } } diff --git a/src/i18n/locales/ru.ts b/src/i18n/locales/ru.ts index 9eac8d6..72f166c 100644 --- a/src/i18n/locales/ru.ts +++ b/src/i18n/locales/ru.ts @@ -685,6 +685,8 @@ export default { 'No notes found': 'Заметки не найдены', 'Try again later or check your connection': 'Попробуйте позже или проверьте подключение', 'Hide indirect': 'Скрыть косвенные', - 'Copy note content': 'Скопировать содержимое заметки' + 'Copy note content': 'Скопировать содержимое заметки', + 'Video loop': 'Зацикливание видео', + 'Automatically replay videos when they end': 'Автоматически воспроизводить видео заново после окончания' } } diff --git a/src/i18n/locales/th.ts b/src/i18n/locales/th.ts index 4c37d9d..e21913c 100644 --- a/src/i18n/locales/th.ts +++ b/src/i18n/locales/th.ts @@ -670,6 +670,8 @@ export default { 'No notes found': 'ไม่พบโน้ต', 'Try again later or check your connection': 'ลองใหม่ภายหลังหรือตรวจสอบการเชื่อมต่อของคุณ', 'Hide indirect': 'ซ่อนทางอ้อม', - 'Copy note content': 'คัดลอกเนื้อหาโน้ต' + 'Copy note content': 'คัดลอกเนื้อหาโน้ต', + 'Video loop': 'เล่นวิดีโอซ้ำ', + 'Automatically replay videos when they end': 'เล่นวิดีโอซ้ำอัตโนมัติเมื่อจบ' } } diff --git a/src/i18n/locales/zh-TW.ts b/src/i18n/locales/zh-TW.ts index 15b916d..7cff1d3 100644 --- a/src/i18n/locales/zh-TW.ts +++ b/src/i18n/locales/zh-TW.ts @@ -652,6 +652,8 @@ export default { 'No notes found': '沒有找到筆記', 'Try again later or check your connection': '請稍後重試或檢查網路連接', 'Hide indirect': '隱藏間接通知', - 'Copy note content': '複製筆記內容' + 'Copy note content': '複製筆記內容', + 'Video loop': '影片循環', + 'Automatically replay videos when they end': '影片播放結束後自動重新播放' } } diff --git a/src/i18n/locales/zh.ts b/src/i18n/locales/zh.ts index 9821a15..3100c72 100644 --- a/src/i18n/locales/zh.ts +++ b/src/i18n/locales/zh.ts @@ -657,6 +657,8 @@ export default { 'No notes found': '没有找到笔记', 'Try again later or check your connection': '请稍后重试或检查网络连接', 'Hide indirect': '隐藏间接通知', - 'Copy note content': '复制笔记内容' + 'Copy note content': '复制笔记内容', + 'Video loop': '视频循环', + 'Automatically replay videos when they end': '视频播放结束后自动重新播放' } } diff --git a/src/pages/secondary/GeneralSettingsPage/index.tsx b/src/pages/secondary/GeneralSettingsPage/index.tsx index 5ab726c..22039cd 100644 --- a/src/pages/secondary/GeneralSettingsPage/index.tsx +++ b/src/pages/secondary/GeneralSettingsPage/index.tsx @@ -29,6 +29,8 @@ const GeneralSettingsPage = forwardRef(({ index }: { index?: number }, ref) => { const { autoplay, setAutoplay, + videoLoop, + setVideoLoop, nsfwDisplayPolicy, setNsfwDisplayPolicy, hideContentMentioningMutedUsers, @@ -121,6 +123,15 @@ const GeneralSettingsPage = forwardRef(({ index }: { index?: number }, ref) => { + + + +