Package 

Class Ima

  • All Implemented Interfaces:
    tv.mycujoo.mcls.ima.IIma

    
    public final class Ima
     implements IIma
                        

    MLS IMA integration to use Google IMA

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      String getAdUnit() AdUnit to feed Google IMA
      Unit createAdsLoader(Context context) Create ImaAdsLoader
      Unit setAdsLoaderProvider(DefaultMediaSourceFactory defaultMediaSourceFactory) Set Ima AdsLoaderProvider to MediaSourceFactory
      Unit setPlayer(Player player) Set player to AdsLoader.
      Unit setAdViewProvider(AdViewProvider adViewProvider)
      MediaSource createMediaSource(DefaultMediaSourceFactory defaultMediaSourceFactory, MediaSource hlsMediaSource, ImaCustomParams imaCustomParams) Create Media Source when IMA is active.
      Unit onStop() Remove exoplayer from AdsLoader Must be called when hosting app is going to background
      Unit onDestroy() Destroy AdsLoader Must be called on app/SDK destroy to release resources
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Ima

        Ima(String adUnit, String liveAdUnit, IParamProvider paramProvider, ImaEventListener listener, Boolean debugMode)
        Parameters:
        adUnit - adUnit which is provided by Google IMA panel
        liveAdUnit - adUnit for live events, provided by Google IMA panel
        paramProvider - custom parameter to log through IMA
        debugMode - debug/release mode the SDK is running.
    • Method Detail

      • setAdsLoaderProvider

         Unit setAdsLoaderProvider(DefaultMediaSourceFactory defaultMediaSourceFactory)

        Set Ima AdsLoaderProvider to MediaSourceFactory

        Parameters:
        defaultMediaSourceFactory - MediaSourceFactory to create media item for exo-player
      • setPlayer

         Unit setPlayer(Player player)

        Set player to AdsLoader. Must happen before using the IMA, and after AdsLoader is initialized

        Parameters:
        player - exoplayer mediaplyer interface
      • createMediaSource

         MediaSource createMediaSource(DefaultMediaSourceFactory defaultMediaSourceFactory, MediaSource hlsMediaSource, ImaCustomParams imaCustomParams)

        Create Media Source when IMA is active. Must be used when IMA integration is active. Exoplayer uses MediaSource to load content.

        Parameters:
        defaultMediaSourceFactory - default factory for creating MediaSource
        hlsMediaSource - source for defining MediaSource
        imaCustomParams - MLS custom parameter for event
      • onStop

         Unit onStop()

        Remove exoplayer from AdsLoader Must be called when hosting app is going to background

      • onDestroy

         Unit onDestroy()

        Destroy AdsLoader Must be called on app/SDK destroy to release resources