Launch Button and Submenu

Users access StreamLayer features through the Launch button. You can keep the submenu open in portrait or start it closed by default. Use the StreamLayer.configs.isAlwaysOpened property to control this behavior.

StreamLayer.configs.isAlwaysOpened is a Boolean. When true, the SDK submenu remains open in portrait. When false, the submenu starts closed in portrait and the user must tap the Launch button to open it.

Proper use of isAlwaysOpened

If the bottom of the screen has no content, keep the submenu open so it does not cover app content. This reduces friction and can improve engagement because the user performs fewer actions to access features.

Code example

StreamLayer.initSDK(with: usedSDKKey)
StreamLayer.configs.isAlwaysOpened = true

Show or hide the Launch button

Depending on your UI, you may want to hide or show the Launch button. For example, hide it while player controls are visible. Expose a method that forwards the visibility request to the active controller

@objc
public class StreamLayer: NSObject {

    // ...

    @objc
    public static func hideLaunchButton(_ flag: Bool) {
        activeController?.hideLaunchButton(flag)
    }

    // ...
}

Use StreamLayer.hideLaunchButton(_:) to toggle visibility. Pass true to hide the button, or false to show it.

StreamLayer.hideLaunchButton(true)