Difference between revisions of "Android Studio: HMS Video Play Kit"

From OnnoWiki
Jump to navigation Jump to search
Line 50: Line 50:
  
 
* https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides-V5/introduction-0000001050439577-V5
 
* https://developer.huawei.com/consumer/en/doc/development/HMSCore-Guides-V5/introduction-0000001050439577-V5
 +
* https://medium.com/@cheekian27/tsdplayer-a-media-player-integrating-hms-video-kit-and-audio-kit-part-1-9b498a785a52

Revision as of 10:10, 17 March 2022


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'
}



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