Class APSMediaUnit

All Implemented Interfaces:
android.os.Parcelable

public class APSMediaUnit extends APSMediaEvent
The APSMediaUnit class represents a clip that's ready to be rendered by the player. A media unit also references an array of APSMediaOverlay objects, defining the overlays connected to the unit.
  • Field Details

    • url

      public String url
      The video clip URL.
    • subtitlesUrl

      public String subtitlesUrl
      The URL of an SubRip subtitles file to be sideloaded
    • initialPlaybackTime

      public int initialPlaybackTime
      Initial video playback time in seconds.
    • controlsDisplay

      public APSMediaUnit.APSMediaControlsDisplay controlsDisplay
      Defines how the controls bar will be displayed for the unit. See APSMediaControlsDisplay for possible values.
    • controlsParameters

      public HashMap<String,Object> controlsParameters
      The configuration for the controls bar overlay. Construct this using the configurationFromDictionary: method of APSMediaPlayerControlsOverlayController.
    • buffet

      public ArrayList<APSMediaUnit> buffet
      An array of other media units to be played instead of the current one, should an error be encountered. The unit at index 0 has the highest priority.
    • metadata

      public HashMap<String,Object> metadata

      A HashMap containing the metadata associated with the unit.

    • pinchToFullscreen

      public boolean pinchToFullscreen
      Defines if pinch-to-fullscreen should be allowed.
    • debug

      public boolean debug
      Toggle to enable logs.
    • shouldAutoplay

      public boolean shouldAutoplay
      Defines if the unit should start playing as soon as it loads or wait for a play command.
    • played

      public boolean played
    • canReplay

      public boolean canReplay
      Defines whether the player can replay the current unit or not after it has ended in the playlist.
    • manager

      public String manager
      The associated registered unit manager of this unit (for example the Marlin Unit Manager for DRM encoding.
    • seekHandling

      public APSMediaUnit.APSHandleSeekEvent seekHandling
      Defines how mid content ads should be handled when the user has skipped over several batches. Use this parameter to instruct the player to render: only the first ad batch, only the last ad batch or all passed ad batches. Defaults to `APSHandleSeekEventPlayLastBreak`.
    • midcontentAdMinimumInitialOffset

      public int midcontentAdMinimumInitialOffset
      For ad breaks assigned to this unit without an ad offset (breaks that should be auto-positioned within the content), this parameter defines the minimum time interval in seconds to wait before displaying the first ad batch. Defaults to 300 seconds.
    • midcontentAdMinimumFinalOffset

      public int midcontentAdMinimumFinalOffset
      For ad breaks assigned to this unit without an ad offset (breaks that should be auto-positioned within the content), this parameter defines the minimum time interval in seconds (relative to the end of the video) that should be ad-free. Defaults to 300 seconds.
    • midcontentAdMinimumSpacing

      public int midcontentAdMinimumSpacing
      For ad breaks assigned to this unit without an ad offset (breaks that should be auto-positioned within the content), this parameter defines the minimum time interval in seconds to wait between ad batches. Defaults to 300 seconds.
    • renderer

      public String renderer
      The renderer associated with this unit. By default, the ExoPlayer renderer is used in 4.1+ and MediaPlayer for 4.0.x
    • _positionedDynamicEvents

      public boolean _positionedDynamicEvents
    • sourceAdBreak

      public APSVastAdBreak sourceAdBreak
    • CREATOR

      public static final android.os.Parcelable.Creator<APSMediaUnit> CREATOR
  • Constructor Details

    • APSMediaUnit

      public APSMediaUnit()
    • APSMediaUnit

      protected APSMediaUnit(android.os.Parcel in)
  • Method Details

    • initWithURL

      public void initWithURL(String url)
    • addOverlay

      public void addOverlay(APSMediaOverlay overlay)
      Adds an APSMediaOverlay object to the unit, to be rendered together.
      Parameters:
      overlay - The APSMediaPlayer object to be connected to the unit.
    • addEvent

      public void addEvent(APSMediaEvent event)
    • setOverlays

      public void setOverlays(ArrayList<Object> overlays)
      Connects an array of APSMediaOverlay objects to the current unit.
      Parameters:
      overlays - An array of APSMediaOverlay objects to be connected to the unit.
    • setEvents

      public void setEvents(ArrayList<Object> events)
      Connects an array of APSMediaEvent objects to the current unit (for example APSVastAdBreak objects)
    • clearOverlays

      public void clearOverlays()
      Removes all currently connected overlays.
    • overlays

      public ArrayList<APSMediaOverlay> overlays()
      Returns an array containing all APSMediaOverlay objects currently connected to the unit.
      Returns:
      An array of APSMediaOverlay objects.
    • events

      public ArrayList<APSMediaEvent> events()
    • skippedEvents

      public ArrayList<APSMediaEvent> skippedEvents()
      Events a seek skipped in the unit this copy continues; a backward seek re-arms them.
    • setSkippedEvents

      public void setSkippedEvents(List<APSMediaEvent> events)
    • dynamicEvents

      public ArrayList<APSMediaEvent> dynamicEvents()
    • copyWithZone

      public APSMediaUnit copyWithZone()
    • onPreload

      public void onPreload()
      Description copied from class: APSMediaEvent
      This method will be invoked on a different thread by the player, before the event start point, as set by the preTriggerInterval field.
      Specified by:
      onPreload in class APSMediaEvent
    • onTrigger

      public void onTrigger()
      Description copied from class: APSMediaEvent
      This code will be executed once the event is triggered by the player.
      Specified by:
      onTrigger in class APSMediaEvent
    • onUnload

      public void onUnload()
      Description copied from class: APSMediaEvent
      This method will be invoked by the player once the event has reached the end point and will be deallocated.
      Specified by:
      onUnload in class APSMediaEvent
    • onUpdate

      public void onUpdate()
      Description copied from class: APSMediaEvent
      This method will be invoked by the player periodically, giving the event the opportunity to respond to updated playback information.
      Specified by:
      onUpdate in class APSMediaEvent
    • describeContents

      public int describeContents()
      Specified by:
      describeContents in interface android.os.Parcelable
      Overrides:
      describeContents in class APSMediaEvent
    • writeToParcel

      public void writeToParcel(android.os.Parcel dest, int flags)
      Specified by:
      writeToParcel in interface android.os.Parcelable
      Overrides:
      writeToParcel in class APSMediaEvent