2단계 Shoplive Player 실행하기

    2단계 Shoplive Player 실행하기


    The content is currently unavailable in English. You are viewing the default Korean version.
    Article summary

    라이브 실행하기

    준비된 Access Key와 Campaign Key를 사용해 Shoplive Flutter SDK 를 초기화하고 플레이어를 실행합니다.

    import 'package:shoplive_player/shoplive_common.dart';
    final _shopLiveCommon = ShopLiveCommon();
    _shopLiveCommon.setAccessKey(accessKey: "{AccessKey}");

    방송 재생

    캠페인(방송) 키를 사용하여, 방송을 재생할 수 있습니다.

    import 'package:shoplive_player/shoplive_player.dart';
    
    final _player = ShopLivePlayer();
    _player.play(data: ShopLivePlayerData(campaignKey: "CampaignKey"));

    ShopLivePlayerData

    Property name

    Type

    Description

    campaignKey

    String

    재생할 동영상의 캠페인(방송) 키 (필수)

    keepWindowStateOnPlayExecuted

    Boolean

    재생 중인 플레이어의 실행 모드(pip, fullscreen)을 유지한 상태로 재생을 시작할 지 여부. 기본값(false)

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

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

    referrer

    String?

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

    ShopLiveCommonUser

    Property name

    Type

    Description

    userId

    String

    서비스에서 사용하는 사용자 고유 ID (필수)

    userName

    String?

    채팅/플레이어 UI에 표시되는 이름

    age

    int?

    사용자 나이

    gender

    ShopLiveCommonUserGender?

    사용자 성별 (MALE, FEMALE, NEUTRAL)

    userScore

    int?

    사용자 등급

    custom

    Map<String, dynamic>?

    사용자 임의 데이터


    라이브 종료하기

    void close()를 통해 라이브 상세화면을 종료합니다.

    late final _player = ShopLivePlayer();
    _player.close();