Difference between revisions of "Android Studio: HMS Video Play Kit"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) |
Onnowpurbo (talk | contribs) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | '''WARNING: TIDAK BISA UNTUK INDONESIA''' | ||
+ | |||
+ | |||
Line 13: | Line 16: | ||
implementation 'com.huawei.hms:videokit-player-fallback:1.0.10.300' | 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" /> | ||
+ | |||
Line 18: | Line 66: | ||
* 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 |
Latest revision as of 10:37, 17 March 2022
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" />