Package com.google.android.exoplayer2.ext.media2

## Class DefaultMediaItemConverter

- java.lang.Object
- - com.google.android.exoplayer2.ext.media2.DefaultMediaItemConverter

- All Implemented Interfaces:
    `MediaItemConverter`

      public class DefaultMediaItemConverter
      extends Object
      implements MediaItemConverter

  Default implementation of `MediaItemConverter`.

  Note that `getMetadata(com.google.android.exoplayer2.MediaItem)` can be overridden to fill in additional metadata when converting `ExoPlayer MediaItems` to their AndroidX equivalents.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `DefaultMediaItemConverter()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `MediaItem` | `convertToExoPlayerMediaItem​(androidx.media2.common.MediaItem media2MediaItem)` | Converts a `Media2 MediaItem` to an `ExoPlayer MediaItem`.
    `androidx.media2.common.MediaItem` | `convertToMedia2MediaItem​(MediaItem exoPlayerMediaItem)` | Converts an `ExoPlayer MediaItem` to a `Media2 MediaItem`.
    `protected androidx.media2.common.MediaMetadata` | `getMetadata​(MediaItem exoPlayerMediaItem)` | Returns a `MediaMetadata` corresponding to the given `ExoPlayer MediaItem`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultMediaItemConverter

          public DefaultMediaItemConverter()

  - ### Method Detail

    - #### convertToExoPlayerMediaItem

          public MediaItem convertToExoPlayerMediaItem​(androidx.media2.common.MediaItem media2MediaItem)

      Description copied from interface: `MediaItemConverter`
      Converts a `Media2 MediaItem` to an `ExoPlayer MediaItem`.
      Specified by:
        `convertToExoPlayerMediaItem` in interface `MediaItemConverter`

    - #### convertToMedia2MediaItem

          public androidx.media2.common.MediaItem convertToMedia2MediaItem​(MediaItem exoPlayerMediaItem)

      Description copied from interface: `MediaItemConverter`
      Converts an `ExoPlayer MediaItem` to a `Media2 MediaItem`.
      Specified by:
        `convertToMedia2MediaItem` in interface `MediaItemConverter`

    - #### getMetadata

          protected androidx.media2.common.MediaMetadata getMetadata​(MediaItem exoPlayerMediaItem)

      Returns a `MediaMetadata` corresponding to the given `ExoPlayer MediaItem`.