API - Play

    API - Play


    기사 요약

    play

    ShopLivePlayerData를 사용하여 영상을 재생합니다.

    play(data : ShopLivePlayerData)

    ShopLivePlayerData

    Parameter name

    Description

    campaignKey

    재생할 영상의 캠페인(방송) 키(required)

    keepWindowStateOnPlayExecuted

    재생중인 플레이어의 실행 모드(Pip, Fullscreen)을 유지한 상태로 재생을 시작할 지 여부. (Default: true)

    • true: 재생중인 플레이어의 실행 모드를 유지합니다.

    • false: fullscreen으로 실행됩니다.

    referrer

    진입경로 통계를 측정할 수 있는 파라미터 (optional)

    campaignHandler

    ((ShopLivePlayerCampaign) -> ())?

    Shoplive의 방송 캠페인에 대한 정보를 받을 수 있는 handler입니다.

    brandHandler

    ((ShopLivePlayerBrand) -> ())?

    Shoplive의 방송 브랜드에 대한 정보를 받을 수 있는 handler입니다.

    isEnabledVolumeKey

    Preview 디바이스 볼륨에 따라 음소거 해제될 수 있는 기능이 추가되었습니다.(Default: false)

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

    ShopLive.play(data:.init(campaignKey: "{CampaignKey}", keepWindowStateOnPlayExecuted: true, referrer: "{진입경로}", campaignHandler : ((ShopLivePlayerCampaign) -> ())? = nil, brandHandler : ((ShopLivePlayerBrand) -> ())? = nil, isMuted : Bool? = nil))

    ShopLivePlayerCampaign

    Parameter name

    Description

    title

    캠페인 제목

    campaignStatus

    캠페인의 상태(READY, ONAIR, CLOSED)

    ShopLivePlayerBrand

    Parameter name

    Description

    name

    브랜드의 이름

    identifier

    브랜드의 고유 식별자

    imageUrl

    브랜드의 thumbnail 이미지 주소

    Sample code

    ShopLive.play(data:.init(campaignKey: "{CampaignKey}", keepWindowStateOnPlayExecuted: true, referrer: "{진입경로}", campaignHandler : ((ShopLivePlayerCampaign) -> ())? = nil, brandHandler : ((ShopLivePlayerBrand) -> ())? = nil, isMuted : Bool? = nil))
    


    preview

    ShopLivePlayerData를 사용하여 preview를 재생합니다.

    preview(data : ShopLivePlayerData,completion: (() -> Void)?)

    ShopLivePreviewData

    Parameter name

    Description

    campaignKey

    재생할 영상의 캠페인(방송) 키(required)

    keepWindowStateOnPlayExecuted

    재생중인 플레이어의 실행 모드(Pip, Fullscreen)을 유지한 상태로 재생을 시작할 지 여부. (Default: false)

    • true: 재생중인 플레이어의 실행 모드를 유지합니다.

    • false: Fullscreen으로 실행됩니다.

    referrer

    진입경로 통계를 측정할 수 있는 파라미터 (optional)

    campaignHandler

    ((ShopLivePlayerCampaign) -> ())?

    Shoplive의 방송 캠페인에 대한 정보를 받을 수 있는 handler입니다.

    brandHandler

    ((ShopLivePlayerBrand) -> ())?

    Shoplive의 방송 브랜드에 대한 정보를 받을 수 있는 handler입니다.

    isMuted

    preview의  음소거 여부를 설정 할  수 있습니다.

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

    Sample code

    ShopLive.preview(data:.init(campaignKey: "{CampaignKey}", keepWindowStateOnPlayExecuted: true, referrer: "{진입경로}", campaignHandler : ((ShopLivePlayerCampaign) -> ())? = nil, brandHandler : ((ShopLivePlayerBrand) -> ())? = nil, isMuted : Bool? = nil),completion : nil)


    close

    시청 중인 방송을 종료합니다.

    ShopLiveViewHiddenActionType

    Action type

    Description

    onSwipeOut

    Preview를 쓸어넘겨서 종료

    onBtnTapped

    뒤로가기 버튼을 눌러서 종료

    onClose

    close() 함수를 호출해서 종료

    onError

    오류로 인한 종료

    onRestoringPip

    PIP에서 앱으로 복귀시 에러로 종료

    onNavigationHandleClose

    사용자가 nextActionTypeOnHandleNavigation 의 정의 .CLOSE로 했을때 종료

    Sample code

    ShopLive.close()



    What's Next