video: added action to play in other app
This commit is contained in:
parent
83a29c063f
commit
c6c87bdc96
6 changed files with 16 additions and 8 deletions
|
@ -941,8 +941,6 @@
|
|||
|
||||
"viewerOpenPanoramaButtonLabel": "OPEN PANORAMA",
|
||||
"@viewerOpenPanoramaButtonLabel": {},
|
||||
"viewerOpenTooltip": "Open",
|
||||
"@viewerOpenTooltip": {},
|
||||
"viewerErrorUnknown": "Oops!",
|
||||
"@viewerErrorUnknown": {},
|
||||
"viewerErrorDoesNotExist": "The file no longer exists.",
|
||||
|
|
|
@ -439,7 +439,6 @@
|
|||
"statsTopTags": "태그 랭킹",
|
||||
|
||||
"viewerOpenPanoramaButtonLabel": "파노라마 열기",
|
||||
"viewerOpenTooltip": "열기",
|
||||
"viewerErrorUnknown": "아이구!",
|
||||
"viewerErrorDoesNotExist": "파일이 존재하지 않습니다.",
|
||||
|
||||
|
|
|
@ -432,7 +432,6 @@
|
|||
"statsTopTags": "Топ тегов",
|
||||
|
||||
"viewerOpenPanoramaButtonLabel": "ОТКРЫТЬ ПАНОРАМУ",
|
||||
"viewerOpenTooltip": "Открыть",
|
||||
"viewerErrorUnknown": "Упс!",
|
||||
"viewerErrorDoesNotExist": "Файл больше не существует.",
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import 'package:flutter/widgets.dart';
|
|||
|
||||
enum VideoAction {
|
||||
captureFrame,
|
||||
playOutside,
|
||||
replay10,
|
||||
skip10,
|
||||
selectStreams,
|
||||
|
@ -21,6 +22,7 @@ class VideoActions {
|
|||
VideoAction.selectStreams,
|
||||
VideoAction.replay10,
|
||||
VideoAction.skip10,
|
||||
VideoAction.playOutside,
|
||||
VideoAction.settings,
|
||||
];
|
||||
}
|
||||
|
@ -30,6 +32,8 @@ extension ExtraVideoAction on VideoAction {
|
|||
switch (this) {
|
||||
case VideoAction.captureFrame:
|
||||
return context.l10n.videoActionCaptureFrame;
|
||||
case VideoAction.playOutside:
|
||||
return context.l10n.entryActionOpen;
|
||||
case VideoAction.replay10:
|
||||
return context.l10n.videoActionReplay10;
|
||||
case VideoAction.skip10:
|
||||
|
@ -54,6 +58,8 @@ extension ExtraVideoAction on VideoAction {
|
|||
switch (this) {
|
||||
case VideoAction.captureFrame:
|
||||
return AIcons.captureFrame;
|
||||
case VideoAction.playOutside:
|
||||
return AIcons.openOutside;
|
||||
case VideoAction.replay10:
|
||||
return AIcons.replay10;
|
||||
case VideoAction.skip10:
|
||||
|
|
|
@ -3,7 +3,6 @@ import 'dart:async';
|
|||
import 'package:aves/model/actions/video_actions.dart';
|
||||
import 'package:aves/model/entry.dart';
|
||||
import 'package:aves/model/settings/settings.dart';
|
||||
import 'package:aves/services/common/services.dart';
|
||||
import 'package:aves/theme/durations.dart';
|
||||
import 'package:aves/theme/format.dart';
|
||||
import 'package:aves/theme/icons.dart';
|
||||
|
@ -73,9 +72,9 @@ class _VideoControlOverlayState extends State<VideoControlOverlay> with SingleTi
|
|||
child: OverlayButton(
|
||||
scale: scale,
|
||||
child: IconButton(
|
||||
icon: const Icon(AIcons.openOutside),
|
||||
onPressed: () => androidAppService.open(entry.uri, entry.mimeTypeAnySubtype),
|
||||
tooltip: context.l10n.viewerOpenTooltip,
|
||||
icon: VideoAction.playOutside.getIcon(),
|
||||
onPressed: () => widget.onActionSelected(VideoAction.playOutside),
|
||||
tooltip: VideoAction.playOutside.getText(context),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
@ -292,6 +291,7 @@ class _ButtonRow extends StatelessWidget {
|
|||
onPressed: onPressed,
|
||||
);
|
||||
break;
|
||||
case VideoAction.playOutside:
|
||||
case VideoAction.replay10:
|
||||
case VideoAction.skip10:
|
||||
case VideoAction.settings:
|
||||
|
@ -323,6 +323,7 @@ class _ButtonRow extends StatelessWidget {
|
|||
case VideoAction.setSpeed:
|
||||
enabled = controller?.canSetSpeedNotifier.value ?? false;
|
||||
break;
|
||||
case VideoAction.playOutside:
|
||||
case VideoAction.replay10:
|
||||
case VideoAction.skip10:
|
||||
case VideoAction.settings:
|
||||
|
@ -340,6 +341,7 @@ class _ButtonRow extends StatelessWidget {
|
|||
);
|
||||
break;
|
||||
case VideoAction.captureFrame:
|
||||
case VideoAction.playOutside:
|
||||
case VideoAction.replay10:
|
||||
case VideoAction.skip10:
|
||||
case VideoAction.selectStreams:
|
||||
|
|
|
@ -43,6 +43,10 @@ class VideoActionDelegate with FeedbackMixin, PermissionAwareMixin, SizeAwareMix
|
|||
case VideoAction.captureFrame:
|
||||
_captureFrame(context, controller);
|
||||
break;
|
||||
case VideoAction.playOutside:
|
||||
final entry = controller.entry;
|
||||
androidAppService.open(entry.uri, entry.mimeTypeAnySubtype);
|
||||
break;
|
||||
case VideoAction.replay10:
|
||||
if (controller.isReady) controller.seekTo(controller.currentPosition - 10000);
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue