fix(player): 观看全集复用抓帧首屏
This commit is contained in:
1 parent
4d3d067f77
commit
55fc2796a9
4 files changed
+136
-36
No files matched your search
@@ -32,6 +32,7 @@ import '../discover/search_page.dart';
|
||||
import '../drama_detail/drama_detail_view.dart';
|
||||
import '../mine/mine_types.dart';
|
||||
import '../mine/mine_view.dart';
|
||||
import 'player_frame_capture.dart';
|
||||
import 'player_view.dart';
|
||||
import 'widgets/drama_comments_sheet.dart';
|
||||
import 'widgets/episode_picker_sheet.dart';
|
||||
@@ -64,6 +65,9 @@ class PlayerLogic extends ChangeNotifier {
|
||||
final Future<void> Function() _waitForFrame;
|
||||
|
||||
late PageController pages;
|
||||
final GlobalKey renderBoundaryKey = GlobalKey(
|
||||
debugLabel: 'player-render-boundary',
|
||||
);
|
||||
late PlaybackQueue queue;
|
||||
late List<int> visibleIndices;
|
||||
late PlaybackSession session;
|
||||
@@ -1226,6 +1230,12 @@ class PlayerLogic extends ChangeNotifier {
|
||||
Drama drama,
|
||||
int index,
|
||||
) async {
|
||||
final initialFrameBytes = await PlayerFrameCapture.capture(
|
||||
context: context,
|
||||
boundaryKey: renderBoundaryKey,
|
||||
source: 'watch-all',
|
||||
);
|
||||
if (!context.mounted) return;
|
||||
await pauseForFullPlayer();
|
||||
if (!context.mounted) return;
|
||||
await Navigator.of(context).push(
|
||||
@@ -1235,6 +1245,8 @@ class PlayerLogic extends ChangeNotifier {
|
||||
initialIndex: index,
|
||||
wallet: wallet,
|
||||
downloads: downloads,
|
||||
revealAfterFirstFrame: initialFrameBytes != null,
|
||||
initialFrameBytes: initialFrameBytes,
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user