mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-20 03:06:59 +08:00
@@ -14,6 +14,7 @@ import 'package:PiliPlus/models/search/result.dart';
|
||||
import 'package:PiliPlus/utils/date_utils.dart';
|
||||
import 'package:PiliPlus/utils/duration_utils.dart';
|
||||
import 'package:PiliPlus/utils/page_utils.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
|
||||
@@ -23,13 +24,11 @@ class VideoCardH extends StatelessWidget {
|
||||
super.key,
|
||||
required this.videoItem,
|
||||
this.onTap,
|
||||
this.onLongPress,
|
||||
this.onViewLater,
|
||||
this.onRemove,
|
||||
});
|
||||
final BaseVideoItemModel videoItem;
|
||||
final VoidCallback? onTap;
|
||||
final VoidCallback? onLongPress;
|
||||
final ValueChanged<int>? onViewLater;
|
||||
final VoidCallback? onRemove;
|
||||
|
||||
@@ -59,19 +58,19 @@ class VideoCardH extends StatelessWidget {
|
||||
badge = item.pgcLabel;
|
||||
}
|
||||
}
|
||||
void onLongPress() => imageSaveDialog(
|
||||
bvid: videoItem.bvid,
|
||||
title: videoItem.title,
|
||||
cover: videoItem.cover,
|
||||
);
|
||||
return Material(
|
||||
type: MaterialType.transparency,
|
||||
child: Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
InkWell(
|
||||
onLongPress:
|
||||
onLongPress ??
|
||||
() => imageSaveDialog(
|
||||
bvid: videoItem.bvid,
|
||||
title: videoItem.title,
|
||||
cover: videoItem.cover,
|
||||
),
|
||||
onLongPress: onLongPress,
|
||||
onSecondaryTap: Utils.isMobile ? null : onLongPress,
|
||||
onTap:
|
||||
onTap ??
|
||||
() async {
|
||||
|
||||
@@ -142,6 +142,7 @@ class _MainAppState extends State<MainApp>
|
||||
Future<void> _onClose() async {
|
||||
await GStorage.compact();
|
||||
await GStorage.close();
|
||||
await trayManager.destroy();
|
||||
if (Platform.isWindows) {
|
||||
const MethodChannel('window_control').invokeMethod('closeWindow');
|
||||
} else {
|
||||
|
||||
@@ -458,12 +458,9 @@ class _VideoDetailPageVState extends State<VideoDetailPageV>
|
||||
await videoDetailController.playerInit();
|
||||
}
|
||||
|
||||
Future.delayed(
|
||||
const Duration(milliseconds: 600),
|
||||
AutoOrientation.fullAutoMode,
|
||||
);
|
||||
plPlayerController?.addStatusLister(playerListener);
|
||||
plPlayerController?.addPositionListener(positionListener);
|
||||
plPlayerController
|
||||
?..addStatusLister(playerListener)
|
||||
..addPositionListener(positionListener);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -1244,12 +1244,11 @@ class PlPlayerController {
|
||||
await seekTo(Duration.zero, isSeek: false);
|
||||
}
|
||||
|
||||
await audioSessionHandler?.setActive(true);
|
||||
await _videoPlayerController?.play();
|
||||
|
||||
playerStatus.status.value = PlayerStatus.playing;
|
||||
// screenManager.setOverlays(false);
|
||||
|
||||
audioSessionHandler?.setActive(true);
|
||||
}
|
||||
|
||||
/// 暂停播放
|
||||
|
||||
@@ -6,8 +6,8 @@ class AudioSessionHandler {
|
||||
late AudioSession session;
|
||||
bool _playInterrupted = false;
|
||||
|
||||
void setActive(bool active) {
|
||||
session.setActive(active);
|
||||
Future<bool> setActive(bool active) {
|
||||
return session.setActive(active);
|
||||
}
|
||||
|
||||
AudioSessionHandler() {
|
||||
|
||||
Reference in New Issue
Block a user