fix(player): 预热直出并与视频统一封面布局
This commit is contained in:
1 parent
a3a79f7068
commit
48b4e67d34
9 files changed
+119
-104
No files matched your search
@@ -83,13 +83,9 @@ void main() {
|
||||
);
|
||||
|
||||
expect(find.byKey(const Key('player-opening-poster')), findsOneWidget);
|
||||
expect(
|
||||
find.byKey(const Key('player-opening-poster-backdrop')),
|
||||
findsOneWidget,
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('should_constrain_poster_inside_native_vertical_frame', (
|
||||
testWidgets('should_use_surface_fit_without_extra_frame_constraint', (
|
||||
tester,
|
||||
) async {
|
||||
await tester.pumpWidget(
|
||||
@@ -100,23 +96,23 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
final stage = tester.widget<AspectRatio>(
|
||||
find.byKey(const Key('player-opening-poster-stage')),
|
||||
);
|
||||
final poster = tester.widget<RemoteImage>(
|
||||
find.byKey(const Key('player-opening-poster')),
|
||||
);
|
||||
final backdrop = tester.widget<RemoteImage>(
|
||||
find.byKey(const Key('player-opening-poster-backdrop')),
|
||||
|
||||
expect(poster.fit, BoxFit.cover);
|
||||
expect(find.byType(AspectRatio), findsNothing);
|
||||
});
|
||||
|
||||
test('should_forward_video_fit_to_opening_frame', () {
|
||||
final frame = playerOpeningFrame(
|
||||
null,
|
||||
posterUrl: 'https://cdn.test/poster.jpg',
|
||||
fit: BoxFit.contain,
|
||||
);
|
||||
|
||||
expect(stage.aspectRatio, closeTo(3 / 4, 0.001));
|
||||
expect(poster.fit, BoxFit.cover);
|
||||
expect(backdrop.fit, BoxFit.cover);
|
||||
expect(
|
||||
find.byKey(const Key('player-opening-poster-blur')),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(frame, isA<PlayerOpeningFrame>());
|
||||
expect((frame! as PlayerOpeningFrame).fit, BoxFit.contain);
|
||||
});
|
||||
|
||||
testWidgets('should_reuse_decoded_sprite_when_parent_rebuilds', (
|
||||
|
||||
Reference in new issue
Block a user