public static boolean isYouTubeUrl(String url){
  if (TextUtils.isEmpty(url)) {
    return false;
  }
  Uri uri=Uri.parse(url);
  String authority=uri.getAuthority();
  if (!TextUtils.isEmpty(authority) && authority.contains("youtube.com")) {
    return true;
  }
 else {
    return false;
  }
}

public static boolean isYouTubeUrl ( String url ) { if ( TextUtils . isEmpty ( url ) ) { return false ; } Uri uri = Uri . parse ( url ) ; String authority = uri . getAuthority ( ) ; if ( ! TextUtils . isEmpty ( authority ) && authority . contains ( "youtube.com" ) ) { return true ; } else { return false ; } }
checks to see if the your contains the authority " youtube . com "
