Watch Media Together Live
Entertainment. Together. Live.
DK Video Player
...
WANT YOUR OWN DEVELOPER KEY AND ID? EMAIL SUSAN@DABKICK.COM
...
Integrate DK Video Player:
Step 1: In Project-level build.gradle add the following code
to add the video player as a dependency.
allprojects {
	repositories {
		google()
	jcenter()
	flatDir {
		dirs 'libs'
	}
	maven { url 'https://jitpack.io' }
	maven {
		url "http://dabkick.bitnamiapp.com/artifactory/android-dev-videosdk-local/"
	}
}
			
Step 2: In app level build.gradle add the following compile dependency
Below is the dependency line which downloads the aar file from Bitnami server. Flags transitive and changing are required as we need .aar file to access our code and APIs. If the transitive flag is made false, then we cannot access our API's code.
dependencies { compile('com.dabkick.dkvideoplayer:dkvideoplayer:5.0.1') { transitive = true; changing = true } }
Step 3: Add the following permission in the AndroidManifest file
<uses-permission android:name="android.permission.INTERNET"/>
			
Step 4: Add the following meta-data under the application tag of Android Manifest
<meta-data
	android:name="com.dabkick.developer_id"
	android:value="your_developer_id" />
<meta-data			 
	android:name="com.dabkick.developer_key"
	android:value="your_developer_key" />
			
where your_developer_id and your_developer_key is to be replaced with the values obtained from DabKick.
Step 5: To get the functionalities of DKVideoPlayer at this stage, run Gradle Sync and build the project
Step 6: Extend DKVPApp of DKVideoplayer
com.dabkick.dkvideoplayer.publicsettings.DKVPApp;
public class YourApplication extends DKVPApp { }
			
Step 7: Assign the name of this extended application class as an attribute to the “android:name” application tag in AndroidManifest
<application android:name=".YourApplication"
			
Step 8: Call Registration () of Dabkick in the onCreate () of MainActivity of the application
DabkickRegistration dabKickRegistration = DabkickRegistration.newInstance();
	dabKickRegistration.register(this);
			
Registration with DabKick is an optional step. Without registration, DKVP functions like the normal ExoPlayer. However, registration gives additional features like watching with friends and chat.
Using the Video Player:
Step 1: Assign/Call DkVideoView in the XML file where the video needs to be played. Here, attributes like width, height, theme and background of the video view can be customized
<com.dabkick.dkvideoplayer.livesession.videoplayer.DkVideoView android:id="@+id/video_view" android:layout_width="match_parent"
			android:layout_height="200dp" />
			
Step 2: Reference this DkVideoView in the Activity .java file
dkVideoPlayer = findViewById(R.id.video_view);
			
Step 3: Assign lifecycle observers to the video view and the DabkickRegistration instance
getLifecycle().addObserver(dkVideoPlayer);
				getLifecycle().addObserver(dkVideoPlayer);
				getLifecycle().addObserver(dabkickRegistration);
			
Step 4: When ready to play a video on the video player, pass the URL of the video to be played to setMediaItem(videoUrl) followed by prepare(true).
dkVideoPlayer.setMediaItem(fullStreamURL);
dkVideoPlayer.prepare(true);
			
Observing the video player:
Step 1: Register your activity with EventBus in onStart() and unregister event bus in onStop()
@Override
protected void onStart() {
super.onStart();
if (!EventBus.getDefault().isRegistered(this)) {
	EventBus.getDefault().register(this);
}
}
@Override
protected void onStop() {
super.onStop();
if (EventBus.getDefault().isRegistered(this)) {
	EventBus.getDefault().unregister(this);
}
}
			
Step 2: Create a onMessageEvent () to receive notifications from DKVideoPlayer via EventBus. You will use this message handler to load videos into the the video player as they come in.
@Subscribe(threadMode = ThreadMode.MAIN)
	public void onMessageEvent(NotifyStageVideoReceived event) {
		if (event.url != null && dkVideoPlayer != null) {
			dkVideoPlayer.release();
			dkVideoPlayer.setMediaItem(event.url);
			dkVideoPlayer.prepare(false);
			dkVideoPlayer.bringToFront();
		}
	}
				
1
LEARN WHAT DK VIDEO PLAYER CAN DO FOR YOUR COMPANY'S APP
DOWNLOAD YOUR DECK
2
DOWNLOAD OUR SAMPLE ANDROID APP TO SEE DK VIDEO PLAYER IN ACTION
DOWNLOAD THE SAMPLE APP
3
FIND OUT HOW TO INTEGRATE DK PLAYER INTO YOUR APP
GET INTEGRATION INSTRUCTIONS + CREDENTIALS
LET YOUR USERS WATCH TOGETHER

Have any questions or need some help?

You can email us at susan@dabkick.com or call/text us at (209) 232-6399