fetchVideoBytes static method
Implementation
static Future<Uint8List?> fetchVideoBytes(String videoUrl) async {
try {
final response = await http.get(Uri.parse(videoUrl));
if (response.statusCode == 200) {
return response.bodyBytes; // Convert response to Uint8List
} else {
print("Failed to load video, Status Code: ${response.statusCode}");
return null;
}
} catch (e) {
print("Error fetching video: $e");
return null;
}
}