EcoCDN P2P WebRTC
  • Introduction
  • HLS INTEGRATION
  • HTML5 Players
  • VideoJS Player
  • Android Integration
    • Environment Configuration
    • Import Android-SDK
    • Quick Start
    • Advanced Usage
    • API & Config
  • IOS INTEGRATION
    • Requirements
    • Project Setup
    • Integration
    • Advanced Usage
Powered by GitBook
On this page
  • Turn on Java 8 support
  • Add Uses Permission
  • Allow HTTP Request (Only required by HLS, DASH)
  • Proguard Configuration

Was this helpful?

  1. Android Integration

Environment Configuration

Turn on Java 8 support

You also need to turn on Java 8 support in application's build.gradle, by adding the following to the android section:

android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

Add Uses Permission

Add in app/src/main/AndroidManifest.xml:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

Allow HTTP Request (Only required by HLS, DASH)

Starting with Android 9 (API level 28), cleartext support is disabled by default. There are 2 solutions: (1) set targetSdkVersion under 27 (2) Add the attribute below in app/src/main/AndroidManifest.xml to indicate that the app intends to use cleartext HTTP:

<application
  ...
  android:usesCleartextTraffic="true"
  ...
    />

Proguard Configuration

Add the following code in proguard-rules.pro:

-dontwarn com.p2p.**
-keep class com.p2p.**{*;}
-keep interface com.p2p.**{*;}
-dontwarn org.webrtc.**
-keep class org.webrtc.**{*;}
PreviousVideoJS PlayerNextImport Android-SDK

Last updated 3 years ago

Was this helpful?