code: public void addMetadataProvider(MetadataProvider provider) {
          if (provider instanceof MetadataCache) {
              throw new IllegalArgumentException("Do not register MetadataCache instances using addMetadataProvider(), use attachMetadataCache() or addAutoAttachCacheFile() instead.");
          }
          List<MediaDetails> supportedMedia = provider.supportedMedia();
          if (supportedMedia == null || supportedMedia.isEmpty()) {
              addMetadataProviderForMedia("", provider);
          } else {
              for (MediaDetails details : supportedMedia) {
                  addMetadataProviderForMedia(details.hashKey(), provider);
              }
          }
      }
docs: Adds a metadata provider that will be consulted to see if it can provide metadata for newly-loaded tracks before
  we try to retrieve it from the players or our cache files. This function will immediately call
  {@link MetadataProvider#supportedMedia()} and will only consult the provider for tracks loaded from the media
  mentioned in the response. The function is only called once, when initially adding the provider, so if the set
  of supported media changes, you will need to remove the provider and re-add it. Providers that can provide
  metadata for all media can simply return an empty list of supported media, and they will always be consulted.
  Only do this if they truly can always provide metadata, or you will slow down the lookup process by having them
  frequently called in vain.
  
  @param provider the object that can supply metadata about tracks
  
  @throws IllegalArgumentException if you pass in a {@link MetadataCache}.