video: skip 10s action
This commit is contained in:
parent
caedb78f4f
commit
48d90e071f
6 changed files with 17 additions and 1 deletions
|
@ -101,6 +101,8 @@
|
|||
"@videoActionPlay": {},
|
||||
"videoActionReplay10": "Seek backward 10 seconds",
|
||||
"@videoActionReplay10": {},
|
||||
"videoActionSkip10": "Seek forward 10 seconds",
|
||||
"@videoActionSkip10": {},
|
||||
"videoActionSelectStreams": "Select tracks",
|
||||
"@videoActionSelectStreams": {},
|
||||
"videoActionSetSpeed": "Playback speed",
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
"videoActionPause": "일시정지",
|
||||
"videoActionPlay": "재생",
|
||||
"videoActionReplay10": "10초 뒤로 탐색",
|
||||
"videoActionSkip10": "10초 앞으로 탐색",
|
||||
"videoActionSelectStreams": "트랙 선택",
|
||||
"videoActionSetSpeed": "재생 배속",
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ import 'package:flutter/widgets.dart';
|
|||
enum VideoAction {
|
||||
captureFrame,
|
||||
replay10,
|
||||
skip10,
|
||||
selectStreams,
|
||||
setSpeed,
|
||||
togglePlay,
|
||||
|
@ -13,11 +14,12 @@ enum VideoAction {
|
|||
|
||||
class VideoActions {
|
||||
static const all = [
|
||||
VideoAction.replay10,
|
||||
VideoAction.togglePlay,
|
||||
VideoAction.captureFrame,
|
||||
VideoAction.setSpeed,
|
||||
VideoAction.selectStreams,
|
||||
VideoAction.replay10,
|
||||
VideoAction.skip10,
|
||||
];
|
||||
}
|
||||
|
||||
|
@ -28,6 +30,8 @@ extension ExtraVideoAction on VideoAction {
|
|||
return context.l10n.videoActionCaptureFrame;
|
||||
case VideoAction.replay10:
|
||||
return context.l10n.videoActionReplay10;
|
||||
case VideoAction.skip10:
|
||||
return context.l10n.videoActionSkip10;
|
||||
case VideoAction.selectStreams:
|
||||
return context.l10n.videoActionSelectStreams;
|
||||
case VideoAction.setSpeed:
|
||||
|
@ -44,6 +48,8 @@ extension ExtraVideoAction on VideoAction {
|
|||
return AIcons.captureFrame;
|
||||
case VideoAction.replay10:
|
||||
return AIcons.replay10;
|
||||
case VideoAction.skip10:
|
||||
return AIcons.skip10;
|
||||
case VideoAction.selectStreams:
|
||||
return AIcons.streams;
|
||||
case VideoAction.setSpeed:
|
||||
|
|
|
@ -34,6 +34,7 @@ class AIcons {
|
|||
// actions
|
||||
static const IconData addShortcut = Icons.add_to_home_screen_outlined;
|
||||
static const IconData replay10 = Icons.replay_10_outlined;
|
||||
static const IconData skip10 = Icons.forward_10_outlined;
|
||||
static const IconData captureFrame = Icons.screenshot_outlined;
|
||||
static const IconData clear = Icons.clear_outlined;
|
||||
static const IconData createAlbum = Icons.add_circle_outline;
|
||||
|
|
|
@ -268,6 +268,7 @@ class _ButtonRow extends StatelessWidget {
|
|||
);
|
||||
break;
|
||||
case VideoAction.replay10:
|
||||
case VideoAction.skip10:
|
||||
child = IconButton(
|
||||
icon: Icon(action.getIcon()),
|
||||
onPressed: onPressed,
|
||||
|
@ -297,6 +298,7 @@ class _ButtonRow extends StatelessWidget {
|
|||
enabled = controller?.canSetSpeedNotifier.value ?? false;
|
||||
break;
|
||||
case VideoAction.replay10:
|
||||
case VideoAction.skip10:
|
||||
case VideoAction.togglePlay:
|
||||
enabled = true;
|
||||
break;
|
||||
|
@ -312,6 +314,7 @@ class _ButtonRow extends StatelessWidget {
|
|||
break;
|
||||
case VideoAction.captureFrame:
|
||||
case VideoAction.replay10:
|
||||
case VideoAction.skip10:
|
||||
case VideoAction.selectStreams:
|
||||
case VideoAction.setSpeed:
|
||||
child = MenuRow(text: action.getText(context), icon: action.getIcon());
|
||||
|
|
|
@ -35,6 +35,9 @@ class VideoActionDelegate with FeedbackMixin, PermissionAwareMixin, SizeAwareMix
|
|||
case VideoAction.replay10:
|
||||
if (controller.isReady) controller.seekTo(controller.currentPosition - 10000);
|
||||
break;
|
||||
case VideoAction.skip10:
|
||||
if (controller.isReady) controller.seekTo(controller.currentPosition + 10000);
|
||||
break;
|
||||
case VideoAction.selectStreams:
|
||||
_showStreamSelectionDialog(context, controller);
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue