Step9. Campaign Preview

    Step9. Campaign Preview


    Article summary

    You can start a broadcast in muted mode using the in-app PIP.

    ShopLive.preview(data: .init(campaignKey :"CampaignKey"), completion: nil)


    ShopLivePreviewData

    Parameter name

    Type

    Description

    campaignKey

    String

    campaign key (required)

    keepWindowStateOnPlayExecuted

    Bool

    Whether to start playback while keeping the current player mode (PIP, Fullscreen) during playback. (Default: true)

    • true: Maintains the current player mode.

    • false: Starts in fullscreen mode.

    referrer

    String?

    Parameter for tracking the referral source. (Optional, Default: nil)

    campaignHandler

    ((ShopLivePlayerCampaign) -> ())?

    Handler to receive information about the ShopLive broadcast campaign.

    brandHandler

    ((ShopLivePlayerBrand) -> ())?

    Handler to receive information about the ShopLive broadcast brand.

    isEnabledVolumeKey

    Bool

    Enables unmuting according to the preview device’s volume. (Default: false)

    isMuted

    Bool?

    Sets whether the preview is muted. (Default: true)

    resolution

    ShopLivePlayerPreviewResolution

    Sets the preview resolution to .LIVE or .PREVIEW.

    • Applied commonly to IP

    Parameter name

    Type

    Description

    useCloseButton

    Bool

    Shows the close button at the top-left in InAppPip. (Default: false)

    pipPosition

    ShopLive.PipPosition?

    Sets the initial position of InAppPip. (Default: .bottomRight)

    pipPinPositions

    [ShopLive.PipPosition]

    Sets the movable positions for InAppPip. (Default: [.topLeft, .topRight, .bottomLeft, .bottomRight])

    enableSwipeOut

    Bool

    Determines whether the in-app PIP can be swiped out of the screen to close it. (Default: false)

    pipSize

    ShopLiveInAppPipSize?

    Sets the size of the InAppPip. (Default: nil)

    pipRadius

    CGFloat

    Sets the corner radius of the InAppPip. (Default: 10)

    ShopLiveInAppPipSize

    • pipMaxSize, it is set using .scaleAspectFill. For example, if pipMaxSize is 100:

      • In landscape mode: width = 100, height = 100 × (video aspect ratio)

      • In portrait mode: height = 100, width = 100 × (video aspect ratio)

    Parameter name

    Type

    Description

    pipMaxSize

    CGFloat?

    Sets the maximum size of the InAppPip.

    pipFixedWidth

    CGFloat?

    Sets a fixed width for the InAppPip.

    pipFixedheight

    CGFloat?

    Sets a fixed height for the InAppPip.