Launch Button and Submenu
Control the StreamLayer Launch Button and submenu behavior in your iOS app, including always-open mode and visibility toggling.
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.
When to Use isAlwaysOpened
isAlwaysOpenedIf the bottom of the screen has no content below the video player, 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 interactive units.
Code Example
StreamLayer.initSDK(with: usedSDKKey)
StreamLayer.configs.isAlwaysOpened = trueShow 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:
@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)Related
- Launch Button and Submenu Overview — Feature overview and design examples
- StreamLayer Element Visibility Guide — Detect when the StreamLayer Element opens or closes
- Avoid Tab Bar Overlap — Prevent the Launch Button from overlapping a UITabBar
Updated 21 days ago
