Android Studio: HMS Video Play Kit

From OnnoWiki
Jump to navigation Jump to search

WARNING: TIDAK BISA UNTUK INDONESIA



Configure Maven dependencies in the build.gradle file under the app directory of your Android Studio project.

dependencies {
......
    implementation "com.huawei.hms:videokit-player:1.0.10.300"
}

If you want your app to use Video Kit without relying on HMS Core (APK), add the following fallback dependencies in the dependencies block.

dependencies {
    implementation 'com.huawei.hms:videokit-player-fallback:1.0.10.300'
}


Configure the NDK in the build.gradle file under the app directory of your Android Studio project.

android {
        defaultConfig {
            ......
            ndk {
                abiFilters "armeabi-v7a", "arm64-v8a"
            }
        }
        ......
}



In the AndroidManifest.xml file, add the following permissions for your app:

   // Add the permission to access the Internet.
   <uses-permission android:name="android.permission.INTERNET" />
   // Add the permission to obtain the network status.
   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
   // Add the permission to access the Wi-Fi network.
   <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
   // Add the permission to write data into external storage.
   <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
   // Add the permission to read data from external storage.
   <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
   // (Optional) Add the permission to read device information, which helps users better experience the functions of WisePlayer.
   <uses-permission android:name="android.permission.READ_PHONE_STATE" />
   // Add the permission to check whether a device is rooted.
   <uses-permission android:name="com.huawei.permission.SECURITY_DIAGNOSE" />


Contoh:

   <uses-permission android:name="android.permission.INTERNET" />
   <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
   <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
   <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
   <uses-permission android:name="android.permission.READ_PHONE_STATE" />
   <uses-permission android:name="com.huawei.permission.SECURITY_DIAGNOSE" />


Referensi