mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-29 22:00:16 +08:00
committed by
GitHub
parent
1c19925b58
commit
199ad274b7
@@ -36,6 +36,7 @@ import 'package:PiliPlus/utils/android/android_helper.dart';
|
||||
import 'package:PiliPlus/utils/android/bindings.g.dart';
|
||||
import 'package:PiliPlus/utils/asset_utils.dart';
|
||||
import 'package:PiliPlus/utils/device_utils.dart';
|
||||
import 'package:PiliPlus/utils/duration_utils.dart';
|
||||
import 'package:PiliPlus/utils/extension/box_ext.dart';
|
||||
import 'package:PiliPlus/utils/extension/num_ext.dart';
|
||||
import 'package:PiliPlus/utils/feed_back.dart';
|
||||
@@ -46,7 +47,6 @@ import 'package:PiliPlus/utils/platform_utils.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/storage_key.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:PiliPlus/utils/theme_utils.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:archive/archive.dart' show getCrc32;
|
||||
import 'package:canvas_danmaku/canvas_danmaku.dart';
|
||||
@@ -772,16 +772,12 @@ class PlPlayerController with BlockConfigMixin {
|
||||
assert(_videoPlayerController == null);
|
||||
final opt = {
|
||||
'video-sync': Pref.videoSync,
|
||||
if (Platform.isAndroid) 'ao': Pref.audioOutput,
|
||||
'volume':
|
||||
(PlatformUtils.isMobile ? Pref.playerVolume : volume.value * 100)
|
||||
.toString(),
|
||||
'volume-max': kMaxVolume.toString(),
|
||||
};
|
||||
if (Platform.isAndroid) {
|
||||
opt['ao'] = Pref.audioOutput;
|
||||
}
|
||||
if (PlatformUtils.isMobile) {
|
||||
opt['volume'] = Pref.playerVolume.toString();
|
||||
} else {
|
||||
opt['volume'] = (volume.value * 100).toString();
|
||||
}
|
||||
opt['volume-max'] = kMaxVolume.toString();
|
||||
final autosync = Pref.autosync;
|
||||
if (autosync != '0') {
|
||||
opt['autosync'] = autosync;
|
||||
@@ -1737,6 +1733,9 @@ class PlPlayerController with BlockConfigMixin {
|
||||
|
||||
Future<void> takeScreenshot() async {
|
||||
SmartDialog.showToast('截图中');
|
||||
final time = DurationUtils.formatDuration(
|
||||
position.inMilliseconds / 1000,
|
||||
).replaceAll(':', '-');
|
||||
final image = await videoPlayerController?.screenshot();
|
||||
if (image != null) {
|
||||
SmartDialog.showToast('点击弹窗保存截图');
|
||||
@@ -1748,7 +1747,7 @@ class PlPlayerController with BlockConfigMixin {
|
||||
if (bytes != null) {
|
||||
ImageUtils.saveByteImg(
|
||||
bytes: bytes.buffer.asUint8List(),
|
||||
fileName: 'screenshot_${ImageUtils.time}',
|
||||
fileName: 'screenshot_${cid}_$time',
|
||||
);
|
||||
}
|
||||
Get.back();
|
||||
@@ -1765,7 +1764,7 @@ class PlPlayerController with BlockConfigMixin {
|
||||
decoration: BoxDecoration(
|
||||
border: Border.all(
|
||||
width: 5,
|
||||
color: ThemeUtils.theme.colorScheme.surface,
|
||||
color: ColorScheme.of(context).surface,
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
|
||||
Reference in New Issue
Block a user