Package com.castlabs.android.player.models

## Class SideloadedTrack

- java.lang.Object
- - com.castlabs.android.player.models.SideloadedTrack

- All Implemented Interfaces:
    `Parcelable`

      public class SideloadedTrack
      extends Object
      implements Parcelable

  Represents a track which is side-loaded (not declared in the content manifest).

  In order to add a `SideloadedTrack`, use the `SdkConsts.INTENT_SIDELOADED_TRACKS_ARRAYLIST` providing an `ArrayList` with the tracks to add. You can also

  A `SideloadedTrack` can represent either a Subtitle or a Thumbnail track. You should use the corresponding `Builder` depending on which type of `SideloadedTrack` is to be created.

  For a subtitle track use the `SideloadedTrack.SubtitleBuilder`, and `SideloadedTrack.ThumbnailBuilder` for a thumbnail track.

  Since:
    4.2.1

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `SideloadedTrack.Builder<T extends SideloadedTrack.Builder<T>>` | Base Builder class
    `static class` | `SideloadedTrack.SubtitleBuilder` | Convenience Builder to create a `SideloadedTrack` with the type set to `SideloadedTrack.Type.SUBTITLE`
    `static class` | `SideloadedTrack.ThumbnailBuilder` | Convenience Builder to create a `SideloadedTrack` with the type set to `SideloadedTrack.Type.THUMBNAIL`
    `static class` | `SideloadedTrack.Type` |

    - ### Nested classes/interfaces inherited from interface android.os.Parcelable

      `Parcelable.ClassLoaderCreator<T extends Object>, Parcelable.Creator<T extends Object>`

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `static Parcelable.Creator<SideloadedTrack>` | `CREATOR` |
    `long` | `gridHeight` | The grid height as number of thumbnails per column.
    `long` | `gridWidth` | The grid width as number of thumbnails per row.
    `long` | `intervalMs` | The interval per-thumbnail for THUMBNAILS tracks.
    `String` | `kind` | The kind attribute for text tracks
    `String` | `label` | The label for text tracks
    `String` | `language` | Two latter language code for text tracks
    `String` | `mimeType` | The MIME type of the track.
    `int` | `thumbnailFormat` | Thumbnail format.
    `SideloadedTrack.Type` | `trackType` | Track type, can be either `SideloadedTrack.Type.SUBTITLE` or `SideloadedTrack.Type.THUMBNAIL`
    `String` | `url` | The URL or URL template for this track.

    - ### Fields inherited from interface android.os.Parcelable

      `CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `SideloadedTrack​(SideloadedTrack.Type trackType, String url, String mimeType, long intervalMs, long gridWidth, long gridHeight, int thumbnailFormat, String language, String label, String kind)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `int` | `describeContents()` |
    `boolean` | `equals​(Object obj)` |
    `int` | `hashCode()` |
    `void` | `writeToParcel​(Parcel dest, int flags)` |

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

      `getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### CREATOR

          public static final Parcelable.Creator<SideloadedTrack> CREATOR

    - #### trackType

          @NonNull
          public final SideloadedTrack.Type trackType

      Track type, can be either `SideloadedTrack.Type.SUBTITLE` or `SideloadedTrack.Type.THUMBNAIL`

    - #### url

          @NonNull
          public final String url

      The URL or URL template for this track.

    - #### mimeType

          @Nullable
          public final String mimeType

      The MIME type of the track.

    - #### intervalMs

          public final long intervalMs

      The interval per-thumbnail for THUMBNAILS tracks. This is optional and not required for subtitle tracks or thumbnail tracks that come with an index such as BIF or WebVTT.

    - #### gridWidth

          public final long gridWidth

      The grid width as number of thumbnails per row. This is optional and not required for subtitle tracks or thumbnail tracks that come with an index such as BIF or WebVTT.

    - #### gridHeight

          public final long gridHeight

      The grid height as number of thumbnails per column. This is optional and not required for subtitle tracks or thumbnail tracks that come with an index such as BIF or WebVTT.

    - #### language

          @Nullable
          public final String language

      Two latter language code for text tracks

    - #### label

          @Nullable
          public final String label

      The label for text tracks

    - #### kind

          @Nullable
          public final String kind

      The kind attribute for text tracks

    - #### thumbnailFormat

          public final int thumbnailFormat

      Thumbnail format. One of `ThumbnailDataTrack.ThumbnailFormat`

  - ### Constructor Detail

    - #### SideloadedTrack

          public SideloadedTrack​(@NonNull
                                 SideloadedTrack.Type trackType,
                                 @NonNull
                                 String url,
                                 @Nullable
                                 String mimeType,
                                 long intervalMs,
                                 long gridWidth,
                                 long gridHeight,
                                 int thumbnailFormat,
                                 @Nullable
                                 String language,
                                 @Nullable
                                 String label,
                                 @Nullable
                                 String kind)

      Parameters:
        `trackType` - track type
        `url` - track url
        `mimeType` - mime type
        `intervalMs` - The interval per-thumbnail for THUMBNAILS tracks.
        `gridWidth` - The grid width as number of thumbnails per row.
        `gridHeight` - The grid height as number of thumbnails per column.
        `thumbnailFormat` - The thumbnail type for THUMBNAIL tracks.
        `language` - Two latter language code for text tracks
        `label` - The label for text tracks
        `kind` - The kind attribute for text tracks

  - ### Method Detail

    - #### describeContents

          public int describeContents()

      Specified by:
        `describeContents` in interface `Parcelable`

    - #### writeToParcel

          public void writeToParcel​(Parcel dest,
                                    int flags)

      Specified by:
        `writeToParcel` in interface `Parcelable`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals​(Object obj)

      Overrides:
        `equals` in class `Object`