API - Option

    API - Option


    기사 요약

    setShareScheme

    공유하기를 선택(탭) 했을 때 시스템 공유 팝업으로 전달할 scheme을 설정합니다.
    shareDelegate를 설정하면 iOS 시스템 공유 팝업 대신 직접 커스텀 공유 팝업을 구현할 수 있습니다.

    setShareScheme(_ scheme: String?, shareDelegate: ShopLivePlayerShareDelegate?)

    Parameter name

    Type

    Description

    scheme

    String?

    공유할 scheme 또는 URL

    shareDelegate

    ShopLivePlayerShareDelegate?

    ShopLiveShareDelegate

    Sample code

    let scheme = "shoplive://live"
    let scheme = "https://shoplive.cloud/live"
    
    class ViewController : UIViewController {
      
      func viewDidLoad(){ 
        // iOS 시스템 공유 팝업
    		ShopLive.setShareScheme(scheme, shareDelegate: nil)
      }
    } 
    extension ViewController : ShopLiveShareDelegate { 
      func handleShare(data : ShopLivePlayerShareData) {
        //show share sheet
      }
    }

    ShopLivePlayerShareData

    Parameter name

    Type

    Description

    campaign

    ShopLivePlayerShareCampaign?

    현재 방송 캠페인에 대한 정보

    url

    String?

    공유할 scheme 또는 URL

    ShopLivePlayerShareCampaign

    Parameter name

    Type

    Description

    campaignKey

    String?

    현재 방송의 campaignKey

    title

    String?

    현재 방송의 제목

    descriptions

    String?

    현재 방송의 설명

    thumbnail

    String?

    현재 방송의 썸네일 이미지


    setChatViewFont

    채팅 폰트와 채팅 전송 버튼 폰트를 설정합니다.

    setChatViewFont(inputBoxFont: UIFont, sendButtonFont: UIFont)

    Parameter name

    Type

    Description

    inputBoxFont

    UIFont

    채팅 폰트

    sendButtonFont

    UIFont

    채팅 전송 버튼 폰트

    Sample code

    /**
        // 채팅 폰트 설정
        let inputDefaultFont = UIFont.systemFont(ofSize: 14, weight: .regular)
    
        // 채팅 전송 버튼 폰트 설정
        let sendButtonDefaultFont = UIFont.systemFont(ofSize: 14, weight: .medium)
    
    */
    
    let customFont = UIFont(name: "{Custom Font}", size: 16)
    
    // 채팅 폰트 및 채팅 전송 버튼 폰트 변경 
    ShopLive.setChatViewFont(inputBoxFont: customFont, sendButtonFont: customFont)
    


    setLoadingAnimation

    영상 로딩 진행률을 이미지 애니메이션으로 설정합니다.

    setLoadingAnimation(images: [UIImage])

    Parameter name

    Type

    Description

    images

    UIImage array

    이미지 애니메이션에 사용할 이미지 UIImage 배열

    Sample code

    var images: [UIImage] = []
    
    for i in 1...11 {
        images.append(.init(named: "loading\(i)")!)
    }
    
    ShopLive.setLoadingAnimation(images: images)
    


    setInAppPipConfiguration

    InAppPip 관련 옵션을 설정합니다. setInAppPipConfiguration(config:)로 설정된 값들은 이전 deprecate된 Api들로 설정된 값보다 우선순위를 가지고 있습니다.

    setInAppPipConfiguration(config: ShopLiveInAppPipConfiguration?)

    Parameter name

    Type

    Description

    pipSize

    ShopLiveInAppPipSize

    • init(pipMaxSize : CGfloat)

    • init(pipFixedHeight : CGFloat)

    • init(pipFixedWidth : CGFLoat)

    • pipMaxSize의 경우 .scaleAspectFill로 정해집니다. 예: pipMazSize가 100일 경우

    • 가로모드에서는 가로 100 , 세로 100 x (영상 비율), 세로모드에서는 세로 100, 가로 100 x (영상 비율)이 됩니다.

    Parameter name

    Type

    Description

    Config

    ShopLiveInAppPipConfiguration

    • pipSize :ShopLiveInAppPipSize

    • useCloseButton : Bool

      • (InAppPip에서 좌측 상단의 닫기 버튼을 보여줄지 설정합니다.기본값 : false)

    • pipPosition : ShopLive.PipPosition

      • (기본값 .bottomRight)

    • pipPinPosition : [ShopLive.PipPosition]

      • (기본값 : [.topLeft, .topRight, .bottomLeft, .bottomRight])

    • enableSwipeOut : Bool

      • (앱 내 PIP를 화면 밖으로 이동하여 종료 시킬 지 여부를 설정합니다. 기본값: false)

    • pipRadius : CGFloat

      • (앱 내 PIP의 cornerRadius를 설정합니다. 기본값 : 10)

    Objective-C 환경에서는 ShopLiveInAppPipConfigurationObjc 객체를 사용해야 합니다.

    Sample code

    //maxSize
    let pipSize = ShopLiveInAppPipSize(pipMaxSize : 200)
    //fixedHeight
    let pipSize = ShopLiveInAppPipSize(pipFixedHeight : 200)
    //fixedWidth
    let pipSize = ShopLiveInAppPipSize(pipFixedWidth  :200)
    
    let inAppPipConfig = ShopLiveInAppPipConfiguration(pipSize: pipSize,
                                                       useCloseButton: true,
                                                       pipPosition: .bottomLeft,
                                                       enableSwipeOut: true,
                                                       pipRadius : 10)
    ShopLive.setInAppPipConfiguration(config: inAppPipConfig)
    


    getPreviewSize

    preview의 크기를 가져옵니다.

    getPreviewSize(inAppPipConfiguration: ShopLiveInAppPipConfiguration, videoRatio: CGSize) -> CGSize

    Parameter name

    Type

    Description

    inAppPipConfiguration

    ShopLiveInAppPipConfiguration

    ShopLiveInAppPipConfiguration

    videoRatio

    CGSize

    동영상의 비율 (ex 16 : 9, 9 : 16)


    addSubViewToPreview

    Shoplive preview위에 고객사의 customView를 보여줍니다.

    customView를 보여줄때는 ShopLiveInAppPipConfiguration(useCloseButton: false)로 처리해주세요.

    addSubViewToPreview(subView: UIView)

    Sample code

    func setCustomerPreviewCoverView() {
        var previewViewCoverView = UIView()
        previewViewCoverView.addSubview(someView1)
        previewViewCoverView.addSubview(someView2)
        NSLayoutConstraint.activate([
            someView1.topAnchor.constraint(equalTo: previewViewCoverView.topAnchor),
            someView1.trailingAnchor.constraint(equalTo: previewViewCoverView.trailingAnchor),
            someView1.widthAnchor.constraint(equalToConstant: 70),
            someView1.heightAnchor.constraint(equalToConstant: 30),
                
            someView2.bottomAnchor.constraint(equalTo: previewViewCoverView.bottomAnchor),
            someView2.leadingAnchor.constraint(equalTo: previewViewCoverView.leadingAnchor),
            someView2.trailingAnchor.constraint(equalTo: previewViewCoverView.trailingAnchor),
            someView2.heightAnchor.constraint(equalToConstant: 40)
        ])
        ShopLive.addSubViewToPreview(subView: previewViewCoverView)
    }

    startPictureInPicture

    전체 화면 모드에서 PIP 모드로 전환합니다.

    startPictureInPicture(with position: ShopLive.PipPosition, scale: CGFloat)
    startPictureInPicture()

    Parameter name

    Type

    Description

    position

    ShopLiveI.PipPosition

    PIP 모드가 시작될 때 위치

    (기본값: default)

    scale

    CGFloat

    0.0 ~ 1.0 사이의 값 입력

    Sample code

    // 0.4배(기본값) 크기로 앱 내 PIP 모드 전환
    ShopLive.startPictureInPicture()
    
    // 화면 우하단에서 0.1배 크기로 앱 내 PIP 전환
    ShopLive.startPictureInPicture(with: .bottomRight, scale: 0.1)
    
    // 화면 좌상단에서 0.8배 크기로 앱 내 PIP 전환
    ShopLive.startPictureInPicture(with: .topLeft, scale: 0.8)
    

    크기 설정 예시

    Size

    PIP screen

    0.1

    0.4

    0.8


    stopPictureInPicture

    PIP 모드를 전체 화면 모드로 전환합니다.

    stopPictureInPicture()

    Sample code

    ShopLive.stopPictureInPicture()


    hookNavigation

    hookNavigation(navigation: @escaping ((URL) -> Void))

    Parameter name

    Type

    Description

    navigation

    URL

    상품 또는 배너를 선택할 때 호출되는 block

    • 선택한 상품 또는 배너의 URL 전달

    Sample code

    ShopLive.hookNavigation { url in
           // url: 선택한 상품 또는 배너에 설정된 상세 정보 URL
           print("hookNavigation \(url)")
       }


    KeepWindowStyleOnReturnFromOsPip 옵션

    setKeepWindowStyleOnReturnFromOsPip

    OS PIP를 사용하는 경우 Shoplive Player가 재생중인 상태(pip, fullscreen)에서 홈화면 또는 다른 앱으로 이동(백그라운드 상태로 전환) 하면서 영상이 OS PIP로 진입된 후, 다시 앱으로 돌아오면서 마지막 재생중이던 상태(pip, fullscreen)로 전환 또는 항상 전체화면으로만 전환되도록 선택할 수 있습니다.

    setKeepWindowStyleOnReturnFromOsPip(_ keep: Bool)

    Parameter name

    Type

    Description

    keep

    Bool

    OS PIP상태에서 앱으로 돌아올 때 플레이어 재생중 상태를 설정

    • false: 항상 전체화면으로 전환

    • true: 마지막 재생중이던 상태(pip, fullscreen)로 전환 (기본값)

    Sample code

    // OS PIP로 전환 되기전 마지막 재생중 상태로 유지하도록 설정
    ShopLive.setKeepWindowStyleOnReturnFromOsPip(true)
    
    // OS PIP상태에서 앱으로 전환되면서 항상 전체화면으로 전환되도록 설정
    ShopLive.setKeepWindowStyleOnReturnFromOsPip(false)

    isKeepWindowStyleOnReturnFromOsPip

    현재 설정된 값을 반환합니다.

    • false: 항상 전체화면으로 전환

    • true: 마지막 재생중이던 상태(pip, fullscreen)로 전환 (기본값)

    isKeepWindowStyleOnReturnFromOsPip() -> Bool

    Sample code

    print(ShopLive.isKeepWindowStyleOnReturnFromOsPip())


    ShopLiveCommonUser

    Shoplive를 사용하는 인증된 사용자입니다. 사용자를 인증하기 위해 사용자 정보를 입력합니다.

    var user: ShopLiveCommonUser? { get set }
    // 사용자 성별
    public enum ShopliveCommonUserGender : String, CaseIterable {
        case female = "f"
        case male = "m"
        case neutral = "n"
    }
    public class ShopLiveCommonUser: NSObject {
        var userId: String?
        var name: String?
        var age: Int?
        var gender: ShopliveCommonUserGender?
        var userScore : Int?
        var custom : [String : Any]?
    

    Objective-C 환경에서는 ShopLiveInCommonUserObjc 객체를 사용해야 합니다.


    authToken

    Shoplive를 사용하는 인증된 사용자의 보안 인증토큰(JWT) string입니다. 사용자 인증을 위해 인증된 사용자의 보안 인증토큰(JWT) string을 입력합니다.

    var authToken: String? { get set }

    Sample code

    let generatedJWT = "eyJhbGciOiJIUzI1NiJ9.eyJleHAiOjE2MTA1NzA1dfadsfasfadsfasdfwO"
    
    ShopLive.authToken = generatedJWT


    style

    현재 Shoplive Player 스타일입니다.

    var style: ShopLive.PresentationStyle { get }
    public enum PresentationStyle: Int {
        case unknown
        case fullScreen
        case pip
    }
    

    Sample code

    print(ShopLive.style)


    playerMode

    현재 Shoplive Player의 모드입니다.

    var playerMode: ShopLive.PlayerMode { get }
    public enum PlayerMode: Int {
        case play
        case preview
        case none
    }

    enum PlayerMode

    Value

    Description

    play

    play api로 Player가 실행된 상태로 영상(리허설, 라이브, 다시보기)를 재생중

    preview

    preview api로 Player가 실행된 상태로 미리보기 재생중

    none

    Player가 실행중이지 않은 상태


    orientationMode

    현재 Shoplive Platyer에서 재생중인 방송의 영상 비율 정보입니다.

    var orientationMode: ShopLive.VideoOrientation { get }

    public enum VideoOrientation: Int {
        case portrait
        case landscape
        case unknown
    }

    enum VideoOrientation

    Value

    Description

    portrait

    세로 비율 모드의 방송 (비율 예 - 9:16)

    landscape

    가로 비율 모드의 방송(비율 예 - 16:9)

    unknown

    모드를 알수 없는 상태, 방송 중이지 않거나, SDK로 방송 정보 정보가 아직 업데이트 되지 않은 상태


    playerWindow

    현재 Shoplive Player가 표시되고 있는 UIWindow의 인스턴스입니다.

    var playerWindow: ShopLiveWindow? { get }

    playerWindow.forceAddSubView

    ShopLive 프레임워크 위에 고객사의 뷰를 넣고 싶은 경우 사용하는 함수입니다.

    일반적인 addSubView의 경우 ShopLive 정책에 따라 고객사의 뷰가 추가되지 않을 수 있습니다.

    ShopLive.playerWindow?.forceAddSubView({YOUR_VIEW})


    viewController

    현재 Shoplive Player가 표시되고 있는 UIViewController의 인스턴스입니다.

    var viewController: ShopLiveViewController? { get }

    Sample code

    // Shoplive Player 위에 Alert를 표시
    let alert = UIAlertController.init(title: "Alert on Player", message: nil, preferredStyle: .alert)
    alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
    
    ShopLive.viewController?.present(alert, animated: true, completion: nil)


    setVisibleStatusBar 옵션

    Shoplive Player가 전체화면으로 재생되고 있을때 앱의 상태바를 숨길 수 있습니다. inAppPip의 경우 상태바가 자동으로 보이게 됩니다.

    setVisibleStatusBar

    setVisibleStatusBar(isVisible : Bool)

    Parameter name

    Type

    Description

    isVisible

    Bool

    상태바의 숨김 유무를 설정합니다.

    • true: 상태바 보이기 (기본값)

    • false: 상태바 숨기기

    Sample code

    ShopLive.setVisibleStatusBar(isVisible : Bool)


    indicatorColor

    로딩 인디케이터 색을 설정합니다.

    var indicatorColor: UIColor { get set }

    Sample code

    ShopLive.indicatorColor = UIColor.red


    isSuccessCampaignJoin

    방송 진입 성공 여부를 확인합니다.

    • 관련 callback: handleReceivedCommand - ON_SUCCESS_CAMPAIGN_JOIN

    isSuccessCampaignJoin() -> Bool

    Sample code

    print(ShopLive.isSuccessCampaignJoin())


    AutoResumeVideoOnCallEnded 옵션

    통화 종료 후 영상으로 돌아왔을 때, 자동 재생이 되도록 설정합니다.

    setAutoResumeVideoOnCallEnded

    setAutoResumeVideoOnCallEnded(_ autoResume: Bool)

    Parameter name

    Type

    Description

    autoResume

    Bool

    통화 종료 후, 영상 자동 재생

    • true: 자동 재생

    • false: 자동 재생되지 않음 (기본값)

    Sample code

    ShopLive.setAutoResumeVideoOnCallEnded(true)
    

    isAutoResumeVideoOnCallEnded

    현재 설정된 값을 반환합니다.

    • true: 통화 종료 후 자동재생

    • false: 통화종료 후 영상 정지

    isAutoResumeVideoOnCallEnded() -> Bool

    Sample code

    print(ShopLive.isAutoResumeOnCallEnded())


    KeepPlayVideoOnHeadphoneUnplugged 옵션

    이어폰(또는 헤드셋) 연결이 끊겼을 때, 영상을 중지하지 않고 자동 재생이 되도록 설정합니다.

    setKeepPlayVideoOnHeadphoneUnplugged

    이어폰(또는 헤드셋) 연결이 끊겼을 때, 영상을 중지하지 않고 자동 재생이 되도록 설정합니다.

    setKeepPlayVideoOnHeadphoneUnplugged(_ keepPlay: Bool)

    Parameter name

    Type

    Description

    keepPlay

    Bool

    이어폰(또는 헤드셋) 연결이 끊겼을 때, 계속 영상 재생

    • true: 자동 재생

    • false: 자동 재생되지 않음(기본값)

    Sample code

    ShopLive.setKeepPlayVideoOnHeadphoneUnplugged(true)

    isKeepPlayVideoOnHeadPhoneUnplugged

    현재 설정된 값을 반환합니다.

    • true: 영상 계속 재생

    • false: 연결이 끊기면 영상 정지

    isKeepPlayVideoOnHeadPhoneUnplugged() -> Bool

    Sample code

    print(ShopLive.isKeepPlayVideoOnHeadPhoneUnplugged())


    NextActionOnHandleNavigation 옵션

    사용자가 상품, 공지사항, 배너 등 링크를 선택하였을 때, Shoplive Player의 다음 동작을 설정합니다.

    public enum ActionType: Int {
        case PIP
        case KEEP
        case CLOSE
    }

    enum ActionType

    Value

    Description

    PIP

    PIP 전환

    KEEP

    상태 유지

    CLOSE

    종료

    setNextActionOnHandleNavigation

    setNextActionOnHandleNavigation(actionType: ActionType)

    Parameter name

    Type

    Description

    actionType

    ActionType

    사용자의 링크 선택 시 Shoplive Player의 다음 동작

    Sample code

    // PIP 전환
    ShopLive.setNextActionOnHandleNavigation(.PIP)
    
    // 상태 유지
    ShopLive.setNextActionOnHandleNavigation(.KEEP)
    
    // 종료
    ShopLive.setNextActionOnHandleNavigation(.CLOSE)
    

    getNextActionTypeOnHandleNavigation

    사용자의 링크 선택 시 설정된 Shoplive Player의 다음 동작을 확인합니다.

    getNextActionTypeOnHandleNavigation() -> ActionType

    Sample code

    print(ShopLive.getNextActionTypeOnHandleNavigation())


    sendCommandMessage

    서버로 command와 payload를 전달합니다. 사전 정의된 형식의 command, payload를 전달할 수 있습니다. (또는, Shoplive와 협의하여 command와 payload를 정의할 수 있습니다.)

    @objc static func sendCommandMessage(command: String, payload: [String:Any]?)

    Parameter name

    Type

    Description

    command

    String

    사전 정의된 command

    payload

    [String:Any]?

    사전 정의된 payload

    Sample code

    let command: String = “COMMAND_NAME”
    var payload: [String : Any] = [:]
    
    payload[“Int_Data” : 1]
    payload[“String_Data” : “Sample_String”]
    
    ShopLive.sendCommandMessage(command: command, payload: payload)
    
    ex) 플레이어위에 토스트 메세지를 띄울때 
    //    {
    //      message: string // 필수
    //      duration: number // optional, 표시될 시간 milliseconds
    //      position: string // optional "TOP" | "BOTTOM" | "CENTER"
    //    }
    let command : String = "SHOW_LAYER_TOAST"
    var payload : [String : Any] = [:]
    payload["message"] = message
    payload["duration"] = duration
    payload["position"] = position.rawValue
    ShopLive.sendCommandMessage(command: command, payload: payload)


    setMuteWhenPlayStart

    Shoplive Player를 시작할 때 사운드가 켜지도록 하거나 음소거하도록 설정합니다. (기본값: 사운드가 켜진 상태로 Shoplive Player를 시작합니다.)

    @objc static func setMuteWhenPlayStart(_ mute: Bool)

    Parameter name

    Type

    Description

    mute

    String

    음소거 설정 여부

    • true: 음소거로 시작

    • false: 사운드 켜진 상태로 시작

    Sample code

    // Shoplive Player를 시작할 때 음소거하도록 설정
    ShopLive.setMuteWhenPlayStart(true)
    
    //Shoplive Player를 시작할 때 사운드가 켜지도록 설정
    ShopLive.setMuteWhenPlayStart(false)


    setEnabledPictureInPicture

    앱에서 InAppPip와 OSPIP 동작을 허용 여부를  설정합니다.(기본값 : true)

    @objc static func setEnablePictureInPicture(isEnabled: Bool) 

    Sample code

    // InAppPip와 OSPIP 모두 허용
    ShopLive.setEnabledPictureInPicture(isEnabled: true)
    
    // InAppPip와 OSPIP 모두 비허용
    ShopLive.setEnabledPictureInPicture(isEnabled: false)


    setEnableOSPictureInPicture

    앱에서 OSPIP 동작을 허용 여부를 설정합니다.(기본값: true)

    @objc static func setEnabledOSPictureInPictureMode(isEnabled: Bool) 

    Sample code

    // InAppPip 허용, OSPIP 비허용 
    ShopLive.setEnabledPictureInPicture(isEnabled: true)
    ShopLive.setEnabledOSPictureInPicture(isEnabled: false)
    
    // InAppPip와 OSPIP 모두 허용
    ShopLive.setEnabledPictureInPicture(isEnabled: true)
    ShopLive.setEnabledOSPictureInPicture(isEnabled: true)
    
    // InAppPip와 OSPIP 모두 비허용
    ShopLive.setEnabledPictureInPicture(isEnabled: false)
    ShopLive.setEnabledOSPictureInPicture(isEnabled: true)


    setPictureInPicturePadding

    앱 내 PIP에서 PIP 패딩을 설정합니다. (top, left, right, bottom)

    • 기본값: top, left, right, bottom 모두 20으로 설정

    • 유효하지 않은 값이 설정 되면 false를 반화하고 기본값을 적용합니다.

    @objc static func setPictureInPicturePadding(padding: UIEdgeInsets) -> Bool

    Parameter name

    Type

    Description

    padding

    UIEdgeInsets

    Top, left, right, bottom 등 padding 값을 설정합니다.

    Sample code

    // left: 20 right: 30 bottom: 10 top: 10 으로 설정
    
    let padding: UIEdgeInsets = .init(top: 10, left: 20, bottom: 10, right: 30)
    
    ShopLive.setPictureInPicturePadding(padding: padding)


    setPictureInPictureFloatingOffset

    앱 내 PIP에서 PIP가 이동할 수 있는 영역을 설정합니다. 유효하지 않은 값이 설정 되면 false를 반화하고 기본값을 적용합니다.

    @objc static func setPictureInPictureFloatingOffset(offset: UIEdgeInsets) -> Bool

    Parameter name

    Type

    Description

    offset

    UIEdgeInsets

    Top, left, right, bottom 등 offset 값을 설정합니다.

    Sample code

    // left: 20, right: 30, bottom: 10, top: 10으로 offset 값 설정
    
    let offset: UIEdgeInsets = .init(top: 10, left: 20, bottom: 10, right: 30)
    
    ShopLive.setPictureInPictureFloatingOffset(offset: offset)


    setUsingLocalStorage

    로컬 스토리지 저장 기능 사용 여부를 설정합니다.

    @objc static func setUsingLocalStorage(_ use: Bool)

    Parameter name

    Type

    Description

    use

    Bool

    로컬 스토리지 저장 기능 사용 여부

    • true: 로컬 스토리지 저장 기능 사용

    • false: 로컬 스토리지 저장 기능 사용 안 함op, left, right, bottom 등 offset 값을 설정합니다.

    Sample code

    // 로컬 스토리지 저장 기능을 사용하도록 설정
    ShopLive.setUsingLocalStorage(true)
    
    // 로컬 스토리지 저장 기능을 사용하지 않도록 설정
    ShopLive.setUsingLocalStorage(false)


    setAppVersion

    앱 버전을 설정합니다.

    • API를 호출하지 않아도 기본으로 앱의 버전을 읽고 서버로 전달합니다.

    • 이 기능을 사용하려면 Shoplive 담당자에게 문의하세요.

    @objc static func setAppVersion(_ appVersion: String)

    Parameter name

    Type

    Description

    appVersion

    String

    앱 버전

    Sample code

    let appVersion: String = “1.0.0”
    
    ShopLive.setAppVersion(appVersion)


    setMixWithOthers

    외부 오디오와 함께 방송을 시청할 수 있습니다.

    @objc static func setMixWithOthers(_ isMixAudio: Bool)

    Parameter name

    Type

    Description

    isMixAudio

    Bool

    • true: 외부 오디오와 함께 방송 시청

    • false: 외부 오디오가 재생되면 Player는 일시정지 (기본값: true)

    Sample code

    // 외부 오디오가 재생되면 Player는 일시정지
    ShopLive.setMixWithOthers(false)
    
    // 외부 오디오와 함께 방송 시청
    ShopLive.setMixWithOthers(true)


    useCloseButton

    Preview와 PIP모드에서 닫기 버튼을 활성화할 수 있습니다.

    @objc static func useCloseButton(_ use: Bool)

    Parameter name

    Type

    Description

    use

    Bool

    • true: Preview와 PIP모드에서 닫기 버튼 사용

    • false: Preview와 PIP모드에서 닫기 버튼 사용하지 않음

    Sample code

    // Preview와 PIP모드에서 닫기 버튼 사용하지 않음
    ShopLive.useCloseButton(false)
    
    // Preview와 PIP모드에서 닫기 버튼 사용
    ShopLive.useCloseButton(true)


    addParameter

    플레이어를 실행하기 전에 커스텀 데이터를 추가할 수 있습니다.

    @objc static func addParameter(key: String, value: String)

    Parameter name

    Type

    Description

    key

    String

    추가 적용할 커스텀 파라미터 key

    value

    String

    추가 적용할 커스텀 파라미터 value

    Sample code

    ShopLive.addParameter(key: "key", value: "value")


    removeParameter

    플레이어를 실행하기 전에 addParameter() 함수로 추가했던 커스텀 데이터를 삭제합니다.

    @objc static func removeParameter(key: String)

    Parameter name

    Type

    Description

    key

    String

    삭제할 커스텀 파라미터 key

    Sample code

    ShopLive.removeParameter(key: "key)


    setUtmSource

    UTM Source를 tracking 할 수 있습니다. 데이터는 데이터 인사이트에서 확인 할 수 있습니다.

    func setUtmSource(utmSource: String?)

    Parameter name

    Type

    Description

    utmSource

    String?

    해당 유입이 어디에서 발생하였는지를 전달해줍니다.

    Sample code

    ShopLive.setUtmSource(“{utm_source}”)


    setUtmMedium

    UTM Medium를 tracking 할 수 있습니다. 데이터는 데이터 인사이트에서 확인 할 수 있습니다.

    func setUtmMedium(utmMedium: String?)

    Parameter name

    Type

    Description

    utmMedium

    String?

    해당 유입이 어떻게 발생하였는지를 전달해줍니다. 구글은 medium 파라미터를 유입이 유도된 마케팅 방식을 지칭하도록 세팅하는 것을 권장하고 있습니다. (e.g. cpc, banner, email, blog, social etc.)

    Sample code

    ShopLive.setUtmMedium(“{utm_medium}”)


    setUtmCampaign

    UTM Campaign를 tracking 할 수 있습니다. 데이터는 데이터 인사이트에서 확인 할 수 있습니다.

    func setUtmCampaign(utmCampaign: String?)

    Parameter name

    Type

    Description

    utmCampaign

    String?

    어떤 광고의 캠페인으로 유입이 발생하였는지를 전달해줍니다. Campaign Name, Campaign Term, Campaign Content로 나눠서 만들 수 있습니다.

    Sample code

    ShopLive.setUtmCampaign(“{utm_campaign}”)


    setUtmContent

    UTM Content를 tracking 할 수 있습니다. 데이터는 데이터 인사이트에서 확인 할 수 있습니다.

    func setUtmContent(utmContent: String?)

    Parameter name

    Type

    Description

    utmContent

    String?

    해당 유입이 어떤 내용을 가진 포스팅/광고에 의해서 발생하였는지를 전달해줍니다. 주로 campaign 파라미터의 하위 구분으로 자주 활용됩니다.

    Sample code

    ShopLive.setUtmContent(“{utm_content}”)


    setResizeMode

    영상의 종횡비를 유지할 수 있습니다.

    ShopLive.setResizeMode(option : ShopLiveResizeMode)



    What's Next