Add below maven url to your project build.gradle file in allprojects
maven {
url "https://sdk.peervadoo.com/"
}
In your module build.gradle file add below line in dependencies
implementation 'com.vadoo:p2penginelite:0.0.1'
Also add below code in android section to enable Java 8 support which is needed for Exoplayer
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
Enable cleartext attribute in app/src/main/AndroidManifest.xml to indicate that the app intends to use cleartext HTTP
<application
...
android:usesCleartextTraffic="true"
...
>
In your app/src/AndroidManifest.xml add below meta-data. To get the token follow the steps mentioned in README
<meta-data android:value="Your-token"
android:name="vadoo_token"/>
Add below code to your Application to initalize the p2p engine
public class Video_Application extends Application {
private VadooLoader loader = null;
@Override
public void onCreate() {
super.onCreate();
if(loader == null) {
loader = new VadooLoader(this);
}
}
public VadooLoader getLoader() {
return loader;
}
}
Replace the url of video url by the url generated by Vadoo loader
VadooLoader loader = ((Vadoo_Application)getApplication()).getLoader();
play_url = loader.parseStreamUrl(this, play_url);
The changed url can be passed to a player like Exoplayer
For a complete example checkout the examples from here Sample Apps