fix: load login background video from local asset instead of network URL
VideoPlayerController.networkUrl(Uri.parse('assets/login-bg.mp4')) silently
fails because 'assets/login-bg.mp4' is not a valid HTTP URL — the video
never initializes and the login screen shows a plain black background.
Fix: switch to VideoPlayerController.asset() and register the file in
pubspec.yaml. The MP4 is gitignored (22 MB) and kept local for builds.
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -50,3 +50,5 @@ web/assets/login-bg.mp4
|
|||||||
# Keystore files (signing keys)
|
# Keystore files (signing keys)
|
||||||
*.jks
|
*.jks
|
||||||
*.keystore
|
*.keystore
|
||||||
|
# large binary assets — keep local only, not tracked in git
|
||||||
|
assets/login-bg.mp4
|
||||||
|
|||||||
@@ -47,9 +47,7 @@ class _LoginScreenState extends State<LoginScreen> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _initVideo() async {
|
Future<void> _initVideo() async {
|
||||||
_videoController = VideoPlayerController.networkUrl(
|
_videoController = VideoPlayerController.asset('assets/login-bg.mp4');
|
||||||
Uri.parse('assets/login-bg.mp4'),
|
|
||||||
);
|
|
||||||
await _videoController.initialize();
|
await _videoController.initialize();
|
||||||
_videoController.setLooping(true);
|
_videoController.setLooping(true);
|
||||||
_videoController.setVolume(0);
|
_videoController.setVolume(0);
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ flutter:
|
|||||||
assets:
|
assets:
|
||||||
- assets/images/
|
- assets/images/
|
||||||
- assets/icon/hand_stop.svg
|
- assets/icon/hand_stop.svg
|
||||||
|
- assets/login-bg.mp4
|
||||||
fonts:
|
fonts:
|
||||||
- family: Gilroy
|
- family: Gilroy
|
||||||
fonts:
|
fonts:
|
||||||
|
|||||||
Reference in New Issue
Block a user