I am making a flutter desktop application which plays a video and it does not play it simply loads on screen.
Developing a Flutter desktop application that includes video playback functionality. However, the video does not play as expected. Instead, it appears to be stuck in a loading state, indicating that the video is not playing but only loading on the screen.
enter image description here
this is my code
import 'package:flutter/material.dart';
import 'package:flutter_vlc_player/flutter_vlc_player.dart';
class HomeScreen extends StatefulWidget {
const HomeScreen({super.key});
@override
State<HomeScreen> createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
late VlcPlayerController _videoPlayerController;
@override
void initState() {
super.initState();
// Initialize the VlcPlayerController
_videoPlayerController = VlcPlayerController.network(
'https://media.w3.org/2010/05/sintel/trailer.mp4',
hwAcc: HwAcc.full,
autoPlay: false,
options: VlcPlayerOptions(),
);
}
@override
void dispose() {
// Dispose of the controller when the widget is disposed
_videoPlayerController.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.black, // Replace with your desired background color
body: Center(
child: VlcPlayer(
controller: _videoPlayerController,
aspectRatio: 16 / 9,
placeholder: Center(child: CircularProgressIndicator()),
),
),
);
}
}
and this is the error :
A Dart VM Service on Windows is available at: http://127.0.0.1:57747/YU3k4HyQ7K0=/
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: PlatformException(channel-error, Unable to establish connection on channel., null, null)
#0 VlcPlayerApi.initialize (package:flutter_vlc_player_platform_interface/src/messages/messages.dart:632:7)
<asynchronous suspension>
this is my pub file
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.6
file_picker: ^8.0.6
video_player: ^2.9.1
flutter_vlc_player: ^7.4.2
video_player_control_panel: ^1.1.1
video_player_win: ^2.3.9
sprintf: ^7.0.0
I am making a flutter desktop application which plays a video and it does not play it simply loads on screen.
Developing a Flutter desktop application that includes video playback functionality. However, the video does not play as expected. Instead, it appears to be stuck in a loading state, indicating that the video is not playing but only loading on the screen.I am making a flutter desktop application which plays a video and it does not play it simply loads on screen.
Developing a Flutter desktop application that includes video playback functionality. However, the video does not play as expected. Instead, it appears to be stuck in a loading state, indicating that the video is not playing but only loading on the screen.I am making a flutter desktop application which plays a video and it does not play it simply loads on screen.
Developing a Flutter desktop application that includes video playback functionality. However, the video does not play as expected. Instead, it appears to be stuck in a loading state, indicating that the video is not playing but only loading on the screen.