checkVideoIsAvailOnYoutube static method

Future<bool> checkVideoIsAvailOnYoutube({
  1. required String url,
})

Check Youtube Video or Playlist is Available or Not - Its Require Internet

Implementation

static Future<bool> checkVideoIsAvailOnYoutube({required String url}) async {
  var uri = Uri.parse("https://www.youtube.com/oembed?url=$url");
  var res = await http.get(uri);
  if (res.body.contains("title")) {
    return true;
  }
  return false;
}