You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to initialize the VideoPlayerController in Flutter Web but everytime I load the screen it ends up with this error
TypeError: Cannot read properties of undefined (reading 'isSupported').
Note: I tried different browsers and I got the same error in all of them.
Packages I use in Pubspec.yaml file:
video_player: ^2.7.1
video_player_web_hls: ^1.1.0
Here is how I initialize the controller:
//Code
_VideoPlayerController = VideoPlayerController.networkUrl(Uri.parse(streamUrl))..initialize().
then((_) {
print("initialized");
// Ensure the first frame is shown after the video is initialized, even before the play button has been pressed.
_controller!.play();
setState(() {});
}).onError((error, stackTrace) {
print("====================================================");
print(error);
setState(() {});
});
//End of code
Add <script src="https://cdn.jsdelivr.net/npm/hls.js@latest" type="application/javascript"></script>
in index.html as that has been writtent in documentaion.
Add <script src="https://cdn.jsdelivr.net/npm/hls.js@latest" type="application/javascript"></script>
in index.html as that has been writtent in documentaion.
Is like a trap. Everybody falling there. Myself too hehe.
Anyway, that instruction maybe has to be updated because I don't see this on my index.html:
I am trying to initialize the VideoPlayerController in Flutter Web but everytime I load the screen it ends up with this error
TypeError: Cannot read properties of undefined (reading 'isSupported').
Note: I tried different browsers and I got the same error in all of them.
Packages I use in Pubspec.yaml file:
video_player: ^2.7.1
video_player_web_hls: ^1.1.0
Here is how I initialize the controller:
Actual Result:
Flutter Doctor Output:
The text was updated successfully, but these errors were encountered: