pod_player icon indicating copy to clipboard operation
pod_player copied to clipboard

I'm unable to play YouTube shorts

Open BusayoSamuel opened this issue 1 year ago • 1 comments

I get the invalid argument error whenever I attempt to play YouTube shorts

BusayoSamuel avatar Jun 13 '24 20:06 BusayoSamuel

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

Essenbay avatar Jul 05 '24 08:07 Essenbay