Package com.castlabs.android.hybridads

# Class HybridAdTrackRendererPlugin

java.lang.Object
com.castlabs.android.hybridads.HybridAdTrackRendererPlugin

All Implemented Interfaces:
  `TrackRendererPlugin`

public class HybridAdTrackRendererPlugin extends Object implements TrackRendererPlugin
A TrackRendererPlugin that enables hybrid ads.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface com.castlabs.android.player.TrackRendererPlugin

  `TrackRendererPlugin.TrackRendererBuilder, TrackRendererPlugin.TrackRendererContainer, TrackRendererPlugin.Type`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `HybridAdTrackRendererPlugin(com.castlabs.android.tunerhal.aidl.IPlayerService tunerhalPlayerService, boolean doesVideoUseSharedMemory, boolean doesAudioUseSharedMemory, int videoSharedMemorySizeInBytes, int audioSharedMemorySizeInBytes)`
  Creates a new HybridAdTrackRendererPlugin.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `TrackRendererPlugin.TrackRendererBuilder`
  `create()`
  `void`
  `setAdPlayerInfo(com.castlabs.android.tunerhal.aidl.IPlayerService service, int instance, long splicePts, long adDuration)`
  Sets the ad player information.
  `void`
  `setContext(Context context, FrameLayout frameLayout)`
  Sets the context and frame layout for the HybridAdView.
  `void`
  `toggleToAdSurface(boolean toggle)`
  Toggles to the ad surface.

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

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

- ## Constructor Details

  - ### HybridAdTrackRendererPlugin

    public HybridAdTrackRendererPlugin(com.castlabs.android.tunerhal.aidl.IPlayerService tunerhalPlayerService, boolean doesVideoUseSharedMemory, boolean doesAudioUseSharedMemory, int videoSharedMemorySizeInBytes, int audioSharedMemorySizeInBytes)
    Creates a new HybridAdTrackRendererPlugin.
    Parameters:
      `tunerhalPlayerService` - The IPlayerService instance.
      `doesVideoUseSharedMemory` - Whether video uses shared memory.
      `doesAudioUseSharedMemory` - Whether audio uses shared memory.
      `videoSharedMemorySizeInBytes` - The size of the video shared memory in bytes.
      `audioSharedMemorySizeInBytes` - The size of the audio shared memory in bytes.

- ## Method Details

  - ### create

    @NonNull public TrackRendererPlugin.TrackRendererBuilder create()
    Specified by:
      `create` in interface `TrackRendererPlugin`

  - ### setAdPlayerInfo

    public void setAdPlayerInfo(com.castlabs.android.tunerhal.aidl.IPlayerService service, int instance, long splicePts, long adDuration)
    Sets the ad player information.
    Parameters:
      `service` - The IPlayerService instance.
      `instance` - The player service instance.
      `splicePts` - The splice presentation timestamp.
      `adDuration` - The ad duration.

  - ### setContext

    public void setContext(Context context, FrameLayout frameLayout)
    Sets the context and frame layout for the HybridAdView.
    Parameters:
      `context` - The context.
      `frameLayout` - The frame layout.

  - ### toggleToAdSurface

    public void toggleToAdSurface(boolean toggle)
    Toggles to the ad surface.
    Parameters:
      `toggle` - True to toggle to the ad surface, false otherwise.