diff --git a/app/src/main/java/com/tpstream/app/MainActivity.kt b/app/src/main/java/com/tpstream/app/MainActivity.kt index e2728708..e9f549a1 100644 --- a/app/src/main/java/com/tpstream/app/MainActivity.kt +++ b/app/src/main/java/com/tpstream/app/MainActivity.kt @@ -4,6 +4,8 @@ import android.content.Intent import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.view.View +import com.tpstream.player.TpInitParams +import com.tpstream.player.TpStreamDownloadManager class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { @@ -34,4 +36,26 @@ class MainActivity : AppCompatActivity() { startActivity(myIntent) } + fun apiDownload(view: View) { + val drmVideo = TpInitParams.Builder() + .setVideoId("C3XLe1CCcOq") + .setAccessToken("c381512b-7337-4d8e-a8cf-880f4f08fd08") + .setOrgCode("demoveranda") + .build() + + val aesEncryptedVideo = TpInitParams.Builder() + .setVideoId("o7pOsacWaJt") + .setAccessToken("143a0c71-567e-4ecd-b22d-06177228c25b") + .setOrgCode("demoveranda") + .build() + + val clearVideo = TpInitParams.Builder() + .setVideoId("qJQlWGLJvNv") + .setAccessToken("70f61402-3724-4ed8-99de-5473b2310efe") + .setOrgCode("demoveranda") + .build() + + TpStreamDownloadManager(this).startDownloads(listOf(drmVideo,aesEncryptedVideo,clearVideo),2) + } + } \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 5a6ba98e..a75608b0 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -54,6 +54,7 @@ +