Open BusayoSamuel opened 5 months ago
Use this function to get youtube code
String getYoutubeVideoId(String url) {
final RegExp regExp = RegExp(
r"(?:https?:\/\/)?(?:(?:www\.)?youtube\.com\/(?:(?:shorts\/)|(?:watch\?v=))|(?:youtu.be\/))([\-a-zA-Z0-9_]+)");
final match = regExp.firstMatch(url);
final result = match?.group(1) ?? "";
return result;
}
And set it to datasource of controller
I get the invalid argument error whenever I attempt to play YouTube shorts