Interface ContentMetadata

  • All Known Implementing Classes:
    DefaultContentMetadata

    public interface ContentMetadata
    Interface for an immutable snapshot of keyed metadata.
    • Field Detail

      • KEY_CUSTOM_PREFIX

        static final String KEY_CUSTOM_PREFIX
        Prefix for custom metadata keys. Applications can use keys starting with this prefix without any risk of their keys colliding with ones defined by the ExoPlayer library.
        See Also:
        Constant Field Values
      • KEY_CONTENT_LENGTH

        static final String KEY_CONTENT_LENGTH
        Key for content length in bytes (type: long).
        See Also:
        Constant Field Values
    • Method Detail

      • get

        @Nullable
        byte[] get​(String key,
                   @Nullable
                   byte[] defaultValue)
        Returns a metadata value.
        Parameters:
        key - Key of the metadata to be returned.
        defaultValue - Value to return if the metadata doesn't exist.
        Returns:
        The metadata value.
      • get

        @Nullable
        String get​(String key,
                   @Nullable
                   String defaultValue)
        Returns a metadata value.
        Parameters:
        key - Key of the metadata to be returned.
        defaultValue - Value to return if the metadata doesn't exist.
        Returns:
        The metadata value.
      • get

        long get​(String key,
                 long defaultValue)
        Returns a metadata value.
        Parameters:
        key - Key of the metadata to be returned.
        defaultValue - Value to return if the metadata doesn't exist.
        Returns:
        The metadata value.
      • contains

        boolean contains​(String key)
        Returns whether the metadata is available.