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