video: option for muted auto play
This commit is contained in:
parent
85be2a24bc
commit
09c0b63c05
23 changed files with 147 additions and 76 deletions
|
@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file.
|
|||
- Info: improved display for XMP
|
||||
- Stats: top albums
|
||||
- Stats: open full top listings
|
||||
- Video: option for muted auto play
|
||||
- Slideshow: option for no transition
|
||||
- Widget: tap action setting
|
||||
- Wallpaper: scroll effect option
|
||||
|
|
|
@ -155,9 +155,9 @@
|
|||
"displayRefreshRatePreferHighest": "Höchste Rate",
|
||||
"displayRefreshRatePreferLowest": "Niedrigste Rate",
|
||||
|
||||
"slideshowVideoPlaybackSkip": "Überspringen",
|
||||
"slideshowVideoPlaybackMuted": "Stumm abspielen",
|
||||
"slideshowVideoPlaybackWithSound": "Mit Ton abspielen",
|
||||
"videoPlaybackSkip": "Überspringen",
|
||||
"videoPlaybackMuted": "Stumm abspielen",
|
||||
"videoPlaybackWithSound": "Mit Ton abspielen",
|
||||
|
||||
"themeBrightnessLight": "Hell",
|
||||
"themeBrightnessDark": "Dunkel",
|
||||
|
@ -535,7 +535,7 @@
|
|||
"settingsVideoSectionTitle": "Video",
|
||||
"settingsVideoShowVideos": "Videos anzeigen",
|
||||
"settingsVideoEnableHardwareAcceleration": "Hardware-Beschleunigung",
|
||||
"settingsVideoEnableAutoPlay": "Automatische Wiedergabe",
|
||||
"settingsVideoAutoPlay": "Automatische Wiedergabe",
|
||||
"settingsVideoLoopModeTile": "Schleifen-Modus",
|
||||
"settingsVideoLoopModeDialogTitle": "Schleifen-Modus",
|
||||
|
||||
|
|
|
@ -155,9 +155,9 @@
|
|||
"displayRefreshRatePreferHighest": "Υψηλότερος ρυθμός",
|
||||
"displayRefreshRatePreferLowest": "Χαμηλότερος ρυθμός",
|
||||
|
||||
"slideshowVideoPlaybackSkip": "Παράλειψη",
|
||||
"slideshowVideoPlaybackMuted": "Αναπαραγωγή σε σίγαση",
|
||||
"slideshowVideoPlaybackWithSound": "Αναπαραγωγή με ήχο",
|
||||
"videoPlaybackSkip": "Παράλειψη",
|
||||
"videoPlaybackMuted": "Αναπαραγωγή σε σίγαση",
|
||||
"videoPlaybackWithSound": "Αναπαραγωγή με ήχο",
|
||||
|
||||
"themeBrightnessLight": "Φωτεινό",
|
||||
"themeBrightnessDark": "Σκούρο",
|
||||
|
@ -535,7 +535,7 @@
|
|||
"settingsVideoSectionTitle": "Βιντεο",
|
||||
"settingsVideoShowVideos": "Εμφάνιση των βίντεο στη συλλογή",
|
||||
"settingsVideoEnableHardwareAcceleration": "Επιτάχυνση υλισμικού",
|
||||
"settingsVideoEnableAutoPlay": "Αυτόματη αναπαραγωγή κατά το άνοιγμα",
|
||||
"settingsVideoAutoPlay": "Αυτόματη αναπαραγωγή κατά το άνοιγμα",
|
||||
"settingsVideoLoopModeTile": "Επανάληψη αυτόματα στο τέλος κάθε βίντεο",
|
||||
"settingsVideoLoopModeDialogTitle": "Επαναληψη Αυτοματα στο Τελος Καθε Βιντεο",
|
||||
|
||||
|
|
|
@ -197,9 +197,9 @@
|
|||
"displayRefreshRatePreferHighest": "Highest rate",
|
||||
"displayRefreshRatePreferLowest": "Lowest rate",
|
||||
|
||||
"slideshowVideoPlaybackSkip": "Skip",
|
||||
"slideshowVideoPlaybackMuted": "Play muted",
|
||||
"slideshowVideoPlaybackWithSound": "Play with sound",
|
||||
"videoPlaybackSkip": "Skip",
|
||||
"videoPlaybackMuted": "Play muted",
|
||||
"videoPlaybackWithSound": "Play with sound",
|
||||
|
||||
"themeBrightnessLight": "Light",
|
||||
"themeBrightnessDark": "Dark",
|
||||
|
@ -632,6 +632,7 @@
|
|||
"settingsPageTitle": "Settings",
|
||||
"settingsSystemDefault": "System",
|
||||
"settingsDefault": "Default",
|
||||
"settingsDisabled": "Disabled",
|
||||
|
||||
"settingsSearchFieldLabel": "Search settings",
|
||||
"settingsSearchEmpty": "No matching setting",
|
||||
|
@ -725,7 +726,7 @@
|
|||
"settingsVideoSectionTitle": "Video",
|
||||
"settingsVideoShowVideos": "Show videos",
|
||||
"settingsVideoEnableHardwareAcceleration": "Hardware acceleration",
|
||||
"settingsVideoEnableAutoPlay": "Auto play",
|
||||
"settingsVideoAutoPlay": "Auto play",
|
||||
"settingsVideoLoopModeTile": "Loop mode",
|
||||
"settingsVideoLoopModeDialogTitle": "Loop Mode",
|
||||
|
||||
|
|
|
@ -151,9 +151,9 @@
|
|||
"displayRefreshRatePreferHighest": "Alta tasa",
|
||||
"displayRefreshRatePreferLowest": "Baja tasa",
|
||||
|
||||
"slideshowVideoPlaybackSkip": "Saltear",
|
||||
"slideshowVideoPlaybackMuted": "Reproducir sin sonido",
|
||||
"slideshowVideoPlaybackWithSound": "Reproducir con sonido",
|
||||
"videoPlaybackSkip": "Saltear",
|
||||
"videoPlaybackMuted": "Reproducir sin sonido",
|
||||
"videoPlaybackWithSound": "Reproducir con sonido",
|
||||
|
||||
"themeBrightnessLight": "Claro",
|
||||
"themeBrightnessDark": "Obscuro",
|
||||
|
@ -519,7 +519,7 @@
|
|||
"settingsVideoSectionTitle": "Video",
|
||||
"settingsVideoShowVideos": "Mostrar videos",
|
||||
"settingsVideoEnableHardwareAcceleration": "Aceleración por hardware",
|
||||
"settingsVideoEnableAutoPlay": "Reproducción automática",
|
||||
"settingsVideoAutoPlay": "Reproducción automática",
|
||||
"settingsVideoLoopModeTile": "Modo bucle",
|
||||
"settingsVideoLoopModeDialogTitle": "Modo bucle",
|
||||
|
||||
|
|
|
@ -157,9 +157,9 @@
|
|||
"displayRefreshRatePreferHighest": "Fréquence maximale",
|
||||
"displayRefreshRatePreferLowest": "Fréquence minimale",
|
||||
|
||||
"slideshowVideoPlaybackSkip": "Passer",
|
||||
"slideshowVideoPlaybackMuted": "Jouer sans son",
|
||||
"slideshowVideoPlaybackWithSound": "Jouer avec son",
|
||||
"videoPlaybackSkip": "Passer",
|
||||
"videoPlaybackMuted": "Jouer sans son",
|
||||
"videoPlaybackWithSound": "Jouer avec son",
|
||||
|
||||
"themeBrightnessLight": "Clair",
|
||||
"themeBrightnessDark": "Sombre",
|
||||
|
@ -545,7 +545,7 @@
|
|||
"settingsVideoSectionTitle": "Vidéo",
|
||||
"settingsVideoShowVideos": "Afficher les vidéos",
|
||||
"settingsVideoEnableHardwareAcceleration": "Accélération matérielle",
|
||||
"settingsVideoEnableAutoPlay": "Lecture automatique",
|
||||
"settingsVideoAutoPlay": "Lecture automatique",
|
||||
"settingsVideoLoopModeTile": "Lecture répétée",
|
||||
"settingsVideoLoopModeDialogTitle": "Lecture répétée",
|
||||
|
||||
|
|
|
@ -155,9 +155,9 @@
|
|||
"displayRefreshRatePreferHighest": "Penyegaran tertinggi",
|
||||
"displayRefreshRatePreferLowest": "Penyegaran terendah",
|
||||
|
||||
"slideshowVideoPlaybackSkip": "Lewati",
|
||||
"slideshowVideoPlaybackMuted": "Mainkan bisu",
|
||||
"slideshowVideoPlaybackWithSound": "Mainkan dengan suara",
|
||||
"videoPlaybackSkip": "Lewati",
|
||||
"videoPlaybackMuted": "Mainkan bisu",
|
||||
"videoPlaybackWithSound": "Mainkan dengan suara",
|
||||
|
||||
"themeBrightnessLight": "Terang",
|
||||
"themeBrightnessDark": "Gelap",
|
||||
|
@ -535,7 +535,7 @@
|
|||
"settingsVideoSectionTitle": "Video",
|
||||
"settingsVideoShowVideos": "Tampilkan video",
|
||||
"settingsVideoEnableHardwareAcceleration": "Akselerasi perangkat keras",
|
||||
"settingsVideoEnableAutoPlay": "Putar otomatis",
|
||||
"settingsVideoAutoPlay": "Putar otomatis",
|
||||
"settingsVideoLoopModeTile": "Putar ulang",
|
||||
"settingsVideoLoopModeDialogTitle": "Putar Ulang",
|
||||
|
||||
|
|
|
@ -155,9 +155,9 @@
|
|||
"displayRefreshRatePreferHighest": "Frequenza massima",
|
||||
"displayRefreshRatePreferLowest": "Frequenza minima",
|
||||
|
||||
"slideshowVideoPlaybackSkip": "Salta",
|
||||
"slideshowVideoPlaybackMuted": "Riproduci senza audio",
|
||||
"slideshowVideoPlaybackWithSound": "Riproduci con audio",
|
||||
"videoPlaybackSkip": "Salta",
|
||||
"videoPlaybackMuted": "Riproduci senza audio",
|
||||
"videoPlaybackWithSound": "Riproduci con audio",
|
||||
|
||||
"themeBrightnessLight": "Chiaro",
|
||||
"themeBrightnessDark": "Scuro",
|
||||
|
@ -534,7 +534,7 @@
|
|||
"settingsVideoSectionTitle": "Video",
|
||||
"settingsVideoShowVideos": "Mostra video",
|
||||
"settingsVideoEnableHardwareAcceleration": "Accelerazione hardware",
|
||||
"settingsVideoEnableAutoPlay": "Riproduzione automatica",
|
||||
"settingsVideoAutoPlay": "Riproduzione automatica",
|
||||
"settingsVideoLoopModeTile": "Modalità loop",
|
||||
"settingsVideoLoopModeDialogTitle": "Modalità loop",
|
||||
|
||||
|
|
|
@ -151,9 +151,9 @@
|
|||
"displayRefreshRatePreferHighest": "高レート",
|
||||
"displayRefreshRatePreferLowest": "低レート",
|
||||
|
||||
"slideshowVideoPlaybackSkip": "スキップ",
|
||||
"slideshowVideoPlaybackMuted": "ミュート再生",
|
||||
"slideshowVideoPlaybackWithSound": "音声あり再生",
|
||||
"videoPlaybackSkip": "スキップ",
|
||||
"videoPlaybackMuted": "ミュート再生",
|
||||
"videoPlaybackWithSound": "音声あり再生",
|
||||
|
||||
"themeBrightnessLight": "ライト",
|
||||
"themeBrightnessDark": "ダーク",
|
||||
|
@ -518,7 +518,7 @@
|
|||
"settingsVideoSectionTitle": "動画",
|
||||
"settingsVideoShowVideos": "動画を表示",
|
||||
"settingsVideoEnableHardwareAcceleration": "ハードウェア アクセラレーション",
|
||||
"settingsVideoEnableAutoPlay": "自動再生",
|
||||
"settingsVideoAutoPlay": "自動再生",
|
||||
"settingsVideoLoopModeTile": "ループ モード",
|
||||
"settingsVideoLoopModeDialogTitle": "ループ モード",
|
||||
|
||||
|
|
|
@ -157,9 +157,9 @@
|
|||
"displayRefreshRatePreferHighest": "가장 높은 재생률",
|
||||
"displayRefreshRatePreferLowest": "가장 낮은 재생률",
|
||||
|
||||
"slideshowVideoPlaybackSkip": "생략",
|
||||
"slideshowVideoPlaybackMuted": "음소거 재생",
|
||||
"slideshowVideoPlaybackWithSound": "일반 재생",
|
||||
"videoPlaybackSkip": "생략",
|
||||
"videoPlaybackMuted": "음소거 재생",
|
||||
"videoPlaybackWithSound": "일반 재생",
|
||||
|
||||
"themeBrightnessLight": "라이트",
|
||||
"themeBrightnessDark": "다크",
|
||||
|
@ -545,7 +545,7 @@
|
|||
"settingsVideoSectionTitle": "동영상",
|
||||
"settingsVideoShowVideos": "미디어에 동영상 표시",
|
||||
"settingsVideoEnableHardwareAcceleration": "하드웨어 가속",
|
||||
"settingsVideoEnableAutoPlay": "자동 재생",
|
||||
"settingsVideoAutoPlay": "자동 재생",
|
||||
"settingsVideoLoopModeTile": "반복 모드",
|
||||
"settingsVideoLoopModeDialogTitle": "반복 모드",
|
||||
|
||||
|
|
|
@ -155,9 +155,9 @@
|
|||
"displayRefreshRatePreferHighest": "Hoogste waardering",
|
||||
"displayRefreshRatePreferLowest": "Laagste waardering",
|
||||
|
||||
"slideshowVideoPlaybackSkip": "Overslaan",
|
||||
"slideshowVideoPlaybackMuted": "Gedempte afspelen",
|
||||
"slideshowVideoPlaybackWithSound": "Met geluid afspelen",
|
||||
"videoPlaybackSkip": "Overslaan",
|
||||
"videoPlaybackMuted": "Gedempte afspelen",
|
||||
"videoPlaybackWithSound": "Met geluid afspelen",
|
||||
|
||||
"themeBrightnessLight": "Licht",
|
||||
"themeBrightnessDark": "Donker",
|
||||
|
@ -535,7 +535,7 @@
|
|||
"settingsVideoSectionTitle": "Video",
|
||||
"settingsVideoShowVideos": "Videos",
|
||||
"settingsVideoEnableHardwareAcceleration": "Hardware acceleratie",
|
||||
"settingsVideoEnableAutoPlay": "Automatisch afspelen",
|
||||
"settingsVideoAutoPlay": "Automatisch afspelen",
|
||||
"settingsVideoLoopModeTile": "Herhaald afspelen",
|
||||
"settingsVideoLoopModeDialogTitle": "Herhaald afspelen",
|
||||
|
||||
|
|
|
@ -155,9 +155,9 @@
|
|||
"displayRefreshRatePreferHighest": "Taxa mais alta",
|
||||
"displayRefreshRatePreferLowest": "Taxa mais baixa",
|
||||
|
||||
"slideshowVideoPlaybackSkip": "Pular",
|
||||
"slideshowVideoPlaybackMuted": "Reproduzir sem som",
|
||||
"slideshowVideoPlaybackWithSound": "Reproduzir com som",
|
||||
"videoPlaybackSkip": "Pular",
|
||||
"videoPlaybackMuted": "Reproduzir sem som",
|
||||
"videoPlaybackWithSound": "Reproduzir com som",
|
||||
|
||||
"themeBrightnessLight": "Claro",
|
||||
"themeBrightnessDark": "Escuro",
|
||||
|
@ -535,7 +535,7 @@
|
|||
"settingsVideoSectionTitle": "Vídeo",
|
||||
"settingsVideoShowVideos": "Mostrar vídeos",
|
||||
"settingsVideoEnableHardwareAcceleration": "Aceleraçao do hardware",
|
||||
"settingsVideoEnableAutoPlay": "Reprodução automática",
|
||||
"settingsVideoAutoPlay": "Reprodução automática",
|
||||
"settingsVideoLoopModeTile": "Modo de loop",
|
||||
"settingsVideoLoopModeDialogTitle": "Modo de loop",
|
||||
|
||||
|
|
|
@ -155,9 +155,9 @@
|
|||
"displayRefreshRatePreferHighest": "Наивысшая частота",
|
||||
"displayRefreshRatePreferLowest": "Наименьшая частота",
|
||||
|
||||
"slideshowVideoPlaybackSkip": "Пропустить",
|
||||
"slideshowVideoPlaybackMuted": "Играть без звука",
|
||||
"slideshowVideoPlaybackWithSound": "Играть со звуком",
|
||||
"videoPlaybackSkip": "Пропустить",
|
||||
"videoPlaybackMuted": "Играть без звука",
|
||||
"videoPlaybackWithSound": "Играть со звуком",
|
||||
|
||||
"themeBrightnessLight": "Светлая",
|
||||
"themeBrightnessDark": "Тёмная",
|
||||
|
@ -535,7 +535,7 @@
|
|||
"settingsVideoSectionTitle": "Видео",
|
||||
"settingsVideoShowVideos": "Показать видео",
|
||||
"settingsVideoEnableHardwareAcceleration": "Аппаратное ускорение",
|
||||
"settingsVideoEnableAutoPlay": "Автозапуск воспроизведения",
|
||||
"settingsVideoAutoPlay": "Автозапуск воспроизведения",
|
||||
"settingsVideoLoopModeTile": "Циклический режим",
|
||||
"settingsVideoLoopModeDialogTitle": "Цикличный режим",
|
||||
|
||||
|
|
|
@ -502,7 +502,7 @@
|
|||
"settingsVideoSectionTitle": "Video",
|
||||
"settingsVideoShowVideos": "Videoları göster",
|
||||
"settingsVideoEnableHardwareAcceleration": "Donanım hızlandırma",
|
||||
"settingsVideoEnableAutoPlay": "Otomatik oynat",
|
||||
"settingsVideoAutoPlay": "Otomatik oynat",
|
||||
"settingsVideoLoopModeTile": "Döngü modu",
|
||||
"settingsVideoLoopModeDialogTitle": "Döngü Modu",
|
||||
|
||||
|
|
|
@ -155,9 +155,9 @@
|
|||
"displayRefreshRatePreferHighest": "最高刷新率",
|
||||
"displayRefreshRatePreferLowest": "最低刷新率",
|
||||
|
||||
"slideshowVideoPlaybackSkip": "跳过",
|
||||
"slideshowVideoPlaybackMuted": "静音播放",
|
||||
"slideshowVideoPlaybackWithSound": "带音播放",
|
||||
"videoPlaybackSkip": "跳过",
|
||||
"videoPlaybackMuted": "静音播放",
|
||||
"videoPlaybackWithSound": "带音播放",
|
||||
|
||||
"themeBrightnessLight": "浅色",
|
||||
"themeBrightnessDark": "深色",
|
||||
|
@ -535,7 +535,7 @@
|
|||
"settingsVideoSectionTitle": "视频",
|
||||
"settingsVideoShowVideos": "显示视频",
|
||||
"settingsVideoEnableHardwareAcceleration": "硬件加速",
|
||||
"settingsVideoEnableAutoPlay": "自动播放",
|
||||
"settingsVideoAutoPlay": "自动播放",
|
||||
"settingsVideoLoopModeTile": "循环模式",
|
||||
"settingsVideoLoopModeDialogTitle": "循环模式",
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ class SettingsDefaults {
|
|||
|
||||
// video
|
||||
static const enableVideoHardwareAcceleration = true;
|
||||
static const enableVideoAutoPlay = false;
|
||||
static const videoAutoPlayMode = VideoAutoPlayMode.disabled;
|
||||
static const videoLoopMode = VideoLoopMode.shortOnly;
|
||||
static const videoShowRawTimedText = false;
|
||||
static const videoControls = VideoControls.play;
|
||||
|
|
|
@ -28,6 +28,8 @@ enum VideoControls { play, playSeek, playOutside, none }
|
|||
|
||||
enum VideoLoopMode { never, shortOnly, always }
|
||||
|
||||
enum VideoAutoPlayMode { disabled, playMuted, playWithSound }
|
||||
|
||||
enum ViewerTransition { slide, parallax, fade, zoomIn, none }
|
||||
|
||||
enum WidgetOpenPage { home, viewer }
|
||||
|
|
|
@ -7,11 +7,11 @@ extension ExtraSlideshowVideoPlayback on SlideshowVideoPlayback {
|
|||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case SlideshowVideoPlayback.skip:
|
||||
return context.l10n.slideshowVideoPlaybackSkip;
|
||||
return context.l10n.videoPlaybackSkip;
|
||||
case SlideshowVideoPlayback.playMuted:
|
||||
return context.l10n.slideshowVideoPlaybackMuted;
|
||||
return context.l10n.videoPlaybackMuted;
|
||||
case SlideshowVideoPlayback.playWithSound:
|
||||
return context.l10n.slideshowVideoPlaybackWithSound;
|
||||
return context.l10n.videoPlaybackWithSound;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
17
lib/model/settings/enums/video_auto_play_mode.dart
Normal file
17
lib/model/settings/enums/video_auto_play_mode.dart
Normal file
|
@ -0,0 +1,17 @@
|
|||
import 'package:aves/widgets/common/extensions/build_context.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
import 'enums.dart';
|
||||
|
||||
extension ExtraSlideshowVideoPlayback on VideoAutoPlayMode {
|
||||
String getName(BuildContext context) {
|
||||
switch (this) {
|
||||
case VideoAutoPlayMode.disabled:
|
||||
return context.l10n.settingsDisabled;
|
||||
case VideoAutoPlayMode.playMuted:
|
||||
return context.l10n.videoPlaybackMuted;
|
||||
case VideoAutoPlayMode.playWithSound:
|
||||
return context.l10n.videoPlaybackWithSound;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -112,7 +112,7 @@ class Settings extends ChangeNotifier {
|
|||
|
||||
// video
|
||||
static const enableVideoHardwareAccelerationKey = 'video_hwaccel_mediacodec';
|
||||
static const enableVideoAutoPlayKey = 'video_auto_play';
|
||||
static const videoAutoPlayModeKey = 'video_auto_play_mode';
|
||||
static const videoLoopModeKey = 'video_loop';
|
||||
static const videoShowRawTimedTextKey = 'video_show_raw_timed_text';
|
||||
static const videoControlsKey = 'video_controls';
|
||||
|
@ -534,9 +534,9 @@ class Settings extends ChangeNotifier {
|
|||
|
||||
set enableVideoHardwareAcceleration(bool newValue) => setAndNotify(enableVideoHardwareAccelerationKey, newValue);
|
||||
|
||||
bool get enableVideoAutoPlay => getBoolOrDefault(enableVideoAutoPlayKey, SettingsDefaults.enableVideoAutoPlay);
|
||||
VideoAutoPlayMode get videoAutoPlayMode => getEnumOrDefault(videoAutoPlayModeKey, SettingsDefaults.videoAutoPlayMode, VideoAutoPlayMode.values);
|
||||
|
||||
set enableVideoAutoPlay(bool newValue) => setAndNotify(enableVideoAutoPlayKey, newValue);
|
||||
set videoAutoPlayMode(VideoAutoPlayMode newValue) => setAndNotify(videoAutoPlayModeKey, newValue.toString());
|
||||
|
||||
VideoLoopMode get videoLoopMode => getEnumOrDefault(videoLoopModeKey, SettingsDefaults.videoLoopMode, VideoLoopMode.values);
|
||||
|
||||
|
@ -874,7 +874,6 @@ class Settings extends ChangeNotifier {
|
|||
case viewerMaxBrightnessKey:
|
||||
case enableMotionPhotoAutoPlayKey:
|
||||
case enableVideoHardwareAccelerationKey:
|
||||
case enableVideoAutoPlayKey:
|
||||
case videoGestureDoubleTapTogglePlayKey:
|
||||
case videoGestureSideDoubleTapSeekKey:
|
||||
case subtitleShowOutlineKey:
|
||||
|
@ -903,6 +902,7 @@ class Settings extends ChangeNotifier {
|
|||
case countrySortFactorKey:
|
||||
case tagSortFactorKey:
|
||||
case imageBackgroundKey:
|
||||
case videoAutoPlayModeKey:
|
||||
case videoLoopModeKey:
|
||||
case videoControlsKey:
|
||||
case subtitleTextAlignmentKey:
|
||||
|
|
|
@ -2,6 +2,7 @@ import 'dart:async';
|
|||
|
||||
import 'package:aves/model/filters/mime.dart';
|
||||
import 'package:aves/model/settings/enums/enums.dart';
|
||||
import 'package:aves/model/settings/enums/video_auto_play_mode.dart';
|
||||
import 'package:aves/model/settings/enums/video_loop_mode.dart';
|
||||
import 'package:aves/model/settings/settings.dart';
|
||||
import 'package:aves/theme/colors.dart';
|
||||
|
@ -73,13 +74,15 @@ class SettingsTileVideoEnableHardwareAcceleration extends SettingsTile {
|
|||
|
||||
class SettingsTileVideoEnableAutoPlay extends SettingsTile {
|
||||
@override
|
||||
String title(BuildContext context) => context.l10n.settingsVideoEnableAutoPlay;
|
||||
String title(BuildContext context) => context.l10n.settingsVideoAutoPlay;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => SettingsSwitchListTile(
|
||||
selector: (context, s) => s.enableVideoAutoPlay,
|
||||
onChanged: (v) => settings.enableVideoAutoPlay = v,
|
||||
title: title(context),
|
||||
Widget build(BuildContext context) => SettingsSelectionListTile<VideoAutoPlayMode>(
|
||||
values: VideoAutoPlayMode.values,
|
||||
getName: (context, v) => v.getName(context),
|
||||
selector: (context, s) => s.videoAutoPlayMode,
|
||||
onSelection: (v) => settings.videoAutoPlayMode = v,
|
||||
tileTitle: title(context),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ mixin EntryViewControllerMixin<T extends StatefulWidget> on State<T> {
|
|||
}
|
||||
}
|
||||
|
||||
bool _shouldAutoPlayVideo(BuildContext context) {
|
||||
bool get videoAutoPlayEnabled {
|
||||
if (!isViewingImage) return false;
|
||||
|
||||
switch (videoPlaybackOverride) {
|
||||
|
@ -76,11 +76,39 @@ mixin EntryViewControllerMixin<T extends StatefulWidget> on State<T> {
|
|||
case SlideshowVideoPlayback.playWithSound:
|
||||
return true;
|
||||
case null:
|
||||
return settings.enableVideoAutoPlay;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (settings.videoAutoPlayMode) {
|
||||
case VideoAutoPlayMode.disabled:
|
||||
return false;
|
||||
case VideoAutoPlayMode.playMuted:
|
||||
case VideoAutoPlayMode.playWithSound:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool _shouldAutoPlayMotionPhoto(BuildContext context) {
|
||||
bool get shouldAutoPlayVideoMuted {
|
||||
switch (videoPlaybackOverride) {
|
||||
case SlideshowVideoPlayback.skip:
|
||||
case SlideshowVideoPlayback.playWithSound:
|
||||
return false;
|
||||
case SlideshowVideoPlayback.playMuted:
|
||||
return true;
|
||||
case null:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (settings.videoAutoPlayMode) {
|
||||
case VideoAutoPlayMode.disabled:
|
||||
case VideoAutoPlayMode.playWithSound:
|
||||
return false;
|
||||
case VideoAutoPlayMode.playMuted:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool get shouldAutoPlayMotionPhoto {
|
||||
if (!isViewingImage) return false;
|
||||
|
||||
return settings.enableMotionPhotoAutoPlay;
|
||||
|
@ -90,7 +118,7 @@ mixin EntryViewControllerMixin<T extends StatefulWidget> on State<T> {
|
|||
final controller = context.read<VideoConductor>().getOrCreateController(entry);
|
||||
setState(() {});
|
||||
|
||||
if (_shouldAutoPlayVideo(context)) {
|
||||
if (videoAutoPlayEnabled) {
|
||||
final resumeTimeMillis = await controller.getResumeTime(context);
|
||||
await _playVideo(controller, () => entry == entryNotifier.value, resumeTimeMillis: resumeTimeMillis);
|
||||
}
|
||||
|
@ -117,7 +145,7 @@ mixin EntryViewControllerMixin<T extends StatefulWidget> on State<T> {
|
|||
// auto play/pause when changing page
|
||||
Future<void> _onPageChange() async {
|
||||
await pauseVideoControllers();
|
||||
if (_shouldAutoPlayVideo(context) || (entry.isMotionPhoto && _shouldAutoPlayMotionPhoto(context))) {
|
||||
if (videoAutoPlayEnabled || (entry.isMotionPhoto && shouldAutoPlayMotionPhoto)) {
|
||||
final page = multiPageController.page;
|
||||
final pageInfo = multiPageInfo.getByIndex(page)!;
|
||||
if (pageInfo.isVideo) {
|
||||
|
@ -135,7 +163,7 @@ mixin EntryViewControllerMixin<T extends StatefulWidget> on State<T> {
|
|||
multiPageController.pageNotifier.addListener(_onPageChange);
|
||||
await _onPageChange();
|
||||
|
||||
if (entry.isMotionPhoto && _shouldAutoPlayMotionPhoto(context)) {
|
||||
if (entry.isMotionPhoto && shouldAutoPlayMotionPhoto) {
|
||||
await Future.delayed(Durations.motionPhotoAutoPlayDelay);
|
||||
if (entry == entryNotifier.value) {
|
||||
multiPageController.page = 1;
|
||||
|
@ -160,7 +188,7 @@ mixin EntryViewControllerMixin<T extends StatefulWidget> on State<T> {
|
|||
// so we play after a delay for increased stability
|
||||
await Future.delayed(const Duration(milliseconds: 300) * timeDilation);
|
||||
|
||||
if (videoPlaybackOverride == SlideshowVideoPlayback.playMuted && !videoController.isMuted) {
|
||||
if (!videoController.isMuted && shouldAutoPlayVideoMuted) {
|
||||
await videoController.toggleMute();
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
"tileLayoutMosaic",
|
||||
"albumGroupType",
|
||||
"albumMimeTypeMixed",
|
||||
"settingsDisabled",
|
||||
"settingsWidgetOpenPage",
|
||||
"statsTopAlbumsSectionTitle",
|
||||
"wallpaperUseScrollEffect"
|
||||
|
@ -22,6 +23,7 @@
|
|||
"tileLayoutMosaic",
|
||||
"albumGroupType",
|
||||
"albumMimeTypeMixed",
|
||||
"settingsDisabled",
|
||||
"settingsWidgetOpenPage",
|
||||
"statsTopAlbumsSectionTitle",
|
||||
"wallpaperUseScrollEffect"
|
||||
|
@ -50,6 +52,7 @@
|
|||
"albumGroupType",
|
||||
"albumMimeTypeMixed",
|
||||
"searchMetadataSectionTitle",
|
||||
"settingsDisabled",
|
||||
"settingsConfirmationAfterMoveToBinItems",
|
||||
"settingsWidgetOpenPage",
|
||||
"statsTopAlbumsSectionTitle",
|
||||
|
@ -57,6 +60,10 @@
|
|||
"wallpaperUseScrollEffect"
|
||||
],
|
||||
|
||||
"fr": [
|
||||
"settingsDisabled"
|
||||
],
|
||||
|
||||
"id": [
|
||||
"chipActionFilterOut",
|
||||
"chipActionFilterIn",
|
||||
|
@ -66,6 +73,7 @@
|
|||
"tileLayoutMosaic",
|
||||
"albumGroupType",
|
||||
"albumMimeTypeMixed",
|
||||
"settingsDisabled",
|
||||
"settingsWidgetOpenPage",
|
||||
"statsTopAlbumsSectionTitle",
|
||||
"wallpaperUseScrollEffect"
|
||||
|
@ -80,6 +88,7 @@
|
|||
"tileLayoutMosaic",
|
||||
"albumGroupType",
|
||||
"albumMimeTypeMixed",
|
||||
"settingsDisabled",
|
||||
"settingsWidgetOpenPage",
|
||||
"statsTopAlbumsSectionTitle",
|
||||
"wallpaperUseScrollEffect"
|
||||
|
@ -108,6 +117,7 @@
|
|||
"albumGroupType",
|
||||
"albumMimeTypeMixed",
|
||||
"searchMetadataSectionTitle",
|
||||
"settingsDisabled",
|
||||
"settingsConfirmationAfterMoveToBinItems",
|
||||
"settingsViewerGestureSideTapNext",
|
||||
"settingsWidgetOpenPage",
|
||||
|
@ -116,6 +126,10 @@
|
|||
"wallpaperUseScrollEffect"
|
||||
],
|
||||
|
||||
"ko": [
|
||||
"settingsDisabled"
|
||||
],
|
||||
|
||||
"nl": [
|
||||
"chipActionFilterOut",
|
||||
"chipActionFilterIn",
|
||||
|
@ -125,6 +139,7 @@
|
|||
"tileLayoutMosaic",
|
||||
"albumGroupType",
|
||||
"albumMimeTypeMixed",
|
||||
"settingsDisabled",
|
||||
"settingsWidgetOpenPage",
|
||||
"statsTopAlbumsSectionTitle",
|
||||
"wallpaperUseScrollEffect"
|
||||
|
@ -139,6 +154,7 @@
|
|||
"tileLayoutMosaic",
|
||||
"albumGroupType",
|
||||
"albumMimeTypeMixed",
|
||||
"settingsDisabled",
|
||||
"settingsWidgetOpenPage",
|
||||
"statsTopAlbumsSectionTitle",
|
||||
"wallpaperUseScrollEffect"
|
||||
|
@ -153,6 +169,7 @@
|
|||
"tileLayoutMosaic",
|
||||
"albumGroupType",
|
||||
"albumMimeTypeMixed",
|
||||
"settingsDisabled",
|
||||
"settingsWidgetOpenPage",
|
||||
"statsTopAlbumsSectionTitle",
|
||||
"wallpaperUseScrollEffect"
|
||||
|
@ -168,9 +185,9 @@
|
|||
"filterNoTitleLabel",
|
||||
"filterOnThisDayLabel",
|
||||
"filterRecentlyAddedLabel",
|
||||
"slideshowVideoPlaybackSkip",
|
||||
"slideshowVideoPlaybackMuted",
|
||||
"slideshowVideoPlaybackWithSound",
|
||||
"videoPlaybackSkip",
|
||||
"videoPlaybackMuted",
|
||||
"videoPlaybackWithSound",
|
||||
"viewerTransitionSlide",
|
||||
"viewerTransitionParallax",
|
||||
"viewerTransitionFade",
|
||||
|
@ -195,6 +212,7 @@
|
|||
"albumGroupType",
|
||||
"albumMimeTypeMixed",
|
||||
"searchMetadataSectionTitle",
|
||||
"settingsDisabled",
|
||||
"settingsConfirmationAfterMoveToBinItems",
|
||||
"settingsViewerGestureSideTapNext",
|
||||
"settingsViewerSlideshowTile",
|
||||
|
@ -226,6 +244,7 @@
|
|||
"tileLayoutMosaic",
|
||||
"albumGroupType",
|
||||
"albumMimeTypeMixed",
|
||||
"settingsDisabled",
|
||||
"settingsWidgetOpenPage",
|
||||
"statsTopAlbumsSectionTitle",
|
||||
"wallpaperUseScrollEffect"
|
||||
|
|
Loading…
Reference in a new issue