Class MediaViewManager

  • All Implemented Interfaces:

    
    public final class MediaViewManager
    
                        

    Manages the lifecycle and display of media experiences within a MediaView.

    This class is responsible for creating and managing an BaseExperienceManager which handles the loading, inflation, and display of media content based on an ExperienceModel. It also provides a flow of MediaEvents to communicate media-related events to the client.

    • Constructor Detail

      • MediaViewManager

        MediaViewManager(Context context, CoroutineScope coroutineScope, InMobiLogger logger)
        Parameters:
        context - The application context.
        coroutineScope - The coroutine scope used for asynchronous operations.
        logger - An optional InMobiLogger instance for logging.
    • Method Detail

      • detachObserversAndPause

         final Unit detachObserversAndPause()

        Detaches window lifecycle observers and pauses the media experience.

        This method should be called when the media experience should be paused, such as when the containing view goes out of focus or becomes non-visible. It stops any ongoing media playback and tracking to conserve resources.

      • destroy

         final <Error class: unknown class> destroy()

        Destroys the BaseExperienceManager and releases any associated resources.

        This should be called when the media experience is no longer needed to prevent memory leaks and ensure proper cleanup.