merge: 合并 K59 隐藏视频调试文字
This commit is contained in:
commit
7c2fd090e0
2 files changed
+3
-32
No files matched your search
@@ -7,9 +7,6 @@ import 'package:video_player/video_player.dart';
|
|||||||
import '../../../core/widgets/remote_image.dart';
|
import '../../../core/widgets/remote_image.dart';
|
||||||
|
|
||||||
const Duration _videoFadeDuration = Duration(milliseconds: 200);
|
const Duration _videoFadeDuration = Duration(milliseconds: 200);
|
||||||
const double _debugRight = 8;
|
|
||||||
const double _debugBottom = 8;
|
|
||||||
const double _debugFontSize = 11;
|
|
||||||
const double _errorHorizontal = 32;
|
const double _errorHorizontal = 32;
|
||||||
const int _errorMaxLines = 3;
|
const int _errorMaxLines = 3;
|
||||||
|
|
||||||
@@ -75,27 +72,6 @@ class _PlayerVideoSurfaceState extends State<PlayerVideoSurface> {
|
|||||||
)
|
)
|
||||||
: const SizedBox.expand(),
|
: const SizedBox.expand(),
|
||||||
),
|
),
|
||||||
if (kDebugMode)
|
|
||||||
Positioned(
|
|
||||||
right: _debugRight,
|
|
||||||
bottom: _debugBottom,
|
|
||||||
child: DecoratedBox(
|
|
||||||
decoration: const BoxDecoration(color: Color(0x99000000)),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 2),
|
|
||||||
child: Text(
|
|
||||||
_debugStatus(value),
|
|
||||||
key: const Key('player-debug-video'),
|
|
||||||
maxLines: 1,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
style: const TextStyle(
|
|
||||||
color: Colors.white70,
|
|
||||||
fontSize: _debugFontSize,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (kDebugMode && value?.hasError == true)
|
if (kDebugMode && value?.hasError == true)
|
||||||
Center(
|
Center(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
|
|||||||
@@ -15,10 +15,7 @@ void main() {
|
|||||||
expect(find.byKey(const Key('player-fallback-background')), findsOneWidget);
|
expect(find.byKey(const Key('player-fallback-background')), findsOneWidget);
|
||||||
expect(find.byKey(const Key('player-fallback-cover')), findsOneWidget);
|
expect(find.byKey(const Key('player-fallback-cover')), findsOneWidget);
|
||||||
expect(_opacity(tester), 0);
|
expect(_opacity(tester), 0);
|
||||||
expect(
|
expect(find.byKey(const Key('player-debug-video')), findsNothing);
|
||||||
tester.widget<Text>(find.byKey(const Key('player-debug-video'))).data,
|
|
||||||
'loading',
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('should_fade_video_in_within_200ms_after_first_frame', (
|
testWidgets('should_fade_video_in_within_200ms_after_first_frame', (
|
||||||
@@ -52,6 +49,7 @@ void main() {
|
|||||||
await tester.pump(const Duration(milliseconds: 100));
|
await tester.pump(const Duration(milliseconds: 100));
|
||||||
expect(_fadeValue(tester), 1);
|
expect(_fadeValue(tester), 1);
|
||||||
expect(find.byKey(const Key('player-fallback-background')), findsOneWidget);
|
expect(find.byKey(const Key('player-fallback-background')), findsOneWidget);
|
||||||
|
expect(find.byKey(const Key('player-debug-video')), findsNothing);
|
||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('should_show_video_error_above_retained_fallback', (
|
testWidgets('should_show_video_error_above_retained_fallback', (
|
||||||
@@ -66,10 +64,7 @@ void main() {
|
|||||||
expect(find.text('No route to host'), findsOneWidget);
|
expect(find.text('No route to host'), findsOneWidget);
|
||||||
expect(find.byKey(const Key('player-fallback-background')), findsOneWidget);
|
expect(find.byKey(const Key('player-fallback-background')), findsOneWidget);
|
||||||
expect(_opacity(tester), 0);
|
expect(_opacity(tester), 0);
|
||||||
expect(
|
expect(find.byKey(const Key('player-debug-video')), findsNothing);
|
||||||
tester.widget<Text>(find.byKey(const Key('player-debug-video'))).data,
|
|
||||||
'error: No route to host',
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user