Step1. インストール

    Step1. インストール


    記事の要約

    必ずShopLiveHandlerを登録してください。

    ShopLive.setHandlerインターフェースを使用すると、ボタンの機能を実装できます。以下の ハンドラー登録 ガイドを参照してください。


    app/build.gradleにLiveライブラリ、統合ライブラリ、または分割ライブラリを選択して追加します。

    1. Liveライブラリ

    dependencies {
        def shoplive_sdk_version = "1.5.11"
      
        // Shoplive live player
        implementation "cloud.shoplive:shoplive-sdk:$shoplive_sdk_version"
    }
    

    1. 統合ライブラリ

    dependencies {
        def shoplive_sdk_version = "1.5.11"
        
        // Shoplive combined packaging
        implementation "cloud.shoplive:shoplive-sdk-all:$shoplive_sdk_version" // live + short-form
    }
    

    1. 分割ライブラリ

    dependencies {
        def shoplive_sdk_version = "1.5.11"
        def your_exoplayer_version = "2.19.1"
        def your_media3_version = "1.3.1"
        def shoplive_exoplayer_version = your_exoplayer_version + "." + "8"
        def shoplive_media3_version = your_media3_version + "." + "8"
        
        // Shoplive split packaging
        implementation "cloud.shoplive:shoplive-common:$shoplive_sdk_version" // must required
        implementation "cloud.shoplive:shoplive-exoplayer:$shoplive_exoplayer_version" // must required
        // When using media3. Exoplayer will be deprecated soon.
        // https://developer.android.com/guide/topics/media/media3/getting-started/migration-guide
        // implementation "cloud.shoplive:shoplive-media3:$shoplive_media3_version" 
        implementation "cloud.shoplive:shoplive-network:$shoplive_sdk_version" // must required
      
        implementation "cloud.shoplive:shoplive-sdk-core:$shoplive_sdk_version" // for live player
      
        implementation "cloud.shoplive:shoplive-short-form:$shoplive_sdk_version" // for short-form player
    }
    

    ハンドラーを登録する

    Shoplive Android SDKから複数のイベントを受け取るために Handler を登録します

    ShopLive.setHandler(object : ShopLiveHandler() {
        override fun handleNavigation(context: Context, url: String) {
            // Do something
        }
    })