Open Fullscreen Player

The FireworkSdk.startPlayer() method launches a fullscreen video player in a separate activity. This is useful when you want to play videos directly without embedding a FwVideoFeedView or FwStoryblock in your layout.

Overview

Unlike FwVideoFeedView and FwStoryBlockView, which are embedded views, FireworkSdk.startPlayer() launches a standalone player activity that takes over the entire screen. This approach is ideal for:

  • Opening specific videos from deep links

  • Playing videos from custom UI elements (buttons, banners, etc.)

  • Handling video notifications

  • Creating custom video entry points

Usage

FireworkSdk.startPlayer() has two variants:

1. Start Player with URL

Launch a specific video directly using its URL:

val viewOptions = ViewOptions.Builder()
    .playerOption(
        PlayerOption.Builder()
            .showShareButton(true)
            .enablePipMode(true)
            .build()
    )
    .build()

val result = FireworkSdk.startPlayer(
    viewOptions = viewOptions,
    url = "https://your-video-url"
)

when (result) {
    is PlayerLaunchResult.Success -> {
        // Player launched successfully
    }
    is PlayerLaunchResult.Failure -> {
        // Handle launch failure
        Log.e("Player", "Failed to launch player: ${result.message}")
    }
}

2. Start Player with Feed Configuration

Launch the player with a feed configuration, allowing users to browse through multiple videos:

Using Kotlin DSL

For more concise syntax, use the DSL:

Launch Result

Both variants return a PlayerLaunchResult that indicates success or failure:

Handling Results

Configuration

The player can be configured using ViewOptions. Key options include:

Player Appearance

Content Source

When not using a specific URL, configure the content source:

Picture-in-Picture

Enable PIP mode to allow users to minimize the player:

Player Launch Modes

You can configure the player activity launch mode:

Available launch modes:

  • SINGLE_TASK - Standard single task launch mode

  • SINGLE_INSTANCE - Single instance launch mode for complete isolation

  • SINGLE_TASK_WITH_OWN_AFFINITY - Single task with custom affinity for separation

Important Notes

  • The SDK must be initialized before calling startPlayer()

  • The player launches in a new activity, separate from your app's activity stack

  • Always handle PlayerLaunchResult.Failure to provide user feedback

  • ViewOptions can customize all aspects of player behavior

  • The player handles its own lifecycle - no manual cleanup required

  • URL variant is useful for specific videos, feed variant for browsing multiple videos

Comparison with Other Widgets

Feature
FwVideoFeedView
FwStoryBlockView
startPlayer()

Embedding

Embedded view

Embedded view

Separate activity

Layout Control

Full control

Full control

No control

Thumbnail Display

Yes

No

No

Lifecycle Management

Automatic

Manual

Automatic

Content Selection

User selects

Auto-play

Direct play

Return Result

No

No

Yes

See Also

Last updated

Was this helpful?