GuidesAPI ReferenceRelease Notes
HomeLog InHome
Guides

View-Based Inline Container Constructor & Parameters

This section covers the constructor and parameters for initializing the view-based inline player.

Constructor

Creates a new instance of BlazeVideosInlinePlayer for view-based implementation

class BlazeVideosInlinePlayer @JvmOverloads constructor(
    lifecycleOwner: LifecycleOwner,
    storeOwner: ViewModelStoreOwner,
    containerView: ViewGroup,
    containerId: String,
    dataSource: BlazeDataSourceType,
    playerMode: PlayerMode,
    shouldOrderContentsByReadStatus: Boolean = true,
    playerDelegate: BlazePlayerInInlineDelegate,
    cachePolicyLevel: BlazeCachingLevel = BlazeSDK.cachingLevel,
    videosAdsConfigType: BlazeVideosAdsConfigType = BlazeVideosAdsConfigType.FIRST_AVAILABLE_ADS_CONFIG,
)

Example

val playerMode = BlazeVideosInlinePlayer.PlayerMode.Interactive(
    interactivePlayerStyle = BlazeVideosInlineInteractivePlayerStyle.base(),
    fullScreenPlayerStyle = BlazeVideosPlayerStyle.base()
)

val videosInlinePlayer = BlazeVideosInlinePlayer(
    lifecycleOwner = this,
    storeOwner = this,
    containerView = frameLayoutContainer,
    containerId = "video-player-unique-id",
    dataSource = BlazeDataSourceType.Labels(BlazeWidgetLabel.singleLabel("videos")),
    playerMode = playerMode,
    playerDelegate = object: BlazePlayerInInlineDelegate {
        //Here is your optional implementation
    }
)

Properties

lifecycleOwner

lifecycleOwner: LifecycleOwner

The lifecycle owner that manages the lifecycle of the container. This is typically the Activity or Fragment hosting the inline container.

storeOwner

storeOwner: ViewModelStoreOwner

The ViewModelStoreOwner that provides the ViewModelStore for the container's ViewModels. This is typically the Activity or Fragment hosting the inline container.

containerView

containerView: ViewGroup

The ViewGroup in which the inline container will be embedded. This serves as the parent container for the video player UI.

containerId

containerId: String

Unique identifier for the inline container instance. This identifier MUST be unique per container instance in the app.

dataSource

dataSource: BlazeDataSourceType

The data source that defines what video content to load in the container. Built with BlazeDataSourceType.

Determines the video content filtering and selection for the inline container.

playerMode

playerMode: PlayerMode

Determines the presentation mode and behavior of the inline container. Choose between Preview and Interactive modes.

For detailed information about player modes, available options, and configuration, see Player Mode Documentation.

shouldOrderContentsByReadStatus

shouldOrderContentsByReadStatus: Boolean = true

Controls whether videos should be ordered by their read status.

Takes effect only when repository is clean/fresh:

  • After container disposal and recreation
  • On first content load
  • When data source changes requiring fresh fetch

No effect during normal operations:

  • State transitions (placeholder ↔ player)
  • Inline ↔ fullscreen transitions
  • Content updates from cached repository

When this flag is set to true, the player will display videos in an order where unread videos appear first, followed by the read videos. This flag is true by default.

playerDelegate

playerDelegate: BlazePlayerInInlineDelegate

The delegate object for receiving callbacks and events from the inline container.

For detailed information about available delegate methods and event handling, see Event Delegate Documentation.

cachePolicyLevel

cachePolicyLevel: BlazeCachingLevel = BlazeSDK.cachingLevel

The cache policy level for this container instance. Defaults to the global SDK caching level.

Overrides the global caching policy for this specific container. Read more about available options in the BlazeCachingLevel documentation.

videosAdsConfigType

videosAdsConfigType: BlazeVideosAdsConfigType = BlazeVideosAdsConfigType.FIRST_AVAILABLE_ADS_CONFIG

The ads configuration for this container instance. Defaults to BlazeVideosAdsConfigType.FIRST_AVAILABLE_ADS_CONFIG.

Controls how ads are displayed and managed within the inline container. Read more about available options in the BlazeVideosAdsConfigType documentation.


Did this page help you?