From a6331ff2e0a76cd1d73840a4dc1a56133945519f Mon Sep 17 00:00:00 2001 From: Noam Tamim Date: Mon, 6 Nov 2017 11:21:28 +0200 Subject: [PATCH 001/143] Rename package --- .idea/gradle.xml | 18 ------------- .idea/modules.xml | 9 ------- .../youbora/ExampleInstrumentedTest.java | 26 ------------------- .../youbora/YouboraAdManager.java | 2 +- .../youbora/YouboraConfig.java | 2 +- .../youbora/YouboraEvent.java | 2 +- .../youbora/YouboraLibraryManager.java | 2 +- .../youbora/YouboraPlugin.java | 2 +- .../plugin/youbora/ExampleUnitTest.java | 17 ------------ 9 files changed, 5 insertions(+), 75 deletions(-) delete mode 100644 .idea/gradle.xml delete mode 100644 .idea/modules.xml delete mode 100644 youboraplugin/src/androidTest/java/com/kaltura/playkit/plugin/youbora/ExampleInstrumentedTest.java rename youboraplugin/src/main/java/com/kaltura/playkit/{plugin => plugins}/youbora/YouboraAdManager.java (99%) rename youboraplugin/src/main/java/com/kaltura/playkit/{plugin => plugins}/youbora/YouboraConfig.java (99%) rename youboraplugin/src/main/java/com/kaltura/playkit/{plugin => plugins}/youbora/YouboraEvent.java (95%) rename youboraplugin/src/main/java/com/kaltura/playkit/{plugin => plugins}/youbora/YouboraLibraryManager.java (99%) rename youboraplugin/src/main/java/com/kaltura/playkit/{plugin => plugins}/youbora/YouboraPlugin.java (99%) delete mode 100644 youboraplugin/src/test/java/com/kaltura/playkit/plugin/youbora/ExampleUnitTest.java diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index 88e91a2..0000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 4b1ad3d..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/youboraplugin/src/androidTest/java/com/kaltura/playkit/plugin/youbora/ExampleInstrumentedTest.java b/youboraplugin/src/androidTest/java/com/kaltura/playkit/plugin/youbora/ExampleInstrumentedTest.java deleted file mode 100644 index 8bc9a47..0000000 --- a/youboraplugin/src/androidTest/java/com/kaltura/playkit/plugin/youbora/ExampleInstrumentedTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.kaltura.playkit.plugin.youbora; - -import android.content.Context; -import android.support.test.InstrumentationRegistry; -import android.support.test.runner.AndroidJUnit4; - -import org.junit.Test; -import org.junit.runner.RunWith; - -import static org.junit.Assert.*; - -/** - * Instrumented test, which will execute on an Android device. - * - * @see Testing documentation - */ -@RunWith(AndroidJUnit4.class) -public class ExampleInstrumentedTest { - @Test - public void useAppContext() throws Exception { - // Context of the app under test. - Context appContext = InstrumentationRegistry.getTargetContext(); - - assertEquals("com.kaltura.playkit.plugin.youbora.test", appContext.getPackageName()); - } -} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugin/youbora/YouboraAdManager.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraAdManager.java similarity index 99% rename from youboraplugin/src/main/java/com/kaltura/playkit/plugin/youbora/YouboraAdManager.java rename to youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraAdManager.java index ce94921..aa0b341 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugin/youbora/YouboraAdManager.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraAdManager.java @@ -10,7 +10,7 @@ * ============================================================================ */ -package com.kaltura.playkit.plugin.youbora; +package com.kaltura.playkit.plugins.youbora; import com.kaltura.playkit.MessageBus; import com.kaltura.playkit.PKError; diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugin/youbora/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraConfig.java similarity index 99% rename from youboraplugin/src/main/java/com/kaltura/playkit/plugin/youbora/YouboraConfig.java rename to youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraConfig.java index 107c834..376f59e 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugin/youbora/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraConfig.java @@ -10,7 +10,7 @@ * ============================================================================ */ -package com.kaltura.playkit.plugin.youbora; +package com.kaltura.playkit.plugins.youbora; import com.google.gson.JsonObject; diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugin/youbora/YouboraEvent.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraEvent.java similarity index 95% rename from youboraplugin/src/main/java/com/kaltura/playkit/plugin/youbora/YouboraEvent.java rename to youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraEvent.java index f63ba15..9203b81 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugin/youbora/YouboraEvent.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraEvent.java @@ -10,7 +10,7 @@ * ============================================================================ */ -package com.kaltura.playkit.plugin.youbora; +package com.kaltura.playkit.plugins.youbora; import com.kaltura.playkit.PKEvent; diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugin/youbora/YouboraLibraryManager.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java similarity index 99% rename from youboraplugin/src/main/java/com/kaltura/playkit/plugin/youbora/YouboraLibraryManager.java rename to youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java index 6c8cb9e..51357c6 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugin/youbora/YouboraLibraryManager.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java @@ -10,7 +10,7 @@ * ============================================================================ */ -package com.kaltura.playkit.plugin.youbora; +package com.kaltura.playkit.plugins.youbora; import com.kaltura.playkit.MessageBus; import com.kaltura.playkit.PKError; diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugin/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java similarity index 99% rename from youboraplugin/src/main/java/com/kaltura/playkit/plugin/youbora/YouboraPlugin.java rename to youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index 4046203..a423f86 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugin/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -10,7 +10,7 @@ * ============================================================================ */ -package com.kaltura.playkit.plugin.youbora; +package com.kaltura.playkit.plugins.youbora; import android.content.Context; diff --git a/youboraplugin/src/test/java/com/kaltura/playkit/plugin/youbora/ExampleUnitTest.java b/youboraplugin/src/test/java/com/kaltura/playkit/plugin/youbora/ExampleUnitTest.java deleted file mode 100644 index 86a32cf..0000000 --- a/youboraplugin/src/test/java/com/kaltura/playkit/plugin/youbora/ExampleUnitTest.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.kaltura.playkit.plugin.youbora; - -import org.junit.Test; - -import static org.junit.Assert.*; - -/** - * Example local unit test, which will execute on the development machine (host). - * - * @see Testing documentation - */ -public class ExampleUnitTest { - @Test - public void addition_isCorrect() throws Exception { - assertEquals(4, 2 + 2); - } -} \ No newline at end of file From 6a87c8994e85bf28174641fe2f9092c60dbea9fc Mon Sep 17 00:00:00 2001 From: Noam Tamim Date: Mon, 6 Nov 2017 12:56:36 +0200 Subject: [PATCH 002/143] Version 0.1.1 (no change) --- youboraplugin/version.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youboraplugin/version.gradle b/youboraplugin/version.gradle index ce5325c..99fc954 100644 --- a/youboraplugin/version.gradle +++ b/youboraplugin/version.gradle @@ -1,6 +1,6 @@ // Library Version -ext.libVersion = '0.1.0' +ext.libVersion = '0.1.1' From b65b106ab3c5a68ce513d8f4f9a4a1f880d733e3 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Thu, 9 Nov 2017 21:42:10 +0200 Subject: [PATCH 003/143] FEM-1715 (#1) * Send More expressive error message * back to snapshot --- .idea/misc.xml | 33 ----------------- settings.gradle | 2 ++ youboraplugin/build.gradle | 9 +++++ .../youbora/YouboraLibraryManager.java | 36 +++++++++++++++---- 4 files changed, 40 insertions(+), 40 deletions(-) delete mode 100644 .idea/misc.xml diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 3963879..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index c631987..e19e1f2 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,3 @@ include ':youboraplugin' +include ':playkit' +project(':playkit').projectDir = new File('../playkit-android/playkit') diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 2719883..0ffeaa1 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -28,9 +28,18 @@ dependencies { //TODO change to latest playkit version after tagging. compile ('com.kaltura:playkit-android:develop-SNAPSHOT') + //compile project(":playkit"); + compile files('libs/YouboraLib-5.3.10.jar') testCompile 'junit:junit:4.12' androidTestCompile 'com.android.support.test:runner:0.5' } + +repositories { + maven { + url 'https://maven.google.com/' + name 'Google' + } +} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java index 51357c6..3ce7084 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java @@ -31,6 +31,8 @@ import org.json.JSONException; +import java.util.ArrayList; +import java.util.List; import java.util.Map; import static com.kaltura.playkit.PlayerEvent.Type.STATE_CHANGED; @@ -43,6 +45,7 @@ class YouboraLibraryManager extends PluginGeneric { private static final PKLog log = PKLog.get("YouboraLibraryManager"); private static final String KALTURA_ANDROID = "Kaltura-Android"; + private static final String PLAYER_ERROR_STR = "Player error occurred"; private Player player; private MessageBus messageBus; @@ -181,25 +184,44 @@ public void onEvent(PKEvent event) { private void sendErrorHandler(PKEvent event) { PlayerEvent.Error errorEvent = (PlayerEvent.Error) event; - String errorMsg = "Player error occurred."; + String errorMetadata = (errorEvent != null && errorEvent.error != null) ? errorEvent.error.message : PLAYER_ERROR_STR; PKError error = errorEvent.error; - if (error.cause == null) { - errorHandler(errorMsg, event.eventType().toString()); + if (error.exception == null) { + errorHandler(errorMetadata, event.eventType().name()); return; } - Exception playerErrorException = (Exception) error.cause; - String errorMetadata = errorMsg; + Exception playerErrorException = (Exception) error.exception; String exceptionClass = ""; String exceptionCause = ""; + if (playerErrorException.getCause() != null && playerErrorException.getCause().getClass() != null) { exceptionClass = playerErrorException.getCause().getClass().getName(); - errorMetadata = (playerErrorException.getCause().toString() != null) ? playerErrorException.getCause().toString() : "NA"; - exceptionCause = playerErrorException.toString(); + errorMetadata = (playerErrorException.getCause().toString() != null) ? playerErrorException.getCause().toString() : errorMetadata; + } else { + exceptionClass = error.exception.getClass().getName(); + List causesList = getExceptionMessageChain(playerErrorException); + if (causesList.isEmpty()) { + exceptionCause = playerErrorException.toString(); + } else { + exceptionCause = causesList.get(0); + } } + errorHandler(exceptionCause, exceptionClass, errorMetadata); } + public static List getExceptionMessageChain(Throwable throwable) { + List result = new ArrayList(); + while (throwable != null) { + if (throwable.getMessage() != null){ + result.add(throwable.getMessage()); + } + throwable = throwable.getCause(); + } + return result; + } + private void onAdEvent(AdEvent event) { if (event.type != AdEvent.Type.PLAY_HEAD_CHANGED) { log.d("Ad Event: " + event.type.name()); From 399ab23e125e5ed6bbc20463eb77a31594a07ce1 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Thu, 9 Nov 2017 21:46:16 +0200 Subject: [PATCH 004/143] ver 0.1.2 --- youboraplugin/version.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youboraplugin/version.gradle b/youboraplugin/version.gradle index 99fc954..a98c159 100644 --- a/youboraplugin/version.gradle +++ b/youboraplugin/version.gradle @@ -1,6 +1,6 @@ // Library Version -ext.libVersion = '0.1.1' +ext.libVersion = '0.1.2' From dc005252fa4b5109cea94e4be93a3157009b92d6 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 15 Nov 2017 11:03:49 +0200 Subject: [PATCH 005/143] FEM-1736 (#3) * upgrade gradle 3.0.0 * add Gson --- build.gradle | 5 +++-- gradle/wrapper/gradle-wrapper.properties | 2 +- youboraplugin/build.gradle | 17 +++++++++-------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/build.gradle b/build.gradle index 65e1e00..ff5b060 100644 --- a/build.gradle +++ b/build.gradle @@ -4,10 +4,11 @@ buildscript { repositories { jcenter() + google() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.3' - classpath 'com.novoda:bintray-release:0.3.4' + classpath 'com.android.tools.build:gradle:3.0.0' + classpath 'com.novoda:bintray-release:0.5.0' // NOTE: Do not place your application dependencies here; they belong diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index cd26d7a..f57bd2d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 0ffeaa1..2ae9f38 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -2,13 +2,13 @@ apply plugin: 'com.android.library' apply from: 'version.gradle' android { - compileSdkVersion 25 - buildToolsVersion "25.0.2" + compileSdkVersion 26 + buildToolsVersion "26.0.2" defaultConfig { minSdkVersion 16 - targetSdkVersion 25 + targetSdkVersion 26 versionName libVersion testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" @@ -27,13 +27,14 @@ android { dependencies { //TODO change to latest playkit version after tagging. - compile ('com.kaltura:playkit-android:develop-SNAPSHOT') - //compile project(":playkit"); + implementation ('com.kaltura:playkit-android:develop-SNAPSHOT') + //implementation project(":playkit"); - compile files('libs/YouboraLib-5.3.10.jar') + implementation 'com.google.code.gson:gson:2.8.2' + implementation files('libs/YouboraLib-5.3.10.jar') - testCompile 'junit:junit:4.12' - androidTestCompile 'com.android.support.test:runner:0.5' + testImplementation 'junit:junit:4.12' + androidTestImplementation 'com.android.support.test:runner:1.0.1' } From 3e25199f9e579aedba8aee8662dbfb2a2f25bd47 Mon Sep 17 00:00:00 2001 From: CI Slave Date: Wed, 15 Nov 2017 17:08:27 +0200 Subject: [PATCH 006/143] remove gson --- youboraplugin/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 2ae9f38..fc57c46 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -30,7 +30,6 @@ dependencies { implementation ('com.kaltura:playkit-android:develop-SNAPSHOT') //implementation project(":playkit"); - implementation 'com.google.code.gson:gson:2.8.2' implementation files('libs/YouboraLib-5.3.10.jar') testImplementation 'junit:junit:4.12' From c92098f992b48948634178c62dd61b57edf05dd1 Mon Sep 17 00:00:00 2001 From: CI Slave Date: Wed, 15 Nov 2017 18:55:54 +0200 Subject: [PATCH 007/143] add gson --- youboraplugin/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index fc57c46..2ae9f38 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -30,6 +30,7 @@ dependencies { implementation ('com.kaltura:playkit-android:develop-SNAPSHOT') //implementation project(":playkit"); + implementation 'com.google.code.gson:gson:2.8.2' implementation files('libs/YouboraLib-5.3.10.jar') testImplementation 'junit:junit:4.12' From 6baaa00248e629dc0b0851f23d3e2893ffb43177 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Thu, 16 Nov 2017 12:25:41 +0200 Subject: [PATCH 008/143] remove gson --- youboraplugin/build.gradle | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 2ae9f38..ce85827 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -27,10 +27,9 @@ android { dependencies { //TODO change to latest playkit version after tagging. - implementation ('com.kaltura:playkit-android:develop-SNAPSHOT') + api 'com.kaltura:playkit-android:develop-SNAPSHOT' //implementation project(":playkit"); - implementation 'com.google.code.gson:gson:2.8.2' implementation files('libs/YouboraLib-5.3.10.jar') testImplementation 'junit:junit:4.12' From 1e84fcf9a33cfb2a3334e10baf6a8d4bfc13bc59 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Thu, 16 Nov 2017 13:30:47 +0200 Subject: [PATCH 009/143] upgrade bintray --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index ff5b060..cbbbe44 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:3.0.0' - classpath 'com.novoda:bintray-release:0.5.0' + classpath 'com.novoda:bintray-release:0.7.0' // NOTE: Do not place your application dependencies here; they belong From 30bd95ebdc62995baf2fa796bb106950748fd660 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Thu, 16 Nov 2017 17:46:13 +0200 Subject: [PATCH 010/143] compile instead of api --- youboraplugin/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index ce85827..33f532a 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -27,10 +27,10 @@ android { dependencies { //TODO change to latest playkit version after tagging. - api 'com.kaltura:playkit-android:develop-SNAPSHOT' + compile 'com.kaltura:playkit-android:develop-SNAPSHOT' //implementation project(":playkit"); - implementation files('libs/YouboraLib-5.3.10.jar') + compile files('libs/YouboraLib-5.3.10.jar') testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.1' From 8350703329ba88d6af7afd4e09d156a866a6aab4 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Sun, 19 Nov 2017 22:39:48 +0200 Subject: [PATCH 011/143] fix youbora error message builder --- .../youbora/YouboraLibraryManager.java | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java index 3ce7084..7a68544 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java @@ -31,8 +31,7 @@ import org.json.JSONException; -import java.util.ArrayList; -import java.util.List; +import java.util.LinkedHashSet; import java.util.Map; import static com.kaltura.playkit.PlayerEvent.Type.STATE_CHANGED; @@ -184,7 +183,7 @@ public void onEvent(PKEvent event) { private void sendErrorHandler(PKEvent event) { PlayerEvent.Error errorEvent = (PlayerEvent.Error) event; - String errorMetadata = (errorEvent != null && errorEvent.error != null) ? errorEvent.error.message : PLAYER_ERROR_STR; + String errorMetadata = (errorEvent != null && errorEvent.error != null) ? errorEvent.error.message : PLAYER_ERROR_STR; PKError error = errorEvent.error; if (error.exception == null) { errorHandler(errorMetadata, event.eventType().name()); @@ -200,19 +199,22 @@ private void sendErrorHandler(PKEvent event) { errorMetadata = (playerErrorException.getCause().toString() != null) ? playerErrorException.getCause().toString() : errorMetadata; } else { exceptionClass = error.exception.getClass().getName(); - List causesList = getExceptionMessageChain(playerErrorException); - if (causesList.isEmpty()) { - exceptionCause = playerErrorException.toString(); - } else { - exceptionCause = causesList.get(0); - } } - errorHandler(exceptionCause, exceptionClass, errorMetadata); + LinkedHashSet causeMessages = getExceptionMessageChain(playerErrorException); + if (causeMessages.isEmpty()) { + exceptionCause = playerErrorException.toString(); + } else { + for (String cause : causeMessages) + exceptionCause = causeMessages + "\n"; + } + + String errorCode = (errorEvent != null && errorEvent.error != null && errorEvent.error.errorType != null) ? errorEvent.error.errorType + " - " : ""; + errorHandler(exceptionCause, errorCode + exceptionClass, errorMetadata); } - public static List getExceptionMessageChain(Throwable throwable) { - List result = new ArrayList(); + public static LinkedHashSet getExceptionMessageChain(Throwable throwable) { + LinkedHashSet result = new LinkedHashSet(); while (throwable != null) { if (throwable.getMessage() != null){ result.add(throwable.getMessage()); From 7a69e05c9e0daa782de5b87bb9533f0a5bb2c2b5 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Sun, 19 Nov 2017 22:41:41 +0200 Subject: [PATCH 012/143] fix last commit --- .../playkit/plugins/youbora/YouboraLibraryManager.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java index 7a68544..eb5c746 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java @@ -198,7 +198,9 @@ private void sendErrorHandler(PKEvent event) { exceptionClass = playerErrorException.getCause().getClass().getName(); errorMetadata = (playerErrorException.getCause().toString() != null) ? playerErrorException.getCause().toString() : errorMetadata; } else { - exceptionClass = error.exception.getClass().getName(); + if (error.exception.getClass() != null) { + exceptionClass = error.exception.getClass().getName(); + } } LinkedHashSet causeMessages = getExceptionMessageChain(playerErrorException); @@ -206,11 +208,11 @@ private void sendErrorHandler(PKEvent event) { exceptionCause = playerErrorException.toString(); } else { for (String cause : causeMessages) - exceptionCause = causeMessages + "\n"; + exceptionCause += cause + "\n"; } String errorCode = (errorEvent != null && errorEvent.error != null && errorEvent.error.errorType != null) ? errorEvent.error.errorType + " - " : ""; - errorHandler(exceptionCause, errorCode + exceptionClass, errorMetadata); + errorHandler(exceptionCause, errorCode + exceptionClass, errorMetadata); } public static LinkedHashSet getExceptionMessageChain(Throwable throwable) { From d2338a71a63fa30320e05344501f8a2430872d83 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Thu, 7 Dec 2017 18:24:57 +0200 Subject: [PATCH 013/143] update gradle --- build.gradle | 4 ++-- youboraplugin/build.gradle | 11 ++++------- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/build.gradle b/build.gradle index cbbbe44..07c94bc 100644 --- a/build.gradle +++ b/build.gradle @@ -7,8 +7,8 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.0.0' - classpath 'com.novoda:bintray-release:0.7.0' + classpath 'com.android.tools.build:gradle:3.0.1' + classpath 'com.novoda:bintray-release:0.8.0' // NOTE: Do not place your application dependencies here; they belong diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 33f532a..eda9db9 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -27,19 +27,16 @@ android { dependencies { //TODO change to latest playkit version after tagging. - compile 'com.kaltura:playkit-android:develop-SNAPSHOT' + implementation 'com.kaltura:playkit-android:develop-SNAPSHOT' //implementation project(":playkit"); compile files('libs/YouboraLib-5.3.10.jar') - testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.1' + testCompile 'junit:junit:4.12' + androidTestCompile 'com.android.support.test:runner:1.0.1' } repositories { - maven { - url 'https://maven.google.com/' - name 'Google' - } + google() } From 4257d4ed3c20ff1ee5f76a756e2f1840feb41eea Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Sun, 10 Dec 2017 11:25:12 +0200 Subject: [PATCH 014/143] add jitpack --- youboraplugin/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index eda9db9..191b31c 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -38,5 +38,6 @@ dependencies { } repositories { + maven { url "https://jitpack.io" } google() } From 0c4f0b4bb1f47a12d7495ef6f330e3ac7415d4e2 Mon Sep 17 00:00:00 2001 From: "anton.afanasiev" Date: Sun, 10 Dec 2017 11:49:33 +0200 Subject: [PATCH 015/143] change build.gradle from using compile to implementation --- youboraplugin/build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 191b31c..231cdb7 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -30,10 +30,10 @@ dependencies { implementation 'com.kaltura:playkit-android:develop-SNAPSHOT' //implementation project(":playkit"); - compile files('libs/YouboraLib-5.3.10.jar') + implementation files('libs/YouboraLib-5.3.10.jar') - testCompile 'junit:junit:4.12' - androidTestCompile 'com.android.support.test:runner:1.0.1' + testImplementation 'junit:junit:4.12' + androidTestImplementation 'com.android.support.test:runner:1.0.1' } From 0343a3fecc527235e6aa5ad40bfd54147196f9b0 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Sun, 24 Dec 2017 16:17:30 +0200 Subject: [PATCH 016/143] remove build tools --- youboraplugin/build.gradle | 2 -- youboraplugin/version.gradle | 5 ----- 2 files changed, 7 deletions(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 231cdb7..9de8e91 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -3,8 +3,6 @@ apply from: 'version.gradle' android { compileSdkVersion 26 - buildToolsVersion "26.0.2" - defaultConfig { minSdkVersion 16 diff --git a/youboraplugin/version.gradle b/youboraplugin/version.gradle index a98c159..5355944 100644 --- a/youboraplugin/version.gradle +++ b/youboraplugin/version.gradle @@ -2,11 +2,6 @@ // Library Version ext.libVersion = '0.1.2' - - - - - // Append short commit hash to dev builds, i.e. "dev.a1b2c3d" if (libVersion == 'dev') { def cmd = "git rev-parse --short HEAD" From 6ba8377db703cab670f630a8532f38df16c50825 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Tue, 23 Jan 2018 17:34:13 +0200 Subject: [PATCH 017/143] add public String getVersion() { return BuildConfig.VERSION_NAME; } --- .../com/kaltura/playkit/plugins/youbora/YouboraPlugin.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index a423f86..b380bd5 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -22,6 +22,7 @@ import com.kaltura.playkit.PKPlugin; import com.kaltura.playkit.Player; import com.kaltura.playkit.PlayerEvent; +import com.kaltura.playkit.plugin.youbora.BuildConfig; import com.kaltura.playkit.utils.Consts; import com.npaw.youbora.youboralib.data.Options; @@ -51,6 +52,11 @@ public String getName() { return "Youbora"; } + @Override + public String getVersion() { + return BuildConfig.VERSION_NAME; + } + @Override public PKPlugin newInstance() { return new YouboraPlugin(); From 04ecce81bfc34d193ebaa3c4a7d2cb44eb8e7c9a Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Mon, 2 Jul 2018 11:06:27 +0300 Subject: [PATCH 018/143] update google repo --- build.gradle | 1 + youboraplugin/build.gradle | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 07c94bc..2ac98be 100644 --- a/build.gradle +++ b/build.gradle @@ -20,6 +20,7 @@ allprojects { repositories { jcenter() maven { url "https://jitpack.io" } + google() } } diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 9de8e91..079a180 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -25,7 +25,7 @@ android { dependencies { //TODO change to latest playkit version after tagging. - implementation 'com.kaltura:playkit-android:develop-SNAPSHOT' + implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' //implementation project(":playkit"); implementation files('libs/YouboraLib-5.3.10.jar') From 53295f433533504207043d0d203f0cf22c6a1ac7 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Mon, 2 Jul 2018 11:37:37 +0300 Subject: [PATCH 019/143] sync with dev before spepration --- .../plugins/youbora/YouboraAdManager.java | 16 +++++++------- .../youbora/YouboraLibraryManager.java | 21 +++++++++++-------- .../plugins/youbora/YouboraPlugin.java | 14 +++++++------ 3 files changed, 29 insertions(+), 22 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraAdManager.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraAdManager.java index aa0b341..3db44f3 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraAdManager.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraAdManager.java @@ -12,21 +12,23 @@ package com.kaltura.playkit.plugins.youbora; + import com.kaltura.playkit.MessageBus; -import com.kaltura.playkit.PKError; import com.kaltura.playkit.PKEvent; import com.kaltura.playkit.PKLog; import com.kaltura.playkit.PlayKitManager; import com.kaltura.playkit.PlayerEvent; -import com.kaltura.playkit.ads.AdEvent; -import com.kaltura.playkit.ads.AdInfo; -import com.kaltura.playkit.ads.PKAdErrorType; +import com.kaltura.playkit.plugins.ads.AdEvent; +import com.kaltura.playkit.plugins.ads.AdInfo; import com.kaltura.playkit.utils.Consts; +import com.kaltura.playkit.ads.PKAdErrorType; +import com.kaltura.playkit.PKError; import com.npaw.youbora.adnalyzers.AdnalyzerGeneric; import com.npaw.youbora.plugins.PluginGeneric; import com.npaw.youbora.youboralib.BuildConfig; import com.npaw.youbora.youboralib.utils.YBLog; +import static com.kaltura.playkit.PlayerEvent.Type.PLAYHEAD_UPDATED; import static com.kaltura.playkit.PlayerEvent.Type.STATE_CHANGED; /** @@ -80,10 +82,11 @@ private void onEvent(PlayerEvent.StateChanged event) { @Override public void onEvent(PKEvent event) { - log.d("on event " + event.eventType()); + if (event.eventType() != AdEvent.Type.PLAY_HEAD_CHANGED && event.eventType() != PLAYHEAD_UPDATED) { + log.d("YouboraAdManager on event " + event.eventType()); + } if (event instanceof AdEvent) { - log.d("AdManager: " + ((AdEvent) event).type.toString()); switch (((AdEvent) event).type) { case AD_REQUESTED: lastReportedAdResource = ((AdEvent.AdRequestedEvent) event).adTagUrl; @@ -165,7 +168,6 @@ public void onEvent(PKEvent event) { default: break; } - messageBus.post(new YouboraEvent.YouboraReport(event.eventType().name())); } } diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java index eb5c746..2c4c12f 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java @@ -22,8 +22,8 @@ import com.kaltura.playkit.PlaybackInfo; import com.kaltura.playkit.Player; import com.kaltura.playkit.PlayerEvent; -import com.kaltura.playkit.ads.AdCuePoints; -import com.kaltura.playkit.ads.AdEvent; +import com.kaltura.playkit.plugins.ads.AdCuePoints; +import com.kaltura.playkit.plugins.ads.AdEvent; import com.kaltura.playkit.utils.Consts; import com.npaw.youbora.plugins.PluginGeneric; import com.npaw.youbora.youboralib.BuildConfig; @@ -34,6 +34,7 @@ import java.util.LinkedHashSet; import java.util.Map; +import static com.kaltura.playkit.PlayerEvent.Type.PLAYHEAD_UPDATED; import static com.kaltura.playkit.PlayerEvent.Type.STATE_CHANGED; /** @@ -46,6 +47,7 @@ class YouboraLibraryManager extends PluginGeneric { private static final String KALTURA_ANDROID = "Kaltura-Android"; private static final String PLAYER_ERROR_STR = "Player error occurred"; + private Player player; private MessageBus messageBus; private PKMediaConfig mediaConfig; @@ -121,7 +123,9 @@ public void onEvent(PKEvent event) { } if (event instanceof PlayerEvent && viewManager != null) { - log.d("PlayerEvent: " + ((PlayerEvent) event).type.toString()); + if (event.eventType() != PLAYHEAD_UPDATED) { + log.d("New PKEvent = " + event.eventType().name()); + } switch (((PlayerEvent) event).type) { case DURATION_CHANGE: log.d("new duration = " + ((PlayerEvent.DurationChanged) event).duration); @@ -278,12 +282,10 @@ public Double getBitrate() { } public Double getThroughput() { - log.d("getThroughput = " + lastReportedThroughput); return this.lastReportedThroughput; } public String getRendition() { - log.d("getRendition = " + lastReportedRendition); return lastReportedRendition; } @@ -293,7 +295,6 @@ public String getPlayerVersion() { public Double getPlayhead() { double currPos = Long.valueOf(player.getCurrentPosition() / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); - log.d("getPlayhead currPos = " + currPos); return (currPos >= 0) ? currPos : 0; } @@ -320,11 +321,13 @@ public Boolean getIsLive() { } private void sendReportEvent(PKEvent event) { - String reportedEventName = event.eventType().name(); - messageBus.post(new YouboraEvent.YouboraReport(reportedEventName)); + if (event.eventType() != PLAYHEAD_UPDATED) { + String reportedEventName = event.eventType().name(); + messageBus.post(new YouboraEvent.YouboraReport(reportedEventName)); + } } - private String generateRendition(double bitrate, int width, int height) { + public String generateRendition(double bitrate, int width, int height) { if ((width <= 0 || height <= 0) && bitrate <= 0) { return super.getRendition(); diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index b380bd5..a1384ec 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -22,7 +22,6 @@ import com.kaltura.playkit.PKPlugin; import com.kaltura.playkit.Player; import com.kaltura.playkit.PlayerEvent; -import com.kaltura.playkit.plugin.youbora.BuildConfig; import com.kaltura.playkit.utils.Consts; import com.npaw.youbora.youboralib.data.Options; @@ -52,10 +51,10 @@ public String getName() { return "Youbora"; } - @Override - public String getVersion() { - return BuildConfig.VERSION_NAME; - } +// @Override +// public String getVersion() { +// return BuildConfig.VERSION_NAME; +// } @Override public PKPlugin newInstance() { @@ -178,7 +177,10 @@ public void onEvent(PKEvent event) { return ; } - Map opt = YouboraConfig.updateMediaConfig(pluginConfig, key, value); + Map opt = YouboraConfig.updateMediaConfig(pluginConfig, key, value); + if (opt == null) { + return; + } pluginManager.setOptions(opt); } }; From 6f23ce53fea1442510ee89ae8e27b9b2cd57e103 Mon Sep 17 00:00:00 2001 From: "anton.afanasiev" Date: Tue, 3 Jul 2018 12:01:23 +0300 Subject: [PATCH 020/143] add getVersion api --- .../kaltura/playkit/plugins/youbora/YouboraPlugin.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index a1384ec..8b7956f 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -22,6 +22,7 @@ import com.kaltura.playkit.PKPlugin; import com.kaltura.playkit.Player; import com.kaltura.playkit.PlayerEvent; +import com.kaltura.playkit.plugin.youbora.BuildConfig; import com.kaltura.playkit.utils.Consts; import com.npaw.youbora.youboralib.data.Options; @@ -51,10 +52,10 @@ public String getName() { return "Youbora"; } -// @Override -// public String getVersion() { -// return BuildConfig.VERSION_NAME; -// } + @Override + public String getVersion() { + return BuildConfig.VERSION_NAME; + } @Override public PKPlugin newInstance() { From a4aa82fcdfe51320d87d697588fd99a282bd1207 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Tue, 3 Jul 2018 14:50:50 +0300 Subject: [PATCH 021/143] dev version --- youboraplugin/version.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youboraplugin/version.gradle b/youboraplugin/version.gradle index 5355944..bcdfcbe 100644 --- a/youboraplugin/version.gradle +++ b/youboraplugin/version.gradle @@ -1,6 +1,6 @@ // Library Version -ext.libVersion = '0.1.2' +ext.libVersion = 'dev' // Append short commit hash to dev builds, i.e. "dev.a1b2c3d" if (libVersion == 'dev') { From 9dfb780ed32bbfefd5aa13655af6019f6525cbd0 Mon Sep 17 00:00:00 2001 From: AntonAFA Date: Tue, 17 Jul 2018 15:21:26 +0300 Subject: [PATCH 022/143] Upgrade to android 27 (#5) --- youboraplugin/build.gradle | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 079a180..e6eea8f 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -2,11 +2,11 @@ apply plugin: 'com.android.library' apply from: 'version.gradle' android { - compileSdkVersion 26 + compileSdkVersion 27 defaultConfig { minSdkVersion 16 - targetSdkVersion 26 + targetSdkVersion 27 versionName libVersion testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" @@ -26,16 +26,16 @@ dependencies { //TODO change to latest playkit version after tagging. implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' - //implementation project(":playkit"); +// implementation project(":playkit"); implementation files('libs/YouboraLib-5.3.10.jar') testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.1' + androidTestImplementation 'com.android.support.test:runner:1.0.2' } repositories { - maven { url "https://jitpack.io" } google() + maven { url "https://jitpack.io" } } From c5e5d64634d00128b48b5e9d4799b62fc2ed7ecb Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 18 Jul 2018 15:58:38 +0300 Subject: [PATCH 023/143] exclude javadocs (#6) --- youboraplugin/build.gradle | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index e6eea8f..01e60ca 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -22,11 +22,15 @@ android { } +tasks.withType(Javadoc) { + options.addBooleanOption('Xdoclint:none', true) +} + dependencies { //TODO change to latest playkit version after tagging. implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' -// implementation project(":playkit"); + //implementation project(":playkit"); implementation files('libs/YouboraLib-5.3.10.jar') From 783eb7aa6e8bd72bf9c131388856f09e2a647794 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Thu, 19 Jul 2018 19:28:03 +0300 Subject: [PATCH 024/143] Fix travis (#8) * exclude javadocs * update travis --- .travis.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 129e9f4..93773ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,19 +5,9 @@ jdk: - oraclejdk8 android: components: - - tools - - platform-tools - - extra-android-m2repository - - extra-google-m2repository -cache: - directories: - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ -before_cache: - - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock + - tools before_script: - - mkdir -p $ANDROID_HOME/licenses - - echo $android_sdk_license > $ANDROID_HOME/licenses/android-sdk-license + - curl https://kaltura.github.io/fe-tools/android/license.sh | sh script: - ./gradlew youboraplugin:build after_failure: From 576616d902d9a9f2d99cc22bd14f7c9852cdad15 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Thu, 13 Sep 2018 14:33:13 +0300 Subject: [PATCH 025/143] add jcenter reference (#9) --- youboraplugin/build.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 01e60ca..64bf611 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -41,5 +41,6 @@ dependencies { repositories { google() + jcenter() maven { url "https://jitpack.io" } } From a45adb194ae8f1c2077325ef86a98e80e16dc856 Mon Sep 17 00:00:00 2001 From: Noam Tamim Date: Mon, 1 Oct 2018 16:52:19 +0300 Subject: [PATCH 026/143] Bintray fixes --- travis-push-to-bintray.sh | 2 +- youboraplugin/version.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/travis-push-to-bintray.sh b/travis-push-to-bintray.sh index 523b3c0..14f96b0 100755 --- a/travis-push-to-bintray.sh +++ b/travis-push-to-bintray.sh @@ -37,7 +37,7 @@ fi # Assuming a successful build, create javadoc jar, sources jar, pom -./gradlew $LIB:publishMavenPublicationToMavenLocal -x mavenAndroidJavadocs +./gradlew $LIB:publishReleasePublicationToMavenLocal # Upload ./gradlew $LIB:bintrayUpload -PdryRun=$DRY_RUN -PbintrayUser=$BINTRAY_USER -PbintrayKey=$BINTRAY_KEY diff --git a/youboraplugin/version.gradle b/youboraplugin/version.gradle index bcdfcbe..0b5d6e1 100644 --- a/youboraplugin/version.gradle +++ b/youboraplugin/version.gradle @@ -4,7 +4,7 @@ ext.libVersion = 'dev' // Append short commit hash to dev builds, i.e. "dev.a1b2c3d" if (libVersion == 'dev') { - def cmd = "git rev-parse --short HEAD" + def cmd = "git -C " + projectDir + " rev-parse --short HEAD" def proc = cmd.execute() def commit = proc.text.trim() ext.libVersion = 'dev.' + commit From a6ec9f8dfe04b447b6dfaa165d8dff5bbc35b8f1 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 10 Oct 2018 00:24:24 +0300 Subject: [PATCH 027/143] api instead of implementation --- youboraplugin/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 64bf611..9035f6d 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -32,7 +32,7 @@ dependencies { implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' //implementation project(":playkit"); - implementation files('libs/YouboraLib-5.3.10.jar') + api files('libs/YouboraLib-5.3.10.jar') testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' From eafb0ec1d45458ed11885bd3b7eaf39a5acdfc50 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Mon, 15 Oct 2018 12:07:06 +0300 Subject: [PATCH 028/143] FEM-2234 upgrade to api 28 (#10) * upgrade to api 28 * upgrade gradle 3.1.4 --- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- youboraplugin/build.gradle | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 2ac98be..0ffa61b 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:3.0.1' + classpath 'com.android.tools.build:gradle:3.1.4' classpath 'com.novoda:bintray-release:0.8.0' diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f57bd2d..7779618 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 9035f6d..7a724b0 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -2,11 +2,11 @@ apply plugin: 'com.android.library' apply from: 'version.gradle' android { - compileSdkVersion 27 + compileSdkVersion 28 defaultConfig { minSdkVersion 16 - targetSdkVersion 27 + targetSdkVersion 28 versionName libVersion testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" @@ -36,7 +36,6 @@ dependencies { testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' - } repositories { From 40ee055276d4bf15c96c1dbc31004ff241ddf9b4 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Mon, 15 Oct 2018 20:07:35 +0300 Subject: [PATCH 029/143] Fem 2234 cont upgrade to api 28 (#11) * upgrade to api 28 * upgrade gradle 3.1.4 --- .idea/dictionaries/anton_afanasiev.xml | 7 ------- build.gradle | 2 +- settings.gradle | 5 +++-- 3 files changed, 4 insertions(+), 10 deletions(-) delete mode 100644 .idea/dictionaries/anton_afanasiev.xml diff --git a/.idea/dictionaries/anton_afanasiev.xml b/.idea/dictionaries/anton_afanasiev.xml deleted file mode 100644 index da9214d..0000000 --- a/.idea/dictionaries/anton_afanasiev.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - youbora - - - \ No newline at end of file diff --git a/build.gradle b/build.gradle index 0ffa61b..6be59a0 100644 --- a/build.gradle +++ b/build.gradle @@ -18,9 +18,9 @@ buildscript { allprojects { repositories { + google() jcenter() maven { url "https://jitpack.io" } - google() } } diff --git a/settings.gradle b/settings.gradle index e19e1f2..077e84d 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,4 @@ include ':youboraplugin' -include ':playkit' -project(':playkit').projectDir = new File('../playkit-android/playkit') + +//include ':playkit' +//project(':playkit').projectDir = new File('../playkit-android/playkit') From e19789d5b0677d4c055260a1c730a29484cbc86d Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Fri, 19 Oct 2018 15:33:03 +0300 Subject: [PATCH 030/143] gradle wrapper 4.4 --- gradle/wrapper/gradle-wrapper.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 7779618..0767316 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip From 3e34e7d6cfe71c2003df1d8a6bfd42b17d471e47 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Sun, 28 Oct 2018 16:05:15 +0200 Subject: [PATCH 031/143] access json key only if not null (#12) --- .../kaltura/playkit/plugins/youbora/YouboraConfig.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraConfig.java index 376f59e..15c1348 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraConfig.java @@ -105,7 +105,7 @@ public static Map getConfig(JsonObject pluginConfig, PKMediaConf public static Map updateMediaConfig(JsonObject pluginConfig, String key, Object value) { mediaObject.put(key, value); - if (pluginConfig.has("media")) { + if (Utils.isJsonObjectValueValid(pluginConfig, "media")) { setYouboraConfigObject(mediaObject, pluginConfig.getAsJsonObject("media"), mediaConfigFieldNames, mediaBooleanConfigFieldNames); } return youboraConfig; @@ -128,16 +128,16 @@ private static void setConfig(JsonObject pluginConfig, PKMediaConfig mediaConfig //set these values on the root object setYouboraConfigObject(youboraConfigObject, pluginConfig, youboraConfigFieldNames, youboraBooleanConfigFieldNames); - if (pluginConfig.has("media")) { + if (Utils.isJsonObjectValueValid(pluginConfig, "media")) { setYouboraConfigObject(mediaObject, pluginConfig.getAsJsonObject("media"), mediaConfigFieldNames, mediaBooleanConfigFieldNames); } - if (pluginConfig.has("ads")) { + if (Utils.isJsonObjectValueValid(pluginConfig, "ads")) { setYouboraConfigObject(adsObject, pluginConfig.getAsJsonObject("ads"), adsConfigFieldNames, adsBooleanConfigFieldNames); } - if (pluginConfig.has("properties")) { + if (Utils.isJsonObjectValueValid(pluginConfig, "properties")) { setYouboraConfigObject(propertiesObject, pluginConfig.getAsJsonObject("properties"), propertiesConfigFieldNames, null); } - if (pluginConfig.has("extraParams")) { + if (Utils.isJsonObjectValueValid(pluginConfig, "extraParams")) { setYouboraConfigObject(extraParamsObject, pluginConfig.getAsJsonObject("extraParams"), extraConfigFieldNames, null); } } From 6b0285330d03c461b673ae244fdfcb3602b0d5fa Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 7 Nov 2018 20:22:06 +0200 Subject: [PATCH 032/143] fix warning --- .../kaltura/playkit/plugins/youbora/YouboraLibraryManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java index 2c4c12f..ef05e78 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java @@ -220,7 +220,7 @@ private void sendErrorHandler(PKEvent event) { } public static LinkedHashSet getExceptionMessageChain(Throwable throwable) { - LinkedHashSet result = new LinkedHashSet(); + LinkedHashSet result = new LinkedHashSet<>(); while (throwable != null) { if (throwable.getMessage() != null){ result.add(throwable.getMessage()); From dda8e665461e9fc51fbe768fda37a46ffb18bf09 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Sun, 11 Nov 2018 09:41:13 +0200 Subject: [PATCH 033/143] use https since required in android p (28) (#13) + ignore ad progress in logs --- .../java/com/kaltura/playkit/plugins/youbora/YouboraConfig.java | 2 +- .../kaltura/playkit/plugins/youbora/YouboraLibraryManager.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraConfig.java index 15c1348..3460133 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraConfig.java @@ -58,7 +58,7 @@ public class YouboraConfig { youboraLocalConfig.put("enableAnalytics", true); youboraLocalConfig.put("parseHLS", false); youboraLocalConfig.put("parseCDNNodeHost", false); - youboraLocalConfig.put("httpSecure", false); + youboraLocalConfig.put("httpSecure", true); youboraLocalConfig.put("accountCode", "kalturatest"); youboraLocalConfig.put("transactionCode", ""); youboraLocalConfig.put("haltOnError", true); diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java index ef05e78..1fd8b63 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java @@ -231,7 +231,7 @@ public static LinkedHashSet getExceptionMessageChain(Throwable throwable } private void onAdEvent(AdEvent event) { - if (event.type != AdEvent.Type.PLAY_HEAD_CHANGED) { + if (event.type != AdEvent.Type.PLAY_HEAD_CHANGED && event.type != AdEvent.Type.AD_PROGRESS) { log.d("Ad Event: " + event.type.name()); } From 630da6c971af7ddbc1fb50145bb2caf13bbc30d6 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Sun, 11 Nov 2018 11:00:13 +0200 Subject: [PATCH 034/143] Exclude AD_PROGRESS from log --- .../com/kaltura/playkit/plugins/youbora/YouboraAdManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraAdManager.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraAdManager.java index 3db44f3..d910008 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraAdManager.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraAdManager.java @@ -30,6 +30,7 @@ import static com.kaltura.playkit.PlayerEvent.Type.PLAYHEAD_UPDATED; import static com.kaltura.playkit.PlayerEvent.Type.STATE_CHANGED; +import static com.kaltura.playkit.plugins.ads.AdEvent.Type.AD_PROGRESS; /** * @hide @@ -82,7 +83,7 @@ private void onEvent(PlayerEvent.StateChanged event) { @Override public void onEvent(PKEvent event) { - if (event.eventType() != AdEvent.Type.PLAY_HEAD_CHANGED && event.eventType() != PLAYHEAD_UPDATED) { + if (event.eventType() != AdEvent.Type.PLAY_HEAD_CHANGED && event.eventType() != AD_PROGRESS && event.eventType() != PLAYHEAD_UPDATED) { log.d("YouboraAdManager on event " + event.eventType()); } From 4171307e7c15f700c14ea8ad9983faf577ee0f99 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Sun, 11 Nov 2018 12:08:30 +0200 Subject: [PATCH 035/143] fix warning using StringBuilder instead of concatination --- .../plugins/youbora/YouboraLibraryManager.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java index 1fd8b63..5e9971a 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java @@ -196,7 +196,6 @@ private void sendErrorHandler(PKEvent event) { Exception playerErrorException = (Exception) error.exception; String exceptionClass = ""; - String exceptionCause = ""; if (playerErrorException.getCause() != null && playerErrorException.getCause().getClass() != null) { exceptionClass = playerErrorException.getCause().getClass().getName(); @@ -208,15 +207,17 @@ private void sendErrorHandler(PKEvent event) { } LinkedHashSet causeMessages = getExceptionMessageChain(playerErrorException); + StringBuilder exceptionCauseBuilder = new StringBuilder(); if (causeMessages.isEmpty()) { - exceptionCause = playerErrorException.toString(); + exceptionCauseBuilder.append(playerErrorException.toString()); } else { - for (String cause : causeMessages) - exceptionCause += cause + "\n"; + for (String cause : causeMessages) { + exceptionCauseBuilder.append(cause).append("\n"); + } } String errorCode = (errorEvent != null && errorEvent.error != null && errorEvent.error.errorType != null) ? errorEvent.error.errorType + " - " : ""; - errorHandler(exceptionCause, errorCode + exceptionClass, errorMetadata); + errorHandler(exceptionCauseBuilder.toString(), errorCode + exceptionClass, errorMetadata); } public static LinkedHashSet getExceptionMessageChain(Throwable throwable) { From 85e871962d40e678e1f1a7d65d14b6a9df1a787e Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Tue, 20 Nov 2018 10:50:12 +0200 Subject: [PATCH 036/143] java8 (#14) --- youboraplugin/build.gradle | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 7a724b0..b7dd44b 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -3,7 +3,10 @@ apply from: 'version.gradle' android { compileSdkVersion 28 - + compileOptions { + sourceCompatibility JavaVersion.VERSION_1_8 + targetCompatibility JavaVersion.VERSION_1_8 + } defaultConfig { minSdkVersion 16 targetSdkVersion 28 From 006df9c17df5a0d8cf74a6cbcd730ff5f4e7a293 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 26 Dec 2018 16:21:53 +0200 Subject: [PATCH 037/143] ignore non fatal player error (#15) --- .../playkit/plugins/youbora/YouboraLibraryManager.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java index 5e9971a..3a796bb 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java @@ -141,6 +141,11 @@ public void onEvent(PKEvent event) { } break; case ERROR: + PKError error = ((PlayerEvent.Error) event).error; + if (error != null && !error.isFatal()) { + log.v("Error eventType = " + error.errorType + " severity = " + error.severity + " errorMessage = " + error.message); + return; + } sendErrorHandler(event); adCuePoints = null; break; From 8e488064497e0444982a77d8178a0d596649c9c7 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Sun, 20 Jan 2019 16:23:21 +0200 Subject: [PATCH 038/143] fix build (#18) --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 93773ef..fb00ad2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,8 @@ jdk: android: components: - tools + - build-tools-27.0.3 + - android-28 before_script: - curl https://kaltura.github.io/fe-tools/android/license.sh | sh script: From 3d7c9d6f19b7a58c56901431a3c0751a973a54de Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Mon, 21 Jan 2019 17:40:55 +0200 Subject: [PATCH 039/143] Youbora v6 (#4) * Kaltura Player changes * update the title duration and isLive from the media itself * Youbora V6 Support * add click event * comment media duration log * by default to be https - need for android 28+ * fix adBitrate * fix adUrl upon clicked event * add null check for clickThruUrl * ignore non fatal player error * ignore AD_PROGRESS. logs * fixed for youbora url was not reported add setSource on the playerManager * reset source in reset values * floor values of duration and position * if ad goes to bg not sending ad data anymore after resume ->Youbora Enrique * protect negative * make sure duration is correct * add public static final Class youboraReport = YouboraReport.class; * change to new listeners api * clean imports * rename reportSent * add null protection * pause was missed * jitpack.yml - fix lic signature * upgrade youbora 6.3.5 --- build.gradle | 1 + jitpack.yml | 4 + youboraplugin/build.gradle | 8 +- .../playkit/plugins/youbora/NPAWPlugin.java | 20 + .../plugins/youbora/PKYouboraAdsAdapter.java | 384 +++++++++++++++ .../youbora/PKYouboraPlayerAdapter.java | 432 +++++++++++++++++ .../plugins/youbora/YouboraAdManager.java | 297 ------------ .../plugins/youbora/YouboraConfig.java | 162 ------- .../playkit/plugins/youbora/YouboraEvent.java | 2 + .../youbora/YouboraLibraryManager.java | 357 -------------- .../plugins/youbora/YouboraPlugin.java | 209 ++++---- .../plugins/youbora/pluginconfig/Ads.java | 23 + .../youbora/pluginconfig/ExtraParams.java | 96 ++++ .../plugins/youbora/pluginconfig/Media.java | 76 +++ .../youbora/pluginconfig/Properties.java | 132 +++++ .../youbora/pluginconfig/YouboraConfig.java | 449 ++++++++++++++++++ 16 files changed, 1728 insertions(+), 924 deletions(-) create mode 100644 jitpack.yml create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/NPAWPlugin.java create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java delete mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraAdManager.java delete mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraConfig.java delete mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Ads.java create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/ExtraParams.java create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Media.java create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Properties.java create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java diff --git a/build.gradle b/build.gradle index 6be59a0..ecb28a4 100644 --- a/build.gradle +++ b/build.gradle @@ -5,6 +5,7 @@ buildscript { repositories { jcenter() google() + maven { url "https://jitpack.io" } } dependencies { classpath 'com.android.tools.build:gradle:3.1.4' diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 0000000..24e44f0 --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,4 @@ +jdk: + - oraclejdk8 +before_install: + - curl https://kaltura.github.io/fe-tools/android/license.sh | sh diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index b7dd44b..aed9bc5 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -25,24 +25,22 @@ android { } -tasks.withType(Javadoc) { - options.addBooleanOption('Xdoclint:none', true) -} - dependencies { //TODO change to latest playkit version after tagging. implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' //implementation project(":playkit"); - api files('libs/YouboraLib-5.3.10.jar') + api 'com.npaw.youbora:youboralib:6.3.5' testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' + } repositories { google() jcenter() maven { url "https://jitpack.io" } + } diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/NPAWPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/NPAWPlugin.java new file mode 100644 index 0000000..a8730ba --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/NPAWPlugin.java @@ -0,0 +1,20 @@ +package com.kaltura.playkit.plugins.youbora; + +import com.npaw.youbora.lib6.adapter.PlayerAdapter; +import com.npaw.youbora.lib6.plugin.Options; +import com.npaw.youbora.lib6.plugin.Plugin; + +/** + * Created by gilad.nadav on 06/05/2018. + */ + +public class NPAWPlugin extends Plugin { + + public NPAWPlugin(Options options) { + super(options); + } + + public NPAWPlugin(Options options, PlayerAdapter adapter) { + super(options, adapter); + } +} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java new file mode 100644 index 0000000..e6c7b0b --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java @@ -0,0 +1,384 @@ +/* + * ============================================================================ + * Copyright (C) 2017 Kaltura Inc. + * + * Licensed under the AGPLv3 license, unless a different license for a + * particular library is specified in the applicable library path. + * + * You may obtain a copy of the License at + * https://www.gnu.org/licenses/agpl-3.0.html + * ============================================================================ + */ + +package com.kaltura.playkit.plugins.youbora; + +import com.kaltura.playkit.BuildConfig; +import com.kaltura.playkit.MessageBus; +import com.kaltura.playkit.PKError; +import com.kaltura.playkit.PKEvent; +import com.kaltura.playkit.PKLog; +import com.kaltura.playkit.PlayKitManager; +import com.kaltura.playkit.Player; +import com.kaltura.playkit.ads.PKAdErrorType; +import com.kaltura.playkit.plugins.ads.AdEvent; +import com.kaltura.playkit.plugins.ads.AdInfo; +import com.kaltura.playkit.utils.Consts; +import com.npaw.youbora.lib6.adapter.PlayerAdapter; + +/** + * @hide + */ + +class PKYouboraAdsAdapter extends PlayerAdapter { + private static final PKLog log = PKLog.get("PKYouboraAdsAdapter"); + + private boolean isFirstPlay = true; + private boolean isBuffering = false; + private MessageBus messageBus; + + private AdInfo currentAdInfo; + private String lastReportedAdResource; + private String lastReportedAdTitle; + private Double lastReportedAdPlayhead; + private Double lastReportedAdDuration; + private long lastReportedAdBitrate; + + PKYouboraAdsAdapter(Player player, MessageBus messageBus) { + super(player); + this.messageBus = messageBus; + registerListeners(); + } + + @Override + public void registerListeners() { + super.registerListeners(); + addListeners(); + } + + private void printLastReportedAdPlayhead() { + log.d("lastReportedAdPlayhead = " + lastReportedAdPlayhead); + } + + private void printEventName(PKEvent event) { + log.d("PKYouboraAdsAdapter on event " + event.eventType()); + } + + private boolean isNullAdapter() { + if (getPlugin() == null || getPlugin().getAdapter() == null) { + log.e("Player Adapter is null"); + return true; + } + return false; + } + + private void sendReportEvent(Enum anEnum) { + messageBus.post(new YouboraEvent.YouboraReport(anEnum.name())); + } + + @Override + public void unregisterListeners() { + messageBus.removeListeners(this); + super.unregisterListeners(); + } + + @Override + public Long getBitrate() { + return Long.valueOf(lastReportedAdBitrate); + } + + @Override + public String getTitle() { + //log.d("getAdTitle "); + return lastReportedAdTitle != null ? lastReportedAdTitle : "No Info"; + } + + @Override + public Double getDuration() { + double adDuration = currentAdInfo != null ? currentAdInfo.getAdDuration() / Consts.MILLISECONDS_MULTIPLIER : 0D; + return adDuration; + } + + @Override + public String getPlayerVersion() { + //log.d("getAdPlayerVersion " + PlayKitManager.CLIENT_TAG); + return Consts.KALTURA + "-" + PlayKitManager.CLIENT_TAG; + } + + @Override + public String getVersion() { + return BuildConfig.VERSION_NAME + "-" + getPlayerVersion(); + } + + @Override + public Double getPlayhead() { + log.d("getAdPlayhead = " + lastReportedAdPlayhead); + return lastReportedAdPlayhead; + } + + @Override + public AdPosition getPosition() { + AdPosition adPosition = AdPosition.UNKNOWN; + + if (currentAdInfo == null) { + return adPosition; + } + + switch (currentAdInfo.getAdPositionType()) { + case PRE_ROLL: + adPosition = AdPosition.PRE; + break; + case MID_ROLL: + adPosition = AdPosition.MID; + break; + case POST_ROLL: + adPosition = AdPosition.POST; + break; + default: + break; + } + log.d("adPosition = " + adPosition); + return adPosition; + } + + @Override + public String getResource() { + log.d("getAdResource = " + lastReportedAdResource); + return lastReportedAdResource; + } + + private void populateAdValues() { + lastReportedAdDuration = Long.valueOf(currentAdInfo.getAdDuration() / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); + lastReportedAdTitle = currentAdInfo.getAdTitle(); + lastReportedAdPlayhead = Long.valueOf(currentAdInfo.getAdPlayHead() / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); + lastReportedAdBitrate = currentAdInfo.getMediaBitrate(); + log.d("lastReportedAdResource: " + lastReportedAdResource); + log.d("lastReportedAdDuration: " + lastReportedAdDuration); + log.d("lastReportedAdTitle: " + lastReportedAdTitle); + log.d("lastReportedAdPlayhead: " + lastReportedAdPlayhead); + log.d("lastReportedAdBitrate: " + lastReportedAdBitrate); + } + + void resetAdValues() { + isFirstPlay = true; + currentAdInfo = null; + lastReportedAdDuration = super.getDuration(); + lastReportedAdTitle = super.getTitle(); + lastReportedAdPlayhead = super.getPlayhead(); + } + + public void onUpdateConfig() { + resetAdValues(); + lastReportedAdBitrate = -1L; + lastReportedAdResource = super.getResource(); + } + + public void setLastAdResource(String lastReportedAdResource) { + this.lastReportedAdResource = lastReportedAdResource; + } + + private void addListeners() { + messageBus.addListener(this, AdEvent.adRequested, event -> { + printEventName(event); + lastReportedAdResource = event.adTagUrl; + log.d("lastReportedAdResource: " + lastReportedAdResource); + if (isNullAdapter()) { + return; + } + getPlugin().getAdapter().fireStart(); + sendReportEvent(event.eventType()); + }); + + messageBus.addListener(this, AdEvent.loaded, event -> { + printEventName(event); + if (isNullAdapter()) { + return; + } + log.d("AD LOADED: isFirstPlay = " + isFirstPlay); + if (isFirstPlay) { + isFirstPlay = false; + getPlugin().getAdapter().fireStart(); + } + currentAdInfo = event.adInfo; + populateAdValues(); + if (isNullAdapter()) { + return; + } + getPlugin().getAdapter().fireStart(); + fireStart(); + sendReportEvent(event.eventType()); + }); + + messageBus.addListener(this, AdEvent.started, event -> { + printEventName(event); + if (isNullAdapter()) { + return; + } + currentAdInfo = event.adInfo; + lastReportedAdPlayhead = Long.valueOf(currentAdInfo.getAdPlayHead() / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); + lastReportedAdBitrate = currentAdInfo.getMediaBitrate(); + log.d("lastReportedAdPlayhead: " + lastReportedAdPlayhead); + fireJoin(); + sendReportEvent(event.eventType()); + }); + + messageBus.addListener(this, AdEvent.paused, event -> { + printEventName(event); + if (isNullAdapter()) { + return; + } + currentAdInfo = event.adInfo; + lastReportedAdPlayhead = Long.valueOf(currentAdInfo.getAdPlayHead() / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); + lastReportedAdBitrate = currentAdInfo.getMediaBitrate(); + log.d("lastReportedAdPlayhead: " + lastReportedAdPlayhead); + firePause(); + sendReportEvent(event.eventType()); + }); + + messageBus.addListener(this, AdEvent.resumed, event -> { + printEventName(event); + if (isNullAdapter()) { + return; + } + currentAdInfo = event.adInfo; +// if (isFirstPlay) { +// isFirstPlay = false; +// if (getPlugin().getAdapter() != null && !getPlugin().getAdapter().getFlags().isStarted()) { +// getPlugin().getAdapter().fireStart(); +// } +// fireStart(); +// fireJoin(); +// populateAdValues(); +// } + + lastReportedAdPlayhead = Long.valueOf(currentAdInfo.getAdPlayHead() / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); + lastReportedAdBitrate = currentAdInfo.getMediaBitrate(); + log.d("lastReportedAdPlayhead: " + lastReportedAdPlayhead); + fireResume(); + sendReportEvent(event.eventType()); + }); + + messageBus.addListener(this, AdEvent.completed, event -> { + printEventName(event); + if (isNullAdapter()) { + return; + } + lastReportedAdPlayhead = lastReportedAdDuration; + log.d("lastReportedAdPlayhead: " + lastReportedAdPlayhead); + fireStop(); + sendReportEvent(event.eventType()); + }); + + messageBus.addListener(this, AdEvent.adBreakIgnored, event -> { + printEventName(event); + if (isNullAdapter()) { + return; + } + fireStop(); + sendReportEvent(event.eventType()); + }); + + messageBus.addListener(this, AdEvent.contentResumeRequested, event -> { + printEventName(event); + if (isNullAdapter()) { + return; + } + fireStop(); + sendReportEvent(event.eventType()); + }); + + messageBus.addListener(this, AdEvent.skipped, event -> { + printEventName(event); + if (isNullAdapter()) { + return; + } + currentAdInfo = event.adInfo; + lastReportedAdPlayhead = Long.valueOf(currentAdInfo.getAdPlayHead() / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); + printLastReportedAdPlayhead(); + //fireStop(new HashMap(){{put("skipped","true");}}); + fireSkip(); + sendReportEvent(event.eventType()); + }); + + messageBus.addListener(this, AdEvent.error, event -> { + printEventName(event); + if (isNullAdapter()) { + return; + } + log.e("ERROR " + event.error.errorType); + handleAdError(event.error); + sendReportEvent(event.eventType()); + }); + + messageBus.addListener(this, AdEvent.adClickedEvent, event -> { + printEventName(event); + if (isNullAdapter()) { + return; + } + if (event.clickThruUrl != null) { + fireClick(event.clickThruUrl); + } + sendReportEvent(event.eventType()); + }); + + messageBus.addListener(this, AdEvent.playHeadChanged, event -> { + lastReportedAdPlayhead = Long.valueOf(event.adPlayHead).doubleValue(); + //We are not sending this event to youbora, + //so prevent it from dispatching through YouboraEvent.YouboraReport. + }); + + messageBus.addListener(this, AdEvent.adProgress, event -> { + //We are not sending this event to youbora, + //so prevent it from dispatching through YouboraEvent.YouboraReport. + }); + + messageBus.addListener(this, AdEvent.adBufferStart, event -> { + printEventName(event); + if (isNullAdapter()) { + return; + } + printLastReportedAdPlayhead(); + fireBufferBegin(); + sendReportEvent(event.eventType()); + }); + + messageBus.addListener(this, AdEvent.adBufferEnd, event -> { + printEventName(event); + if (isNullAdapter()) { + return; + } + printLastReportedAdPlayhead(); + fireBufferEnd(); + sendReportEvent(event.eventType()); + }); + + messageBus.addListener(this, AdEvent.allAdsCompleted, event -> { + printEventName(event); + if (isNullAdapter()) { + return; + } + printLastReportedAdPlayhead(); + fireAllAdsCompleted(); + sendReportEvent(event.eventType()); + }); + } + + private void handleAdError(PKError error) { + + PKAdErrorType adErrorType = (PKAdErrorType) error.errorType; + + switch (adErrorType) { + case QUIET_LOG_ERROR: + log.d("QUIET_LOG_ERROR. Avoid sending to Youbora."); + fireError(error.message, PKAdErrorType.QUIET_LOG_ERROR.name(), null, null); + return; + default: + log.e("onAdError " + adErrorType.name()); + Exception adException = null; + if (error.exception instanceof Exception) { + adException = (Exception) error.exception; + } + fireFatalError(error.message, adErrorType.name(), null, adException); + } + sendReportEvent(adErrorType); + } +} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java new file mode 100644 index 0000000..302a580 --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -0,0 +1,432 @@ +/* + * ============================================================================ + * Copyright (C) 2017 Kaltura Inc. + * + * Licensed under the AGPLv3 license, unless a different license for a + * particular library is specified in the applicable library path. + * + * You may obtain a copy of the License at + * https://www.gnu.org/licenses/agpl-3.0.html + * ============================================================================ + */ + +package com.kaltura.playkit.plugins.youbora; + +import android.text.TextUtils; + +import com.kaltura.playkit.BuildConfig; +import com.kaltura.playkit.MessageBus; +import com.kaltura.playkit.PKError; +import com.kaltura.playkit.PKEvent; +import com.kaltura.playkit.PKLog; +import com.kaltura.playkit.PKMediaConfig; +import com.kaltura.playkit.PKMediaEntry; +import com.kaltura.playkit.PlayKitManager; +import com.kaltura.playkit.PlaybackInfo; +import com.kaltura.playkit.Player; +import com.kaltura.playkit.PlayerEvent; +import com.kaltura.playkit.plugins.ads.AdCuePoints; +import com.kaltura.playkit.plugins.ads.AdEvent; +import com.kaltura.playkit.plugins.youbora.pluginconfig.YouboraConfig; +import com.kaltura.playkit.utils.Consts; +import com.npaw.youbora.lib6.YouboraUtil; +import com.npaw.youbora.lib6.adapter.PlayerAdapter; + +import java.util.LinkedHashSet; + +import static com.kaltura.playkit.PlayerEvent.Type.PLAYHEAD_UPDATED; + +/** + * @hide + */ + +class PKYouboraPlayerAdapter extends PlayerAdapter { + + private static final PKLog log = PKLog.get("PKYouboraPlayerAdapter"); + private static final String KALTURA_ANDROID = "Kaltura-Android"; + private static final String PLAYER_ERROR_STR = "Player error occurred"; + + private MessageBus messageBus; + private PKMediaConfig mediaConfig; + + private boolean isFirstPlay = true; + private boolean isBuffering = false; + + private String lastReportedResource = "unknown"; + private Long lastReportedBitrate = -1L; + private Long lastReportedThroughput; + private String lastReportedRendition; + private Double lastReportedMediaPosition; + private Double lastReportedMediaDuration; + private String houseHoldId; + private boolean isAdPlaying; + private AdCuePoints adCuePoints; + + PKYouboraPlayerAdapter(Player player, MessageBus messageBus, PKMediaConfig mediaConfig, YouboraConfig pluginConfig) { + super(player); + log.d("Start PKYouboraPlayerAdapter"); + this.messageBus = messageBus; + this.mediaConfig = mediaConfig; + updateDurationFromMediaConfig(mediaConfig); + this.houseHoldId = pluginConfig.getHouseHoldId(); + registerListeners(); + + } + + private void updateDurationFromMediaConfig(PKMediaConfig mediaConfig) { + if (mediaConfig != null && mediaConfig.getMediaEntry() != null) { + lastReportedMediaDuration = Math.floor((double) mediaConfig.getMediaEntry().getDuration() / Consts.MILLISECONDS_MULTIPLIER); + } + } + + private void onStateChangedEvent(PlayerEvent.StateChanged event) { + //If it is first play, do not continue with the flow. + if (isFirstPlay) { + return; + } + + switch (event.newState) { + case READY: + if (isBuffering) { + //log.d("fireBufferEnd"); + isBuffering = false; + fireBufferEnd(); + } + break; + case BUFFERING: + //log.d("fireBufferBegin"); + isBuffering = true; + fireBufferBegin(); + break; + default: + break; + } + sendReportEvent(event); + } + + private void sendErrorHandler(PKEvent event) { + + PlayerEvent.Error errorEvent = (PlayerEvent.Error) event; + String errorMetadata = (errorEvent != null && errorEvent.error != null) ? errorEvent.error.message : PLAYER_ERROR_STR; + + if (errorEvent == null || errorEvent.error == null || errorEvent.error.exception == null) { + fireFatalError(errorMetadata, event.eventType().name(), null); + return; + } + + PKError error = errorEvent.error; + Exception playerErrorException = (Exception) error.exception; + String exceptionClass = ""; + + if (playerErrorException.getCause() != null && playerErrorException.getCause().getClass() != null) { + exceptionClass = playerErrorException.getCause().getClass().getName(); + errorMetadata = (playerErrorException.getCause().toString() != null) ? playerErrorException.getCause().toString() : errorMetadata; + } else { + if (error.exception.getClass() != null) { + exceptionClass = error.exception.getClass().getName(); + } + } + + LinkedHashSet causeMessages = getExceptionMessageChain(playerErrorException); + StringBuilder exceptionCauseBuilder = new StringBuilder(); + if (causeMessages.isEmpty()) { + exceptionCauseBuilder.append(playerErrorException.toString()); + } else { + for (String cause : causeMessages) { + exceptionCauseBuilder.append(cause).append("\n"); + } + } + + String errorCode = (errorEvent.error.errorType != null) ? errorEvent.error.errorType + " - " : ""; + fireFatalError(exceptionCauseBuilder.toString(), errorCode + exceptionClass, errorMetadata); + } + + public static LinkedHashSet getExceptionMessageChain(Throwable throwable) { + LinkedHashSet result = new LinkedHashSet<>(); + while (throwable != null) { + if (throwable.getMessage() != null){ + result.add(throwable.getMessage()); + } + throwable = throwable.getCause(); + } + return result; + } + + @Override + public void registerListeners() { + super.registerListeners(); + addListeners(); + isFirstPlay = true; + } + + private void addListeners() { + messageBus.addListener(this, PlayerEvent.playbackInfoUpdated, event -> { + printReceivedPlayerEvent(event); + PlaybackInfo currentPlaybackInfo = ((PlayerEvent.PlaybackInfoUpdated) event).playbackInfo; + lastReportedBitrate = currentPlaybackInfo.getVideoBitrate(); + lastReportedThroughput = currentPlaybackInfo.getVideoThroughput(); + lastReportedRendition = generateRendition(lastReportedBitrate, (int) currentPlaybackInfo.getVideoWidth(), (int) currentPlaybackInfo.getVideoHeight()); + sendReportEvent(event); + }); + + messageBus.addListener(this, PlayerEvent.durationChanged, event -> { + printReceivedPlayerEvent(event); + lastReportedMediaDuration = Math.floor((double) event.duration / Consts.MILLISECONDS_MULTIPLIER); + log.d("DURATION_CHANGE lastReportedMediaDuration = " + lastReportedMediaDuration); + sendReportEvent(event); + }); + + messageBus.addListener(this, PlayerEvent.playheadUpdated, event -> { + lastReportedMediaPosition = Math.floor((double) event.position / Consts.MILLISECONDS_MULTIPLIER); + lastReportedMediaDuration = Math.floor((double) event.duration / Consts.MILLISECONDS_MULTIPLIER); + //log.d("PLAYHEAD_UPDATED new duration = " + lastReportedMediaPosition); + }); + + messageBus.addListener(this, PlayerEvent.stateChanged, event -> { + printReceivedPlayerEvent(event); + onStateChangedEvent(event); + }); + + messageBus.addListener(this, PlayerEvent.ended, event -> { + printReceivedPlayerEvent(event); + if (!isFirstPlay && ((adCuePoints == null) || !adCuePoints.hasPostRoll())) { + fireStop(); + isFirstPlay = true; + adCuePoints = null; + } + sendReportEvent(event); + }); + + messageBus.addListener(this, PlayerEvent.error, event -> { + printReceivedPlayerEvent(event); + PKError error = event.error; + if (error != null && !error.isFatal()) { + log.v("Error eventType = " + error.errorType + " severity = " + error.severity + " errorMessage = " + error.message); + return; + } + sendErrorHandler(event); + adCuePoints = null; + sendReportEvent(event); + }); + + messageBus.addListener(this, PlayerEvent.pause, event -> { + firePause(); + sendReportEvent(event); + }); + + messageBus.addListener(this, PlayerEvent.play, event -> { + printReceivedPlayerEvent(event); + if (!isFirstPlay) { + fireResume(); + } else { + isFirstPlay = false; + fireStart(); + } + sendReportEvent(event); + }); + + messageBus.addListener(this, PlayerEvent.playing, event -> { + printReceivedPlayerEvent(event); + if (isFirstPlay) { + isFirstPlay = false; + fireStart(); + } + fireJoin(); + sendReportEvent(event); + }); + + messageBus.addListener(this, PlayerEvent.seeked, event -> { + printReceivedPlayerEvent(event); + fireSeekEnd(); + sendReportEvent(event); + }); + + messageBus.addListener(this, PlayerEvent.seeking, event -> { + printReceivedPlayerEvent(event); + fireSeekBegin(); + sendReportEvent(event); + }); + + messageBus.addListener(this, PlayerEvent.sourceSelected, event -> { + printReceivedPlayerEvent(event); + lastReportedResource = event.source.getUrl(); + //log.d("SOURCE_SELECTED lastReportedResource = " + lastReportedResource); + sendReportEvent(event); + }); + + messageBus.addListener(this, AdEvent.contentPauseRequested, event -> { + printReceivedAdEvent(event); + isAdPlaying = true; + }); + + messageBus.addListener(this, AdEvent.started, event -> { + printReceivedAdEvent(event); + isAdPlaying = true; + }); + + messageBus.addListener(this, AdEvent.error, event -> { + printReceivedAdEvent(event); + isAdPlaying = false; + }); + + messageBus.addListener(this, AdEvent.contentResumeRequested, event -> { + printReceivedAdEvent(event); + isAdPlaying = false; + }); + + messageBus.addListener(this, AdEvent.cuepointsChanged, event -> { + printReceivedAdEvent(event); + adCuePoints = event.cuePoints; + }); + + messageBus.addListener(this, AdEvent.allAdsCompleted, event -> { + printReceivedAdEvent(event); + if (adCuePoints != null && adCuePoints.hasPostRoll()) { + getPlugin().getAdapter().fireStop(); + isFirstPlay = true; + adCuePoints = null; + } + }); + } + + private void printReceivedPlayerEvent(PKEvent event) { + log.d("Player Event = " + event.eventType().name()); + } + + private void printReceivedAdEvent(PKEvent event) { + log.d("Ad Event: " + event.eventType().name()); + } + + @Override + public void unregisterListeners() { + messageBus.removeListeners(this); + super.unregisterListeners(); + } + + + public Long getBitrate() { + return this.lastReportedBitrate; + } + + public Long getThroughput() { + return this.lastReportedThroughput; + } + + public String getRendition() { + return lastReportedRendition; + } + + public String getKalturaPlayerVersion() { + return Consts.KALTURA + "-" + PlayKitManager.CLIENT_TAG; + } + + @Override + public String getVersion() { + //getPluginVeriosn + return com.npaw.youbora.lib6.BuildConfig.VERSION_NAME + "-" + BuildConfig.VERSION_NAME + "-" + getPlayerVersion(); + } + + @Override + public String getPlayerVersion() { + return Consts.KALTURA + "-" + PlayKitManager.CLIENT_TAG; + } + + @Override + public String getPlayerName() { + return KALTURA_ANDROID; + } + + @Override + public String getHouseholdId() { + return houseHoldId; + } + + public Double getPlayhead() { + return (lastReportedMediaPosition != null && lastReportedMediaPosition >= 0) ? lastReportedMediaPosition : 0; + } + + public String getResource() { + //log.d("getResource = " + lastReportedResource); + return lastReportedResource; + } + + @Override + public Double getDuration() { + //log.d("getDuration lastReportedMediaDuration = " + lastReportedMediaDuration); + return (lastReportedMediaDuration != null && lastReportedMediaDuration >= 0) ? lastReportedMediaDuration : 0; + } + +// public Double getPlayrate() { +// return lastPlayrate +// } + + public String getTitle() { + if (mediaConfig == null || mediaConfig.getMediaEntry() == null) { + return "unknown"; + } else { + return (!TextUtils.isEmpty(mediaConfig.getMediaEntry().getName())) ? mediaConfig.getMediaEntry().getName() : mediaConfig.getMediaEntry().getId(); + } + } + + public Boolean getIsLive() { + Boolean isLive = Boolean.FALSE; + if (mediaConfig != null && (player == null || (player!= null && player.getDuration() <= 0))) { + isLive = mediaConfig.getMediaEntry().getMediaType() == PKMediaEntry.MediaEntryType.Live; + } else if (player != null) { + isLive = player.isLive(); + } + return isLive; + } + + private void sendReportEvent(PKEvent event) { + if (event.eventType() != PLAYHEAD_UPDATED) { + String reportedEventName = event.eventType().name(); + messageBus.post(new YouboraEvent.YouboraReport(reportedEventName)); + } + } + + public String generateRendition(double bitrate, int width, int height) { + + if ((width <= 0 || height <= 0) && bitrate <= 0) { + return super.getRendition(); + } else { + return YouboraUtil.buildRenditionString(width, height, bitrate); + } + } + + public void onUpdateConfig() { + log.d("onUpdateConfig"); + resetValues(); + } + + public void resetValues() { + lastReportedBitrate = super.getBitrate(); + lastReportedRendition = super.getRendition(); + lastReportedThroughput = super.getThroughput(); + mediaConfig = null; + houseHoldId = null; + isFirstPlay = true; + } + + public void resetPlaybackValues() { + lastReportedMediaDuration = super.getDuration(); + lastReportedMediaPosition = super.getPlayhead(); + lastReportedResource = null; + adCuePoints = null; + resetValues(); + } + + public void setMediaConfig(PKMediaConfig mediaConfig) { + this.mediaConfig = mediaConfig; + updateDurationFromMediaConfig(mediaConfig); + + } + + public void setPluginConfig(YouboraConfig pluginConfig) { + this.houseHoldId = pluginConfig.getHouseHoldId(); + } + + public void setLastReportedResource(String lastReportedResource) { + this.lastReportedResource = lastReportedResource; + } +} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraAdManager.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraAdManager.java deleted file mode 100644 index d910008..0000000 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraAdManager.java +++ /dev/null @@ -1,297 +0,0 @@ -/* - * ============================================================================ - * Copyright (C) 2017 Kaltura Inc. - * - * Licensed under the AGPLv3 license, unless a different license for a - * particular library is specified in the applicable library path. - * - * You may obtain a copy of the License at - * https://www.gnu.org/licenses/agpl-3.0.html - * ============================================================================ - */ - -package com.kaltura.playkit.plugins.youbora; - - -import com.kaltura.playkit.MessageBus; -import com.kaltura.playkit.PKEvent; -import com.kaltura.playkit.PKLog; -import com.kaltura.playkit.PlayKitManager; -import com.kaltura.playkit.PlayerEvent; -import com.kaltura.playkit.plugins.ads.AdEvent; -import com.kaltura.playkit.plugins.ads.AdInfo; -import com.kaltura.playkit.utils.Consts; -import com.kaltura.playkit.ads.PKAdErrorType; -import com.kaltura.playkit.PKError; -import com.npaw.youbora.adnalyzers.AdnalyzerGeneric; -import com.npaw.youbora.plugins.PluginGeneric; -import com.npaw.youbora.youboralib.BuildConfig; -import com.npaw.youbora.youboralib.utils.YBLog; - -import static com.kaltura.playkit.PlayerEvent.Type.PLAYHEAD_UPDATED; -import static com.kaltura.playkit.PlayerEvent.Type.STATE_CHANGED; -import static com.kaltura.playkit.plugins.ads.AdEvent.Type.AD_PROGRESS; - -/** - * @hide - */ - -class YouboraAdManager extends AdnalyzerGeneric { - private static final PKLog log = PKLog.get("YouboraAdManager"); - - private boolean isFirstPlay = true; - private boolean isBuffering = false; - private MessageBus messageBus; - private double adBitrate = -1; - private AdInfo currentAdInfo; - - private String lastReportedAdResource; - private String lastReportedAdTitle; - private Double lastReportedAdPlayhead; - private Double lastReportedAdDuration; - - YouboraAdManager(PluginGeneric plugin, MessageBus messageBus) { - super(plugin); - this.adnalyzerVersion = BuildConfig.VERSION_NAME + "-" + getAdPlayerVersion(); - this.messageBus = messageBus; - - this.messageBus.listen(mEventListener, STATE_CHANGED); - this.messageBus.listen(mEventListener, (Enum[]) AdEvent.Type.values()); - } - - private void onEvent(PlayerEvent.StateChanged event) { - log.d(event.newState.toString()); - switch (event.newState) { - case READY: - if (isBuffering) { - isBuffering = false; - bufferedAdHandler(); - } - break; - case BUFFERING: - isBuffering = true; - bufferingAdHandler(); - break; - default: - break; - } - - messageBus.post(new YouboraEvent.YouboraReport(event.eventType().name())); - } - - private PKEvent.Listener mEventListener = new PKEvent.Listener() { - @Override - public void onEvent(PKEvent event) { - - if (event.eventType() != AdEvent.Type.PLAY_HEAD_CHANGED && event.eventType() != AD_PROGRESS && event.eventType() != PLAYHEAD_UPDATED) { - log.d("YouboraAdManager on event " + event.eventType()); - } - - if (event instanceof AdEvent) { - switch (((AdEvent) event).type) { - case AD_REQUESTED: - lastReportedAdResource = ((AdEvent.AdRequestedEvent) event).adTagUrl; - log.d("lastReportedAdResource: " + lastReportedAdResource); - break; - case LOADED: - if (isFirstPlay) { - isFirstPlay = false; - plugin.playHandler(); - } - currentAdInfo = ((AdEvent.AdLoadedEvent) event).adInfo; - populateAdValues(); - - playAdHandler(); - break; - case STARTED: - currentAdInfo = ((AdEvent.AdStartedEvent) event).adInfo; - lastReportedAdPlayhead = Long.valueOf(currentAdInfo.getAdPlayHead() / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); - log.d("lastReportedAdPlayhead: " + lastReportedAdPlayhead); - - joinAdHandler(); - break; - case PAUSED: - currentAdInfo = ((AdEvent.AdPausedEvent) event).adInfo; - lastReportedAdPlayhead = Long.valueOf(currentAdInfo.getAdPlayHead() / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); - log.d("lastReportedAdPlayhead: " + lastReportedAdPlayhead); - - pauseAdHandler(); - break; - case RESUMED: - currentAdInfo = ((AdEvent.AdResumedEvent) event).adInfo; - if (isFirstPlay) { - isFirstPlay = false; - playAdHandler(); - joinAdHandler(); - populateAdValues(); - } - - lastReportedAdPlayhead = Long.valueOf(currentAdInfo.getAdPlayHead() / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); - log.d("lastReportedAdPlayhead: " + lastReportedAdPlayhead); - - resumeAdHandler(); - break; - case COMPLETED: - lastReportedAdPlayhead = lastReportedAdDuration; - log.d("lastReportedAdPlayhead: " + lastReportedAdPlayhead); - endedAdHandler(); - break; - case AD_BREAK_IGNORED: - endedAdHandler(); - break; - case CONTENT_RESUME_REQUESTED: - endedAdHandler(); - break; - case SKIPPED: - currentAdInfo = ((AdEvent.AdSkippedEvent) event).adInfo; - lastReportedAdPlayhead = Long.valueOf(currentAdInfo.getAdPlayHead() / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); - log.d("lastReportedAdPlayhead: " + lastReportedAdPlayhead); - skipAdHandler(); - break; - case ERROR: - AdEvent.Error errorEvent = (AdEvent.Error) event; - handleAdError(errorEvent.error); - break; - case CLICKED: - log.d("learn more clicked"); - //We are not sending this event to youbora, - //so prevent it from dispatching through YouboraEvent.YouboraReport. - return; - case PLAY_HEAD_CHANGED: - lastReportedAdPlayhead = Long.valueOf(((AdEvent.AdPlayHeadEvent) event).adPlayHead).doubleValue(); - //We are not sending this event to youbora, - //so prevent it from dispatching through YouboraEvent.YouboraReport. - return; - case AD_PROGRESS: - //We are not sending this event to youbora, - //so prevent it from dispatching through YouboraEvent.YouboraReport. - return; - default: - break; - } - messageBus.post(new YouboraEvent.YouboraReport(event.eventType().name())); - } - } - }; - - public void startMonitoring(Object player) { - log.d("startMonitoring"); - super.startMonitoring(player); - isFirstPlay = true; - } - - public void stopMonitoring() { - log.d("stopMonitoring"); - - super.stopMonitoring(); - if (plugin != null) { - plugin.endedHandler(); - } - this.messageBus.remove(mEventListener, STATE_CHANGED); - messageBus.remove(mEventListener, (Enum[]) AdEvent.Type.values()); - messageBus.remove(mEventListener, (PlayerEvent.Type.ERROR)); - - } - - public void setAdBitrate(Double bitrate) { - this.adBitrate = bitrate; - } - - @Override - public Double getAdBitrate() { - return this.adBitrate; - } - - @Override - public String getAdTitle() { - log.d("getAdTitle "); - return lastReportedAdTitle != null ? lastReportedAdTitle : "No Info"; - } - - @Override - public Double getAdDuration() { - return currentAdInfo != null ? (Long.valueOf(currentAdInfo.getAdDuration() / Consts.MILLISECONDS_MULTIPLIER).doubleValue()) : 0.0D; - } - - @Override - public String getAdPlayerVersion() { - log.d("getAdPlayerVersion " + PlayKitManager.CLIENT_TAG); - - return Consts.KALTURA + "-" + PlayKitManager.CLIENT_TAG; - } - - @Override - public Double getAdPlayhead() { - log.d("getAdPlayhead = " + lastReportedAdPlayhead); - return lastReportedAdPlayhead; - } - - @Override - public String getAdPosition() { - String adPosition = "unknown"; - - if (currentAdInfo == null) { - return adPosition; - } - - switch (currentAdInfo.getAdPositionType()) { - case PRE_ROLL: - adPosition = "pre"; - break; - case MID_ROLL: - adPosition = "mid"; - break; - case POST_ROLL: - adPosition = "post"; - break; - default: - adPosition = "unknown"; - } - log.d("adPosition = " + adPosition); - return adPosition; - } - - @Override - public String getAdResource() { - log.d("getAdResource = " + lastReportedAdResource); - return lastReportedAdResource; - } - - private void populateAdValues() { - lastReportedAdDuration = Long.valueOf(currentAdInfo.getAdDuration() / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); - lastReportedAdTitle = currentAdInfo.getAdTitle(); - lastReportedAdPlayhead = Long.valueOf(currentAdInfo.getAdPlayHead() / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); - log.d("lastReportedAdDuration: " + lastReportedAdDuration); - log.d("lastReportedAdTitle: " + lastReportedAdTitle); - log.d("lastReportedAdPlayhead: " + lastReportedAdPlayhead); - } - - void resetAdValues() { - isFirstPlay = true; - currentAdInfo = null; - lastReportedAdDuration = super.getAdDuration(); - lastReportedAdTitle = super.getAdTitle(); - lastReportedAdPlayhead = super.getAdPlayhead(); - } - - public void onUpdateConfig() { - resetAdValues(); - adBitrate = -1; - lastReportedAdResource = super.getAdResource(); - } - - private void handleAdError(PKError error) { - - PKAdErrorType adErrorType = (PKAdErrorType) error.errorType; - switch (adErrorType) { - case QUIET_LOG_ERROR: - log.d("QUIET_LOG_ERROR. Avoid sending to Youbora."); - return; - default: - YBLog.debug("onAdError " + adErrorType.name()); - endedAdHandler(); - } - - messageBus.post(new YouboraEvent.YouboraReport(adErrorType.name())); - } -} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraConfig.java deleted file mode 100644 index 3460133..0000000 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraConfig.java +++ /dev/null @@ -1,162 +0,0 @@ -/* - * ============================================================================ - * Copyright (C) 2017 Kaltura Inc. - * - * Licensed under the AGPLv3 license, unless a different license for a - * particular library is specified in the applicable library path. - * - * You may obtain a copy of the License at - * https://www.gnu.org/licenses/agpl-3.0.html - * ============================================================================ - */ - -package com.kaltura.playkit.plugins.youbora; - - -import com.google.gson.JsonObject; -import com.kaltura.playkit.PKLog; -import com.kaltura.playkit.PKMediaConfig; -import com.kaltura.playkit.Player; -import com.kaltura.playkit.Utils; -import com.kaltura.playkit.utils.Consts; - -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; - - -/** - * Created by zivilan on 17/11/2016. - */ - -public class YouboraConfig { - private static final PKLog log = PKLog.get("YouboraConfig"); - - private static Map youboraConfig = null; - private static final Map defaultYouboraConfig; - private static final Map mediaObject; - private static final Map youboraConfigObject; - private static final Map propertiesObject; - private static final Map extraParamsObject; - private static final Map adsObject; - - private static String[] youboraConfigFieldNames = new String[]{"accountCode", "username", "transactionCode"}; - private static String[] youboraBooleanConfigFieldNames = new String[]{"haltOnError", "enableAnalytics", "httpSecure", "parseCDNNodeHost"}; - - private static String[] mediaConfigFieldNames = new String[]{"title", "cdn"}; - private static String[] mediaBooleanConfigFieldNames = new String[]{"isLive"}; - - private static String[] adsConfigFieldNames = new String[]{"title", "campaign"}; - private static String[] adsBooleanConfigFieldNames = new String[]{}; - - private static String[] propertiesConfigFieldNames = new String[]{"genre", "type", "transaction_type", "year", "cast", "director", "owner", "parental", "price", "rating", "audioType", "audioChannels" - , "device", "quality"}; - private static String[] extraConfigFieldNames = new String[]{"param1", "param2", "param3", "param4", "param5", "param6", "param7", "param8", "param9", "param10"}; - - static { - HashMap youboraLocalConfig = new HashMap<>(20); - youboraLocalConfig.put("enableAnalytics", true); - youboraLocalConfig.put("parseHLS", false); - youboraLocalConfig.put("parseCDNNodeHost", false); - youboraLocalConfig.put("httpSecure", true); - youboraLocalConfig.put("accountCode", "kalturatest"); - youboraLocalConfig.put("transactionCode", ""); - youboraLocalConfig.put("haltOnError", true); - - youboraConfigObject = youboraLocalConfig; - - Map device = new HashMap<>(1); - device.put("id", null); - - Map media = new HashMap<>(5); - media.put("cdn", null); - youboraLocalConfig.put("media", media); - mediaObject = media; - - Map ads = new HashMap<>(6); - ads.put("resource", null); - ads.put("position", null); - ads.put("duration", null); - youboraLocalConfig.put("ads", ads); - adsObject = ads; - - - Map properties = new HashMap<>(16); - youboraLocalConfig.put("properties", properties); - propertiesObject = properties; - - Map extraParams = new HashMap<>(10); - youboraLocalConfig.put("extraParams", extraParams); - extraParamsObject = extraParams; - - defaultYouboraConfig = Collections.unmodifiableMap(youboraLocalConfig); - } - - private YouboraConfig() { - } - - public static Map getConfig(JsonObject pluginConfig, PKMediaConfig mediaConfig, Player player) { - // load from json - setConfig(pluginConfig, mediaConfig, player); - - return youboraConfig; - } - - public static Map updateMediaConfig(JsonObject pluginConfig, String key, Object value) { - - mediaObject.put(key, value); - if (Utils.isJsonObjectValueValid(pluginConfig, "media")) { - setYouboraConfigObject(mediaObject, pluginConfig.getAsJsonObject("media"), mediaConfigFieldNames, mediaBooleanConfigFieldNames); - } - return youboraConfig; - } - - private static void setConfig(JsonObject pluginConfig, PKMediaConfig mediaConfig, Player player) { - log.d("setConfig"); - - youboraConfig = defaultYouboraConfig; - if (mediaConfig != null) { - - Long duration = mediaConfig.getMediaEntry().getDuration() / Consts.MILLISECONDS_MULTIPLIER; - log.d("Youbora update duration = " + duration.doubleValue()); - - mediaObject.put("duration", duration.intValue()); //Duration should be sent in secs - propertiesObject.put("sessionId", player.getSessionId()); - } - if (pluginConfig != null) { - - //set these values on the root object - setYouboraConfigObject(youboraConfigObject, pluginConfig, youboraConfigFieldNames, youboraBooleanConfigFieldNames); - - if (Utils.isJsonObjectValueValid(pluginConfig, "media")) { - setYouboraConfigObject(mediaObject, pluginConfig.getAsJsonObject("media"), mediaConfigFieldNames, mediaBooleanConfigFieldNames); - } - if (Utils.isJsonObjectValueValid(pluginConfig, "ads")) { - setYouboraConfigObject(adsObject, pluginConfig.getAsJsonObject("ads"), adsConfigFieldNames, adsBooleanConfigFieldNames); - } - if (Utils.isJsonObjectValueValid(pluginConfig, "properties")) { - setYouboraConfigObject(propertiesObject, pluginConfig.getAsJsonObject("properties"), propertiesConfigFieldNames, null); - } - if (Utils.isJsonObjectValueValid(pluginConfig, "extraParams")) { - setYouboraConfigObject(extraParamsObject, pluginConfig.getAsJsonObject("extraParams"), extraConfigFieldNames, null); - } - } - } - - private static void setYouboraConfigObject(Map defaultJsonObject, JsonObject jsonObject, String[] fieldNames, String[] booleanFieldNames) { - for (String fieldName : fieldNames) { - if (Utils.isJsonObjectValueValid(jsonObject, fieldName)) { - log.d("setYouboraConfigObject: " + fieldName); - defaultJsonObject.put(fieldName, jsonObject.getAsJsonPrimitive(fieldName).getAsString()); - } - } - if (booleanFieldNames != null) { - for (String fieldName : booleanFieldNames) { - if (Utils.isJsonObjectValueValid(jsonObject, fieldName)) { - log.d("setYouboraConfigObject: " + fieldName); - defaultJsonObject.put(fieldName, jsonObject.getAsJsonPrimitive(fieldName).getAsBoolean()); - } - } - } - } -} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraEvent.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraEvent.java index 9203b81..a1e8e46 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraEvent.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraEvent.java @@ -20,6 +20,8 @@ public class YouboraEvent implements PKEvent { + public static final Class reportSent = YouboraReport.class; + public enum Type { REPORT_SENT } diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java deleted file mode 100644 index 3a796bb..0000000 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraLibraryManager.java +++ /dev/null @@ -1,357 +0,0 @@ -/* - * ============================================================================ - * Copyright (C) 2017 Kaltura Inc. - * - * Licensed under the AGPLv3 license, unless a different license for a - * particular library is specified in the applicable library path. - * - * You may obtain a copy of the License at - * https://www.gnu.org/licenses/agpl-3.0.html - * ============================================================================ - */ - -package com.kaltura.playkit.plugins.youbora; - -import com.kaltura.playkit.MessageBus; -import com.kaltura.playkit.PKError; -import com.kaltura.playkit.PKEvent; -import com.kaltura.playkit.PKLog; -import com.kaltura.playkit.PKMediaConfig; -import com.kaltura.playkit.PKMediaEntry; -import com.kaltura.playkit.PlayKitManager; -import com.kaltura.playkit.PlaybackInfo; -import com.kaltura.playkit.Player; -import com.kaltura.playkit.PlayerEvent; -import com.kaltura.playkit.plugins.ads.AdCuePoints; -import com.kaltura.playkit.plugins.ads.AdEvent; -import com.kaltura.playkit.utils.Consts; -import com.npaw.youbora.plugins.PluginGeneric; -import com.npaw.youbora.youboralib.BuildConfig; -import com.npaw.youbora.youboralib.utils.Utils; - -import org.json.JSONException; - -import java.util.LinkedHashSet; -import java.util.Map; - -import static com.kaltura.playkit.PlayerEvent.Type.PLAYHEAD_UPDATED; -import static com.kaltura.playkit.PlayerEvent.Type.STATE_CHANGED; - -/** - * @hide - */ - -class YouboraLibraryManager extends PluginGeneric { - - private static final PKLog log = PKLog.get("YouboraLibraryManager"); - private static final String KALTURA_ANDROID = "Kaltura-Android"; - private static final String PLAYER_ERROR_STR = "Player error occurred"; - - - private Player player; - private MessageBus messageBus; - private PKMediaConfig mediaConfig; - - private boolean isFirstPlay = true; - private boolean isBuffering = false; - private boolean allowSendingYouboraBufferEvents = false; //When false will prevent from sending bufferUnderrun event. - - private String lastReportedResource = "unknown"; - private Double lastReportedBitrate = -1.0; - private Double lastReportedThroughput; - private String lastReportedRendition; - private AdCuePoints adCuePoints; - - YouboraLibraryManager(String options) throws JSONException { - super(options); - } - - YouboraLibraryManager(Map options, MessageBus messageBus, PKMediaConfig mediaConfig, Player player) { - super(options); - this.player = player; - this.messageBus = messageBus; - this.mediaConfig = mediaConfig; - - messageBus.listen(mEventListener, (Enum[]) PlayerEvent.Type.values()); - messageBus.listen(mEventListener, (Enum[]) AdEvent.Type.values()); - } - - protected void init() { - super.init(); - this.pluginName = KALTURA_ANDROID; - this.pluginVersion = BuildConfig.VERSION_NAME + "-" + getPlayerVersion(); - } - - private void onEvent(PlayerEvent.StateChanged event) { - //If it is first play, do not continue with the flow. - if (isFirstPlay) { - return; - } - - switch (event.newState) { - case READY: - if (isBuffering) { - isBuffering = false; - bufferedHandler(); - } - break; - case BUFFERING: - if (allowSendingYouboraBufferEvents) { - isBuffering = true; - bufferingHandler(); - } else { - allowSendingYouboraBufferEvents = true; - } - break; - default: - break; - } - sendReportEvent(event); - } - - - private PKEvent.Listener mEventListener = new PKEvent.Listener() { - @Override - public void onEvent(PKEvent event) { - - if (event.eventType() == PlayerEvent.Type.PLAYBACK_INFO_UPDATED) { - PlaybackInfo currentPlaybackInfo = ((PlayerEvent.PlaybackInfoUpdated) event).playbackInfo; - lastReportedBitrate = Long.valueOf(currentPlaybackInfo.getVideoBitrate()).doubleValue(); - lastReportedThroughput = Long.valueOf(currentPlaybackInfo.getVideoThroughput()).doubleValue(); - lastReportedRendition = generateRendition(lastReportedBitrate, (int) currentPlaybackInfo.getVideoWidth(), (int) currentPlaybackInfo.getVideoHeight()); - return; - } - - if (event instanceof PlayerEvent && viewManager != null) { - if (event.eventType() != PLAYHEAD_UPDATED) { - log.d("New PKEvent = " + event.eventType().name()); - } - switch (((PlayerEvent) event).type) { - case DURATION_CHANGE: - log.d("new duration = " + ((PlayerEvent.DurationChanged) event).duration); - break; - case STATE_CHANGED: - YouboraLibraryManager.this.onEvent((PlayerEvent.StateChanged) event); - break; - case ENDED: - if (!isFirstPlay && ((adCuePoints == null) || !adCuePoints.hasPostRoll())) { - endedHandler(); - isFirstPlay = true; - adCuePoints = null; - } - break; - case ERROR: - PKError error = ((PlayerEvent.Error) event).error; - if (error != null && !error.isFatal()) { - log.v("Error eventType = " + error.errorType + " severity = " + error.severity + " errorMessage = " + error.message); - return; - } - sendErrorHandler(event); - adCuePoints = null; - break; - case PAUSE: - pauseHandler(); - break; - case PLAY: - if (!isFirstPlay) { - resumeHandler(); - } else { - isFirstPlay = false; - playHandler(); - } - break; - case PLAYING: - if (isFirstPlay) { - isFirstPlay = false; - playHandler(); - } - playingHandler(); - break; - case SEEKED: - seekedHandler(); - break; - case SEEKING: - seekingHandler(); - break; - case SOURCE_SELECTED: - PlayerEvent.SourceSelected sourceSelected = ((PlayerEvent.SourceSelected) event); - lastReportedResource = sourceSelected.source.getUrl(); - break; - default: - break; - } - if (((PlayerEvent) event).type != STATE_CHANGED) { - sendReportEvent(event); - } - } else if (event instanceof AdEvent) { - onAdEvent((AdEvent) event); - } - } - }; - - private void sendErrorHandler(PKEvent event) { - - PlayerEvent.Error errorEvent = (PlayerEvent.Error) event; - String errorMetadata = (errorEvent != null && errorEvent.error != null) ? errorEvent.error.message : PLAYER_ERROR_STR; - PKError error = errorEvent.error; - if (error.exception == null) { - errorHandler(errorMetadata, event.eventType().name()); - return; - } - - Exception playerErrorException = (Exception) error.exception; - String exceptionClass = ""; - - if (playerErrorException.getCause() != null && playerErrorException.getCause().getClass() != null) { - exceptionClass = playerErrorException.getCause().getClass().getName(); - errorMetadata = (playerErrorException.getCause().toString() != null) ? playerErrorException.getCause().toString() : errorMetadata; - } else { - if (error.exception.getClass() != null) { - exceptionClass = error.exception.getClass().getName(); - } - } - - LinkedHashSet causeMessages = getExceptionMessageChain(playerErrorException); - StringBuilder exceptionCauseBuilder = new StringBuilder(); - if (causeMessages.isEmpty()) { - exceptionCauseBuilder.append(playerErrorException.toString()); - } else { - for (String cause : causeMessages) { - exceptionCauseBuilder.append(cause).append("\n"); - } - } - - String errorCode = (errorEvent != null && errorEvent.error != null && errorEvent.error.errorType != null) ? errorEvent.error.errorType + " - " : ""; - errorHandler(exceptionCauseBuilder.toString(), errorCode + exceptionClass, errorMetadata); - } - - public static LinkedHashSet getExceptionMessageChain(Throwable throwable) { - LinkedHashSet result = new LinkedHashSet<>(); - while (throwable != null) { - if (throwable.getMessage() != null){ - result.add(throwable.getMessage()); - } - throwable = throwable.getCause(); - } - return result; - } - - private void onAdEvent(AdEvent event) { - if (event.type != AdEvent.Type.PLAY_HEAD_CHANGED && event.type != AdEvent.Type.AD_PROGRESS) { - log.d("Ad Event: " + event.type.name()); - } - - switch (event.type) { - case STARTED: - ignoringAdHandler(); - allowSendingYouboraBufferEvents = false; - break; - case CONTENT_RESUME_REQUESTED: - ignoredAdHandler(); - break; - case CUEPOINTS_CHANGED: - AdEvent.AdCuePointsUpdateEvent cuePointsList = (AdEvent.AdCuePointsUpdateEvent) event; - adCuePoints = cuePointsList.cuePoints; - break; - case ALL_ADS_COMPLETED: - if (adCuePoints != null && adCuePoints.hasPostRoll()) { - endedHandler(); - isFirstPlay = true; - adCuePoints = null; - } - break; - default: - break; - } - } - - @Override - public void pauseMonitoring() { - super.pauseMonitoring(); - allowSendingYouboraBufferEvents = false; - } - - public void startMonitoring(Object player) { - log.d("startMonitoring"); - super.startMonitoring(player); - isFirstPlay = true; - allowSendingYouboraBufferEvents = false; - } - - public void stopMonitoring() { - log.d("stopMonitoring"); - super.stopMonitoring(); - } - - public Double getBitrate() { - return this.lastReportedBitrate; - } - - public Double getThroughput() { - return this.lastReportedThroughput; - } - - public String getRendition() { - return lastReportedRendition; - } - - public String getPlayerVersion() { - return Consts.KALTURA + "-" + PlayKitManager.CLIENT_TAG; - } - - public Double getPlayhead() { - double currPos = Long.valueOf(player.getCurrentPosition() / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); - return (currPos >= 0) ? currPos : 0; - } - - public String getResource() { - return lastReportedResource; - } - - public Double getMediaDuration() { - double lastReportedMediaDuration = (mediaConfig == null) ? 0 : Long.valueOf(mediaConfig.getMediaEntry().getDuration() / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); - log.d("lastReportedMediaDuration = " + lastReportedMediaDuration); - return lastReportedMediaDuration; - } - - public String getTitle() { - if (mediaConfig == null || mediaConfig.getMediaEntry() == null) { - return "unknown"; - } else { - return mediaConfig.getMediaEntry().getId(); - } - } - - public Boolean getIsLive() { - return mediaConfig != null && (mediaConfig.getMediaEntry().getMediaType() == PKMediaEntry.MediaEntryType.Live); - } - - private void sendReportEvent(PKEvent event) { - if (event.eventType() != PLAYHEAD_UPDATED) { - String reportedEventName = event.eventType().name(); - messageBus.post(new YouboraEvent.YouboraReport(reportedEventName)); - } - } - - public String generateRendition(double bitrate, int width, int height) { - - if ((width <= 0 || height <= 0) && bitrate <= 0) { - return super.getRendition(); - } else { - return Utils.buildRenditionString(width, height, bitrate); - } - } - - public void resetValues() { - lastReportedBitrate = super.getBitrate(); - lastReportedRendition = super.getRendition(); - lastReportedThroughput = super.getThroughput(); - isFirstPlay = true; - } - - public void onUpdateConfig() { - resetValues(); - adCuePoints = null; - lastReportedResource = "unknown"; - } -} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index 8b7956f..60ee7db 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -1,19 +1,8 @@ -/* - * ============================================================================ - * Copyright (C) 2017 Kaltura Inc. - * - * Licensed under the AGPLv3 license, unless a different license for a - * particular library is specified in the applicable library path. - * - * You may obtain a copy of the License at - * https://www.gnu.org/licenses/agpl-3.0.html - * ============================================================================ - */ - package com.kaltura.playkit.plugins.youbora; import android.content.Context; +import com.google.gson.Gson; import com.google.gson.JsonObject; import com.kaltura.playkit.MessageBus; import com.kaltura.playkit.PKEvent; @@ -23,10 +12,8 @@ import com.kaltura.playkit.Player; import com.kaltura.playkit.PlayerEvent; import com.kaltura.playkit.plugin.youbora.BuildConfig; -import com.kaltura.playkit.utils.Consts; -import com.npaw.youbora.youboralib.data.Options; - -import java.util.Map; +import com.kaltura.playkit.plugins.ads.AdEvent; +import com.kaltura.playkit.plugins.youbora.pluginconfig.YouboraConfig; /** * Created by zivilan on 02/11/2016. @@ -35,14 +22,15 @@ public class YouboraPlugin extends PKPlugin { private static final PKLog log = PKLog.get("YouboraPlugin"); - private static YouboraLibraryManager pluginManager; - private static YouboraAdManager adsManager; + private static PKYouboraPlayerAdapter pluginManager; + private static PKYouboraAdsAdapter adsManager; private PKMediaConfig mediaConfig; - private JsonObject pluginConfig; + private YouboraConfig pluginConfig; + private NPAWPlugin npawPlugin; private Player player; private MessageBus messageBus; - private boolean adAnalytics = false; + private boolean isMonitoring = false; private boolean isAdsMonitoring = false; @@ -68,23 +56,69 @@ public void warmUp(Context context) { } }; + @Override + protected void onLoad(final Player player, Object config, final MessageBus messageBus, Context context) { + log.d("onLoad"); + this.player = player; + this.messageBus = messageBus; + + this.pluginConfig = parseConfig(config); + //YouboraLog.setDebugLevel(YouboraLog.Level.VERBOSE); + npawPlugin = new NPAWPlugin(pluginConfig.getYouboraOptions()); + loadPlugin(); + } + + private void loadPlugin() { + + messageBus.addListener(this, PlayerEvent.sourceSelected, event -> { + PlayerEvent.SourceSelected sourceSelected = event; + if (sourceSelected != null && sourceSelected.source != null) { + log.d("YouboraPlugin SOURCE_SELECTED = " + sourceSelected.source.getUrl()); + if (pluginManager != null) { + pluginManager.setLastReportedResource(sourceSelected.source.getUrl()); + } + } + }); + + messageBus.addListener(this, PlayerEvent.durationChanged, event -> { + log.d("YouboraPlugin DURATION_CHANGE"); + }); + + messageBus.addListener(this, PlayerEvent.stopped, event -> { + log.d("YouboraPlugin STOPPED"); + }); + } @Override protected void onUpdateMedia(PKMediaConfig mediaConfig) { stopMonitoring(); log.d("youbora - onUpdateMedia"); + this.mediaConfig = mediaConfig; - Map opt = YouboraConfig.getConfig(pluginConfig, this.mediaConfig, player); // Refresh options with updated media - pluginManager.setOptions(opt); if (!isMonitoring) { isMonitoring = true; - pluginManager.startMonitoring(player); + if (pluginManager == null) { + pluginManager = new PKYouboraPlayerAdapter(player, messageBus, mediaConfig, pluginConfig); + } else { + pluginManager.resetPlaybackValues(); + pluginManager.registerListeners(); + } + pluginManager.setMediaConfig(mediaConfig); + pluginManager.setPluginConfig(pluginConfig); } - if (adAnalytics && !isAdsMonitoring){ - adsManager = new YouboraAdManager(pluginManager, messageBus); - adsManager.startMonitoring(this.player); - pluginManager.setAdnalyzer(adsManager); + + npawPlugin.setOptions(pluginConfig.getYouboraOptions()); + npawPlugin.setAdapter(pluginManager); + + if (!isAdsMonitoring) { + if (adsManager == null) { + adsManager = new PKYouboraAdsAdapter(player, messageBus); + } else { + adsManager.resetAdValues(); + adsManager.registerListeners(); + } + npawPlugin.setAdsAdapter(adsManager); isAdsMonitoring = true; } } @@ -96,31 +130,33 @@ protected void onUpdateConfig(Object config) { if (adsManager != null) { adsManager.onUpdateConfig(); } - this.pluginConfig = (JsonObject) config; - Map opt = YouboraConfig.getConfig(pluginConfig, mediaConfig, player); + this.pluginConfig = parseConfig(config); // Refresh options with updated media - pluginManager.setOptions(opt); + npawPlugin.setOptions(pluginConfig.getYouboraOptions()); } @Override protected void onApplicationPaused() { log.d("YOUBORA onApplicationPaused"); - if (adsManager != null) { - adsManager.endedAdHandler(); - adsManager.resetAdValues(); - } - if (pluginManager != null) { - pluginManager.endedHandler(); - pluginManager.resetValues(); + if (npawPlugin != null) { + if (npawPlugin.getAdsAdapter() != null) { + npawPlugin.getAdsAdapter().fireStop(); + } + if (adsManager != null) { + adsManager.resetAdValues(); + } + if (npawPlugin.getAdapter() != null) { + npawPlugin.getAdapter().fireStop(); + } + if (pluginManager != null) { + pluginManager.resetValues(); + } } - } @Override protected void onApplicationResumed() { - if (pluginManager != null) { - pluginManager.playHandler(); - } + log.d("YOUBORA onApplicationResumed"); } @Override @@ -128,74 +164,41 @@ public void onDestroy() { if (isMonitoring) { stopMonitoring(); } - } - - @Override - protected void onLoad(final Player player, Object config, final MessageBus messageBus, Context context) { - log.d("onLoad"); - this.player = player; - this.pluginConfig = (JsonObject) config; - this.messageBus = messageBus; - pluginManager = new YouboraLibraryManager(new Options(), messageBus, mediaConfig, player); - loadPlugin(); - } - - private void loadPlugin(){ - log.d("loadPlugin"); - if (pluginConfig != null) { - if (pluginConfig.has("enableSmartAds") && - !pluginConfig.get("enableSmartAds").isJsonNull()) { - adAnalytics = pluginConfig.getAsJsonPrimitive("enableSmartAds").getAsBoolean(); - } - messageBus.listen(eventListener, PlayerEvent.Type.DURATION_CHANGE, PlayerEvent.Type.SOURCE_SELECTED); + if (pluginManager != null) { + pluginManager.unregisterListeners(); + pluginManager = null; + } + if (adsManager != null) { + adsManager.unregisterListeners(); + adsManager = null; } - } - PKEvent.Listener eventListener = new PKEvent.Listener() { - @Override - public void onEvent(PKEvent event) { - - PlayerEvent playerEvent = (PlayerEvent) event; - String key = ""; - Object value = null; - - switch (playerEvent.type) { - case DURATION_CHANGE: - - key = "duration"; - value = Long.valueOf(player.getDuration() / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); - break; - - case SOURCE_SELECTED: - key = "resource"; - PlayerEvent.SourceSelected sourceSelected = (PlayerEvent.SourceSelected) playerEvent; - value = sourceSelected.source.getUrl(); - break; - } - - if(key.isEmpty() ) { - return ; + private void stopMonitoring() { + log.d("stop monitoring"); + if (npawPlugin != null) { + if (isAdsMonitoring) { + if (npawPlugin.getAdsAdapter() != null) { + npawPlugin.removeAdsAdapter(); + } + isAdsMonitoring = false; } - - Map opt = YouboraConfig.updateMediaConfig(pluginConfig, key, value); - if (opt == null) { - return; + if (isMonitoring) { + if (npawPlugin.getAdapter() != null) { + npawPlugin.removeAdapter(); + } + isMonitoring = false; } - pluginManager.setOptions(opt); } - }; + } - private void stopMonitoring() { - log.d("stop monitoring"); - if (adsManager != null && isAdsMonitoring) { - adsManager.stopMonitoring(); - isAdsMonitoring = false; - } - if (isMonitoring) { - pluginManager.stopMonitoring(); - isMonitoring = false; - } + private static YouboraConfig parseConfig(Object config) { + if (config instanceof YouboraConfig) { + return ((YouboraConfig) config); + } else if (config instanceof JsonObject) { + return new Gson().fromJson(((JsonObject) config), YouboraConfig.class); + } + return null; } -} +} \ No newline at end of file diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Ads.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Ads.java new file mode 100644 index 0000000..92b2da6 --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Ads.java @@ -0,0 +1,23 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig; + +public class Ads { + + private String campaign; + private ExtraParams extraParams; + + public String getCampaign() { + return campaign; + } + + public void setCampaign(String campaign) { + this.campaign = campaign; + } + + public ExtraParams getExtraParams() { + return extraParams; + } + + public void setExtraParams(ExtraParams extraParams) { + this.extraParams = extraParams; + } +} \ No newline at end of file diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/ExtraParams.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/ExtraParams.java new file mode 100644 index 0000000..4993dda --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/ExtraParams.java @@ -0,0 +1,96 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig; + +public class ExtraParams { + + private String param1; + private String param2; + private String param3; + private String param4; + private String param5; + private String param6; + private String param7; + private String param8; + private String param9; + private String param10; + + + public String getParam1() { + return param1; + } + + public void setParam1(String param1) { + this.param1 = param1; + } + + public String getParam2() { + return param2; + } + + public void setParam2(String param2) { + this.param2 = param2; + } + + public String getParam3() { + return param3; + } + + public void setParam3(String param3) { + this.param3 = param3; + } + + public String getParam4() { + return param4; + } + + public void setParam4(String param4) { + this.param4 = param4; + } + + public String getParam5() { + return param5; + } + + public void setParam5(String param5) { + this.param5 = param5; + } + + public String getParam6() { + return param6; + } + + public void setParam6(String param6) { + this.param6 = param6; + } + + public String getParam7() { + return param7; + } + + public void setParam7(String param7) { + this.param7 = param7; + } + + public String getParam8() { + return param8; + } + + public void setParam8(String param8) { + this.param8 = param8; + } + + public String getParam9() { + return param9; + } + + public void setParam9(String param9) { + this.param9 = param9; + } + + public String getParam10() { + return param10; + } + + public void setParam10(String param10) { + this.param10 = param10; + } +} \ No newline at end of file diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Media.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Media.java new file mode 100644 index 0000000..c53a138 --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Media.java @@ -0,0 +1,76 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig; + +public class Media { + + private String resource; + private Boolean isLive; + private Boolean isDVR; + private String title; + private String title2; + private Double duration; + private String transactionCode; + + public String getResource() { + return resource; + } + + public void setResource(String resource) { + this.resource = resource; + } + + public Boolean getLive() { + return isLive; + } + + public void setLive(Boolean live) { + isLive = live; + } + + public Boolean getIsDVR() { + return isDVR; + } + + public void setIsDVR(Boolean isDVR) { + this.isDVR = isDVR; + } + + public Boolean getIsLive() { + return isLive; + } + + public void setIsLive(Boolean isLive) { + this.isLive = isLive; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getTitle2() { + return title2; + } + + public void setTitle2(String title2) { + this.title2 = title2; + } + + public Double getDuration() { + return duration; + } + + public void setDuration(Double duration) { + this.duration = duration; + } + + public String getTransactionCode() { + return transactionCode; + } + + public void setTransactionCode(String transactionCode) { + this.transactionCode = transactionCode; + } +} \ No newline at end of file diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Properties.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Properties.java new file mode 100644 index 0000000..4fb8090 --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Properties.java @@ -0,0 +1,132 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig; + +public class Properties { + + private String genre; + private String type; + private String transactionType; + private String year; + private String cast; + private String director; + private String owner; + private String parental; + private String price; + private String rating; + private String audioType; + private String audioChannels; + private String device; + private String quality; + + public String getGenre() { + return genre; + } + + public void setGenre(String genre) { + this.genre = genre; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getTransactionType() { + return transactionType; + } + + public void setTransactionType(String transactionType) { + this.transactionType = transactionType; + } + + public String getYear() { + return year; + } + + public void setYear(String year) { + this.year = year; + } + + public String getCast() { + return cast; + } + + public void setCast(String cast) { + this.cast = cast; + } + + public String getDirector() { + return director; + } + + public void setDirector(String director) { + this.director = director; + } + + public String getOwner() { + return owner; + } + + public void setOwner(String owner) { + this.owner = owner; + } + + public String getParental() { + return parental; + } + + public void setParental(String parental) { + this.parental = parental; + } + + public String getPrice() { + return price; + } + + public void setPrice(String price) { + this.price = price; + } + + public String getRating() { + return rating; + } + + public void setRating(String rating) { + this.rating = rating; + } + + public String getAudioType() { + return audioType; + } + + public void setAudioType(String audioType) { + this.audioType = audioType; + } + + public String getAudioChannels() { + return audioChannels; + } + + public void setAudioChannels(String audioChannels) { + this.audioChannels = audioChannels; + } + + public String getDevice() { + return device; + } + + public void setDevice(String device) { + this.device = device; + } + + public String getQuality() { + return quality; + } + + public void setQuality(String quality) { + this.quality = quality; + } + +} \ No newline at end of file diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java new file mode 100644 index 0000000..fc4e59b --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -0,0 +1,449 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig; + +import android.os.Bundle; +import android.support.annotation.NonNull; +import android.text.TextUtils; + +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; +import com.npaw.youbora.lib6.plugin.Options; + +public class YouboraConfig { + + private String accountCode; + + private String username; + + private String userType; // any string - free / paid etc. + + private String houseHoldId; // which device is used to play + + private boolean obfuscateIP; // ip in dahsbord will be encrytpted + + private boolean httpSecure = true; // youbora events will be sent via https + + private Media media; + + private Ads ads; + + private Properties properties; + + private ExtraParams extraParams; + + public String getAccountCode() { + return accountCode; + } + + public void setAccountCode(String accountCode) { + this.accountCode = accountCode; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getUserType() { + return userType; + } + + public void setUserType(String userType) { + this.userType = userType; + } + + public boolean isObfuscateIP() { + return obfuscateIP; + } + + public boolean getHttpSecure() { + return httpSecure; + } + + public void setHttpSecure(boolean httpSecure) { + this.httpSecure = httpSecure; + } + + public String getHouseHoldId() { + return houseHoldId; + } + + public void setHouseHoldId(String houseHoldId) { + this.houseHoldId = houseHoldId; + } + + public void setObfuscateIP(boolean obfuscateIP) { + this.obfuscateIP = obfuscateIP; + } + + public Media getMedia() { + return media; + } + + public void setMedia(Media media) { + this.media = media; + } + + public Ads getAds() { + return ads; + } + + public void setAds(Ads ads) { + this.ads = ads; + } + + public Properties getProperties() { + return properties; + } + + public void setProperties(Properties properties) { + this.properties = properties; + } + + public ExtraParams getExtraParams() { + return extraParams; + } + + public void setExtraParams(ExtraParams extraParams) { + this.extraParams = extraParams; + } + + + public Options getYouboraOptions() { + Options youboraLocalConfig = new Options(); + + youboraLocalConfig.setAccountCode(accountCode); + youboraLocalConfig.setUsername(username); + youboraLocalConfig.setUserType(userType); + youboraLocalConfig.setNetworkObfuscateIp(obfuscateIP); + youboraLocalConfig.setHttpSecure(httpSecure); + + youboraLocalConfig.setParseHls(false); + youboraLocalConfig.setParseCdnNode(false); + + + youboraLocalConfig.setDeviceCode(null); //TODO // List of device codes http://mapi.youbora.com:8081/devices + youboraLocalConfig.setContentCdn(null); + + + if (media != null) { + youboraLocalConfig.setContentIsLive(media.getIsLive()); + youboraLocalConfig.setContentIsLiveNoSeek((media.getIsDVR() != null) ? !media.getIsDVR() : null); + youboraLocalConfig.setContentDuration(media.getDuration()); + youboraLocalConfig.setContentTitle(media.getTitle()); + youboraLocalConfig.setContentTitle2(media.getTitle2()); + youboraLocalConfig.setContentTransactionCode(media.getTransactionCode()); + } + + + youboraLocalConfig.setAdResource(null); + if (ads != null) { + youboraLocalConfig.setAdCampaign(ads.getCampaign()); + } + youboraLocalConfig.setAdTitle(""); + + + + youboraLocalConfig.setContentMetadata(getPropertiesBundle()); + + + if (ads != null && ads.getExtraParams() != null) { + youboraLocalConfig.setAdExtraparam1(ads.getExtraParams().getParam1()); + youboraLocalConfig.setAdExtraparam2(ads.getExtraParams().getParam2()); + youboraLocalConfig.setAdExtraparam3(ads.getExtraParams().getParam3()); + youboraLocalConfig.setAdExtraparam4(ads.getExtraParams().getParam4()); + youboraLocalConfig.setAdExtraparam5(ads.getExtraParams().getParam5()); + youboraLocalConfig.setAdExtraparam6(ads.getExtraParams().getParam6()); + youboraLocalConfig.setAdExtraparam7(ads.getExtraParams().getParam7()); + youboraLocalConfig.setAdExtraparam8(ads.getExtraParams().getParam8()); + youboraLocalConfig.setAdExtraparam9(ads.getExtraParams().getParam9()); + youboraLocalConfig.setAdExtraparam10(ads.getExtraParams().getParam10()); + } + + if (extraParams != null) { + youboraLocalConfig.setExtraparam1(extraParams.getParam1()); + youboraLocalConfig.setExtraparam2(extraParams.getParam2()); + youboraLocalConfig.setExtraparam3(extraParams.getParam3()); + youboraLocalConfig.setExtraparam4(extraParams.getParam4()); + youboraLocalConfig.setExtraparam5(extraParams.getParam5()); + youboraLocalConfig.setExtraparam6(extraParams.getParam6()); + youboraLocalConfig.setExtraparam7(extraParams.getParam7()); + youboraLocalConfig.setExtraparam8(extraParams.getParam8()); + youboraLocalConfig.setExtraparam9(extraParams.getParam9()); + youboraLocalConfig.setExtraparam10(extraParams.getParam10()); + } + return youboraLocalConfig; + } + + + private Bundle getPropertiesBundle() { + if (getProperties() == null) { + return new Bundle(); + } + + Properties prop = getProperties(); + Bundle propertiesBunble = new Bundle(); + propertiesBunble.putString("genre", (prop.getGenre() != null) ? prop.getGenre() : ""); + propertiesBunble.putString("type", (prop.getType() != null) ? prop.getType() : ""); + propertiesBunble.putString("transaction_type", (prop.getTransactionType() != null) ? prop.getTransactionType() : ""); + propertiesBunble.putString("year", (prop.getYear() != null) ? prop.getYear() : ""); + propertiesBunble.putString("cast", (prop.getCast() != null) ? prop.getCast() : ""); + propertiesBunble.putString("director", (prop.getDirector() != null) ? prop.getDirector() : ""); + propertiesBunble.putString("owner", (prop.getOwner() != null) ? prop.getOwner() : ""); + propertiesBunble.putString("parental", (prop.getParental() != null) ? prop.getParental() : ""); + propertiesBunble.putString("price", (prop.getPrice() != null) ? prop.getPrice() : ""); + propertiesBunble.putString("rating", (prop.getRating() != null) ? prop.getRating() : ""); + propertiesBunble.putString("audioType", (prop.getAudioType() != null) ? prop.getAudioType() : ""); + propertiesBunble.putString("audioChannels", (prop.getAudioChannels() != null) ? prop.getAudioChannels() : ""); + propertiesBunble.putString("device", (prop.getDevice() != null) ? prop.getDevice() : ""); + propertiesBunble.putString("quality", (prop.getQuality() != null) ? prop.getQuality() : ""); + return propertiesBunble; + } + + public JsonObject toJson() { + JsonPrimitive accountCode = new JsonPrimitive(getAccountCode() != null ? getAccountCode() : ""); + JsonPrimitive username = new JsonPrimitive(getUsername() != null ? getUsername() : ""); + JsonPrimitive userType = new JsonPrimitive(getUserType() != null ? getUserType() : ""); + JsonPrimitive houseHoldId = new JsonPrimitive(getHouseHoldId() != null ? getHouseHoldId() : ""); + JsonPrimitive isObfuscateIP = new JsonPrimitive(isObfuscateIP() ? true : false); + JsonPrimitive httpSecure = new JsonPrimitive(getHttpSecure() ? true : false); + + JsonObject mediaEntry = getMediaJsonObject(); + JsonObject adsEntry = new JsonObject(); + adsEntry.addProperty("campaign", (getAds() != null && getAds().getCampaign() != null) ? getAds().getCampaign() : ""); + JsonObject propertiesEntry = getPropertiesJsonObject(); + JsonObject extraParamEntry = getExtraParamJsonObject(); + JsonObject youboraConfig = getYouboraConfigJsonObject(accountCode, username, userType, houseHoldId, isObfuscateIP, httpSecure, mediaEntry, adsEntry, propertiesEntry, extraParamEntry); + return youboraConfig; + } + + @NonNull + private JsonObject getMediaJsonObject() { + JsonObject mediaEntry = new JsonObject(); + if (getMedia() == null) { + return mediaEntry; + } + + Media media = getMedia(); + mediaEntry.addProperty("isLive", media.getIsLive() != null ? media.getIsLive() : Boolean.FALSE); + mediaEntry.addProperty("title", media.getTitle() != null ? media.getTitle() : ""); + if (media.getDuration() != null) { + mediaEntry.addProperty("duration", media.getDuration()); + } + return mediaEntry; + } + + @NonNull + private JsonObject getYouboraConfigJsonObject(JsonPrimitive accountCode, JsonPrimitive username, JsonPrimitive userType, JsonPrimitive houseHoldId, JsonPrimitive obfuscateIP, JsonPrimitive httpSecure, + JsonObject mediaEntry, JsonObject adsEntry, JsonObject propertiesEntry, JsonObject extraParamEntry) { + JsonObject youboraConfig = new JsonObject(); + youboraConfig.add("accountCode", accountCode); + youboraConfig.add("username", username); + youboraConfig.add("userType", userType); + youboraConfig.add("houseHoldId", houseHoldId); + youboraConfig.add("obfuscateIP", obfuscateIP); + youboraConfig.add("httpSecure", httpSecure); + + youboraConfig.add("media", mediaEntry); + youboraConfig.add("ads", adsEntry); + youboraConfig.add("properties", propertiesEntry); + youboraConfig.add("extraParams", extraParamEntry); + return youboraConfig; + } + + @NonNull + private JsonObject getPropertiesJsonObject() { + JsonObject propertiesEntry = new JsonObject(); + if (getProperties() == null) { + return propertiesEntry; + } + + Properties prop = getProperties(); + propertiesEntry.addProperty("genre", (prop.getGenre() != null) ? prop.getGenre() : ""); + propertiesEntry.addProperty("type", (prop.getType() != null) ? prop.getType() : ""); + propertiesEntry.addProperty("transaction_type", (prop.getTransactionType() != null) ? prop.getTransactionType() : ""); + propertiesEntry.addProperty("year", (prop.getYear() != null) ? prop.getYear() : ""); + propertiesEntry.addProperty("cast", (prop.getCast() != null) ? prop.getCast() : ""); + propertiesEntry.addProperty("director", (prop.getDirector() != null) ? prop.getDirector() : ""); + propertiesEntry.addProperty("owner", (prop.getOwner() != null) ? prop.getOwner() : ""); + propertiesEntry.addProperty("parental", (prop.getParental() != null) ? prop.getParental() : ""); + propertiesEntry.addProperty("price", (prop.getPrice() != null) ? prop.getPrice() : ""); + propertiesEntry.addProperty("rating", (prop.getRating() != null) ? prop.getRating() : ""); + propertiesEntry.addProperty("audioType", (prop.getAudioType() != null) ? prop.getAudioType() : ""); + propertiesEntry.addProperty("audioChannels", (prop.getAudioChannels() != null) ? prop.getAudioChannels() : ""); + propertiesEntry.addProperty("device", (prop.getDevice() != null) ? prop.getDevice() : ""); + propertiesEntry.addProperty("quality", (prop.getQuality() != null) ? prop.getQuality() : ""); + return propertiesEntry; + } + + @NonNull + private JsonObject getExtraParamJsonObject() { + JsonObject extraParamEntry = new JsonObject(); + if (getExtraParams() == null) { + return extraParamEntry; + } + ExtraParams extraParams = getExtraParams(); + if (extraParams.getParam1() != null) { + extraParamEntry.addProperty("param1", extraParams.getParam1()); + } + if (extraParams.getParam2() != null) { + extraParamEntry.addProperty("param2", extraParams.getParam2()); + } + if (extraParams.getParam3() != null) { + extraParamEntry.addProperty("param3", extraParams.getParam3()); + } + if (extraParams.getParam4() != null) { + extraParamEntry.addProperty("param4", extraParams.getParam4()); + } + if (extraParams.getParam5() != null) { + extraParamEntry.addProperty("param5", extraParams.getParam5()); + } + if (extraParams.getParam6() != null) { + extraParamEntry.addProperty("param6", extraParams.getParam6()); + } + if (extraParams.getParam7() != null) { + extraParamEntry.addProperty("param7", extraParams.getParam7()); + } + if (extraParams.getParam8() != null) { + extraParamEntry.addProperty("param8", extraParams.getParam8()); + } + if (extraParams.getParam9() != null) { + extraParamEntry.addProperty("param9", extraParams.getParam9()); + } + if (extraParams.getParam10() != null) { + extraParamEntry.addProperty("param10", extraParams.getParam10()); + } + return extraParamEntry; + } + + public void merge(YouboraConfig youboraConfigUiConf) { + if (youboraConfigUiConf == null) { + return; + } + + if (TextUtils.isEmpty(accountCode)) { + accountCode = youboraConfigUiConf.getAccountCode(); + } + if (TextUtils.isEmpty(username)) { + username = youboraConfigUiConf.getUsername(); + } + + if (media != null) { + if (youboraConfigUiConf.getMedia() != null) { + if (media.getIsLive() == null) { + media.setIsLive(youboraConfigUiConf.getMedia().getIsLive()); + } + if (media.getTitle() == null) { + media.setTitle(youboraConfigUiConf.getMedia().getTitle()); + } + if (media.getDuration() == null) { + media.setDuration(youboraConfigUiConf.getMedia().getDuration()); + } + } + } else { + media = youboraConfigUiConf.getMedia(); + } + + if (ads != null) { + if (ads.getCampaign() == null) { + if (youboraConfigUiConf.getAds() != null) { + ads.setCampaign(youboraConfigUiConf.getAds().getCampaign()); + } + } + } else { + ads = youboraConfigUiConf.getAds(); + } + + if (properties != null) { + if (youboraConfigUiConf.getProperties() != null) { + Properties propUiConf = youboraConfigUiConf.getProperties(); + if (TextUtils.isEmpty((properties.getGenre()))) { + properties.setGenre(propUiConf.getGenre()); + } + if (TextUtils.isEmpty((properties.getType()))) { + properties.setType(propUiConf.getType()); + } + if (TextUtils.isEmpty((properties.getTransactionType()))) { + properties.setTransactionType(propUiConf.getTransactionType()); + } + if (TextUtils.isEmpty((properties.getAudioChannels()))) { + properties.setAudioChannels(propUiConf.getAudioChannels()); + } + if (TextUtils.isEmpty((properties.getAudioType()))) { + properties.setAudioType(propUiConf.getAudioType()); + } + if (TextUtils.isEmpty((properties.getCast()))) { + properties.setCast(propUiConf.getCast()); + } + if (TextUtils.isEmpty((properties.getDevice()))) { + properties.setDevice(propUiConf.getDevice()); + } + if (TextUtils.isEmpty((properties.getDirector()))) { + properties.setDirector(propUiConf.getDirector()); + } + if (TextUtils.isEmpty((properties.getOwner()))) { + properties.setOwner(propUiConf.getOwner()); + } + if (TextUtils.isEmpty((properties.getParental()))) { + properties.setParental(propUiConf.getParental()); + } + if (TextUtils.isEmpty((properties.getYear()))) { + properties.setYear(propUiConf.getYear()); + } + if (TextUtils.isEmpty((properties.getQuality()))) { + properties.setQuality(propUiConf.getQuality()); + } + if (TextUtils.isEmpty((properties.getRating()))) { + properties.setRating(propUiConf.getRating()); + } + + } + } else { + properties = youboraConfigUiConf.getProperties(); + } + + if (extraParams != null) { + if (youboraConfigUiConf.getExtraParams() != null) { + ExtraParams extraParamsUiConf = youboraConfigUiConf.getExtraParams(); + if (TextUtils.isEmpty((extraParams.getParam1()))) { + extraParams.setParam1(extraParamsUiConf.getParam1()); + } + if (TextUtils.isEmpty((extraParams.getParam1()))) { + extraParams.setParam1(extraParamsUiConf.getParam1()); + } + if (TextUtils.isEmpty((extraParams.getParam2()))) { + extraParams.setParam2(extraParamsUiConf.getParam2()); + } + if (TextUtils.isEmpty((extraParams.getParam3()))) { + extraParams.setParam3(extraParamsUiConf.getParam3()); + } + if (TextUtils.isEmpty((extraParams.getParam4()))) { + extraParams.setParam4(extraParamsUiConf.getParam4()); + } + if (TextUtils.isEmpty((extraParams.getParam5()))) { + extraParams.setParam5(extraParamsUiConf.getParam5()); + } + if (TextUtils.isEmpty((extraParams.getParam6()))) { + extraParams.setParam6(extraParamsUiConf.getParam6()); + } + if (TextUtils.isEmpty((extraParams.getParam7()))) { + extraParams.setParam7(extraParamsUiConf.getParam7()); + } + if (TextUtils.isEmpty((extraParams.getParam8()))) { + extraParams.setParam8(extraParamsUiConf.getParam8()); + } + if (TextUtils.isEmpty((extraParams.getParam1()))) { + extraParams.setParam9(extraParamsUiConf.getParam9()); + } + if (TextUtils.isEmpty((extraParams.getParam10()))) { + extraParams.setParam10(extraParamsUiConf.getParam10()); + } + } + } else { + extraParams = youboraConfigUiConf.getExtraParams(); + } + + } +} \ No newline at end of file From 843d9c51d7988dc60930997090ae381686a21945 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Tue, 22 Jan 2019 16:33:42 +0200 Subject: [PATCH 040/143] consider DVRLive as live (#19) --- .../playkit/plugins/youbora/PKYouboraPlayerAdapter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index 302a580..694fc37 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -370,8 +370,8 @@ public String getTitle() { public Boolean getIsLive() { Boolean isLive = Boolean.FALSE; - if (mediaConfig != null && (player == null || (player!= null && player.getDuration() <= 0))) { - isLive = mediaConfig.getMediaEntry().getMediaType() == PKMediaEntry.MediaEntryType.Live; + if (mediaConfig != null && mediaConfig.getMediaEntry() != null && (player == null || player.getDuration() <= 0)) { + isLive = mediaConfig.getMediaEntry().getMediaType() == PKMediaEntry.MediaEntryType.Live || mediaConfig.getMediaEntry().getMediaType() == PKMediaEntry.MediaEntryType.DvrLive; } else if (player != null) { isLive = player.isLive(); } From d047f1049f9afd0f17fa59a63072ccbbca607f4a Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Thu, 31 Jan 2019 23:07:29 +0530 Subject: [PATCH 041/143] - Dropped frames to youbora (#20) * - Dropped frames to youbora * report total dropped frames as discussed with NPAW --- .../plugins/youbora/PKYouboraPlayerAdapter.java | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index 694fc37..38c04d2 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -58,6 +58,7 @@ class PKYouboraPlayerAdapter extends PlayerAdapter { private String lastReportedRendition; private Double lastReportedMediaPosition; private Double lastReportedMediaDuration; + private Long droppedFrames = 0L; private String houseHoldId; private boolean isAdPlaying; private AdCuePoints adCuePoints; @@ -182,6 +183,10 @@ private void addListeners() { //log.d("PLAYHEAD_UPDATED new duration = " + lastReportedMediaPosition); }); + messageBus.addListener(this, PlayerEvent.videoFramesDropped, event -> { + droppedFrames = event.totalDroppedVideoFrames; + }); + messageBus.addListener(this, PlayerEvent.stateChanged, event -> { printReceivedPlayerEvent(event); onStateChangedEvent(event); @@ -356,7 +361,13 @@ public Double getDuration() { return (lastReportedMediaDuration != null && lastReportedMediaDuration >= 0) ? lastReportedMediaDuration : 0; } -// public Double getPlayrate() { + @Override + public Integer getDroppedFrames() { + //log.d("getDroppedFrames " + droppedFrames.intValue()); + return droppedFrames.intValue(); + } + + // public Double getPlayrate() { // return lastPlayrate // } @@ -411,6 +422,7 @@ public void resetValues() { public void resetPlaybackValues() { lastReportedMediaDuration = super.getDuration(); lastReportedMediaPosition = super.getPlayhead(); + droppedFrames = 0L; lastReportedResource = null; adCuePoints = null; resetValues(); From 0e6ce8263bb467d91a67c5f3660dba17eb3ca8c2 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Thu, 28 Feb 2019 13:47:41 +0200 Subject: [PATCH 042/143] FEM-2105 IMA DAI Support (#21) * DAI support + cleanup --- .../plugins/youbora/PKYouboraAdsAdapter.java | 41 ++++++++++++++----- .../youbora/PKYouboraPlayerAdapter.java | 36 ++++++++++++++-- 2 files changed, 62 insertions(+), 15 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java index e6c7b0b..fda1103 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java @@ -19,7 +19,10 @@ import com.kaltura.playkit.PKLog; import com.kaltura.playkit.PlayKitManager; import com.kaltura.playkit.Player; +import com.kaltura.playkit.ads.AdController; import com.kaltura.playkit.ads.PKAdErrorType; + +import com.kaltura.playkit.ads.PKAdPluginType; import com.kaltura.playkit.plugins.ads.AdEvent; import com.kaltura.playkit.plugins.ads.AdInfo; import com.kaltura.playkit.utils.Consts; @@ -42,6 +45,7 @@ class PKYouboraAdsAdapter extends PlayerAdapter { private Double lastReportedAdPlayhead; private Double lastReportedAdDuration; private long lastReportedAdBitrate; + private PKAdPluginType lastReportedAdPluginType; PKYouboraAdsAdapter(Player player, MessageBus messageBus) { super(player); @@ -136,7 +140,7 @@ public AdPosition getPosition() { default: break; } - log.d("adPosition = " + adPosition); + //log.d("adPosition = " + adPosition); return adPosition; } @@ -147,6 +151,10 @@ public String getResource() { } private void populateAdValues() { + if (currentAdInfo == null) { + return; + } + lastReportedAdDuration = Long.valueOf(currentAdInfo.getAdDuration() / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); lastReportedAdTitle = currentAdInfo.getAdTitle(); lastReportedAdPlayhead = Long.valueOf(currentAdInfo.getAdPlayHead() / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); @@ -164,9 +172,11 @@ void resetAdValues() { lastReportedAdDuration = super.getDuration(); lastReportedAdTitle = super.getTitle(); lastReportedAdPlayhead = super.getPlayhead(); + lastReportedAdPluginType = null; } public void onUpdateConfig() { + unregisterListeners(); resetAdValues(); lastReportedAdBitrate = -1L; lastReportedAdResource = super.getResource(); @@ -197,6 +207,9 @@ private void addListeners() { if (isFirstPlay) { isFirstPlay = false; getPlugin().getAdapter().fireStart(); + if (PKAdPluginType.server.equals(getLastReportedAdPluginType())) { + getPlugin().getAdapter().fireJoin(); + } } currentAdInfo = event.adInfo; populateAdValues(); @@ -240,16 +253,6 @@ private void addListeners() { return; } currentAdInfo = event.adInfo; -// if (isFirstPlay) { -// isFirstPlay = false; -// if (getPlugin().getAdapter() != null && !getPlugin().getAdapter().getFlags().isStarted()) { -// getPlugin().getAdapter().fireStart(); -// } -// fireStart(); -// fireJoin(); -// populateAdValues(); -// } - lastReportedAdPlayhead = Long.valueOf(currentAdInfo.getAdPlayHead() / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); lastReportedAdBitrate = currentAdInfo.getMediaBitrate(); log.d("lastReportedAdPlayhead: " + lastReportedAdPlayhead); @@ -362,6 +365,22 @@ private void addListeners() { }); } + private PKAdPluginType getLastReportedAdPluginType() { + if (lastReportedAdPluginType != null) { + return lastReportedAdPluginType; + } + + if (player != null) { + AdController adController = player.getController(AdController.class); + if (adController != null && !adController.isAdError()) { + lastReportedAdPluginType = adController.getAdPluginType(); + } else { + lastReportedAdPluginType = PKAdPluginType.client; + } + } + return lastReportedAdPluginType; + } + private void handleAdError(PKError error) { PKAdErrorType adErrorType = (PKAdErrorType) error.errorType; diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index 38c04d2..9bf8211 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -25,6 +25,8 @@ import com.kaltura.playkit.PlaybackInfo; import com.kaltura.playkit.Player; import com.kaltura.playkit.PlayerEvent; +import com.kaltura.playkit.ads.AdController; +import com.kaltura.playkit.ads.PKAdPluginType; import com.kaltura.playkit.plugins.ads.AdCuePoints; import com.kaltura.playkit.plugins.ads.AdEvent; import com.kaltura.playkit.plugins.youbora.pluginconfig.YouboraConfig; @@ -58,6 +60,7 @@ class PKYouboraPlayerAdapter extends PlayerAdapter { private String lastReportedRendition; private Double lastReportedMediaPosition; private Double lastReportedMediaDuration; + private PKAdPluginType lastReportedAdPluginType; private Long droppedFrames = 0L; private String houseHoldId; private boolean isAdPlaying; @@ -71,7 +74,6 @@ class PKYouboraPlayerAdapter extends PlayerAdapter { updateDurationFromMediaConfig(mediaConfig); this.houseHoldId = pluginConfig.getHouseHoldId(); registerListeners(); - } private void updateDurationFromMediaConfig(PKMediaConfig mediaConfig) { @@ -173,14 +175,14 @@ private void addListeners() { messageBus.addListener(this, PlayerEvent.durationChanged, event -> { printReceivedPlayerEvent(event); lastReportedMediaDuration = Math.floor((double) event.duration / Consts.MILLISECONDS_MULTIPLIER); - log.d("DURATION_CHANGE lastReportedMediaDuration = " + lastReportedMediaDuration); + //log.d("DURATION_CHANGE lastReportedMediaDuration = " + lastReportedMediaDuration); sendReportEvent(event); }); messageBus.addListener(this, PlayerEvent.playheadUpdated, event -> { lastReportedMediaPosition = Math.floor((double) event.position / Consts.MILLISECONDS_MULTIPLIER); lastReportedMediaDuration = Math.floor((double) event.duration / Consts.MILLISECONDS_MULTIPLIER); - //log.d("PLAYHEAD_UPDATED new duration = " + lastReportedMediaPosition); + //log.d("PLAYHEAD_UPDATED new position/duration = " + lastReportedMediaPosition + "/" + lastReportedMediaDuration); }); messageBus.addListener(this, PlayerEvent.videoFramesDropped, event -> { @@ -194,11 +196,19 @@ private void addListeners() { messageBus.addListener(this, PlayerEvent.ended, event -> { printReceivedPlayerEvent(event); - if (!isFirstPlay && ((adCuePoints == null) || !adCuePoints.hasPostRoll())) { + if (PKAdPluginType.server.equals(getLastReportedAdPluginType())) { + getPlugin().getAdapter().fireStop(); fireStop(); isFirstPlay = true; adCuePoints = null; + } else { + if (!isFirstPlay && ((adCuePoints == null) || !adCuePoints.hasPostRoll())) { + fireStop(); + isFirstPlay = true; + adCuePoints = null; + } } + sendReportEvent(event); }); @@ -396,6 +406,22 @@ private void sendReportEvent(PKEvent event) { } } + private PKAdPluginType getLastReportedAdPluginType() { + if (lastReportedAdPluginType != null) { + return lastReportedAdPluginType; + } + + if (player != null) { + AdController adController = player.getController(AdController.class); + if (adController != null && !adController.isAdError()) { + lastReportedAdPluginType = adController.getAdPluginType(); + } else { + lastReportedAdPluginType = PKAdPluginType.client; + } + } + return lastReportedAdPluginType; + } + public String generateRendition(double bitrate, int width, int height) { if ((width <= 0 || height <= 0) && bitrate <= 0) { @@ -407,6 +433,7 @@ public String generateRendition(double bitrate, int width, int height) { public void onUpdateConfig() { log.d("onUpdateConfig"); + unregisterListeners(); resetValues(); } @@ -414,6 +441,7 @@ public void resetValues() { lastReportedBitrate = super.getBitrate(); lastReportedRendition = super.getRendition(); lastReportedThroughput = super.getThroughput(); + lastReportedAdPluginType = null; mediaConfig = null; houseHoldId = null; isFirstPlay = true; From 66475be60f6c4564b491ddf31290ed242871287a Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Thu, 14 Mar 2019 11:22:56 +0200 Subject: [PATCH 043/143] FEM-2442 Add support in Device Specific data on the youbora config Json (#22) * see Device Json: private JsonObject getYouboraJsonObject(boolean isLive, String title) { JsonObject pluginEntry = new JsonObject(); pluginEntry.addProperty("accountCode", "kalturatest"); pluginEntry.addProperty("username", "a@a.com"); pluginEntry.addProperty("haltOnError", true); pluginEntry.addProperty("enableAnalytics", true); pluginEntry.addProperty("enableSmartAds", true); //Device json. JsonObject deviceJson = new JsonObject(); deviceJson.addProperty("deviceCode", "AndroidTV"); deviceJson.addProperty("brand", "Xiomi"); deviceJson.addProperty("model", "Mi3"); deviceJson.addProperty("type", "tv"); deviceJson.addProperty("osName", "Android/Oreo"); deviceJson.addProperty("osVersion", "8.1"); //Media entry json. JsonObject mediaEntryJson = new JsonObject(); mediaEntryJson.addProperty("isLive", isLive); mediaEntryJson.addProperty("title", title); //Youbora ads configuration json. JsonObject adsJson = new JsonObject(); adsJson.addProperty("adsExpected", true); adsJson.addProperty("campaign", "zzz"); //Configure custom properties here: JsonObject propertiesJson = new JsonObject(); propertiesJson.addProperty("genre", ""); propertiesJson.addProperty("type", ""); propertiesJson.addProperty("transaction_type", ""); propertiesJson.addProperty("year", ""); propertiesJson.addProperty("cast", ""); propertiesJson.addProperty("director", ""); propertiesJson.addProperty("owner", ""); propertiesJson.addProperty("parental", ""); propertiesJson.addProperty("price", ""); propertiesJson.addProperty("rating", ""); propertiesJson.addProperty("audioType", ""); propertiesJson.addProperty("audioChannels", ""); propertiesJson.addProperty("device", ""); propertiesJson.addProperty("quality", ""); //You can add some extra params here: JsonObject extraParamJson = new JsonObject(); extraParamJson.addProperty("param1", "param1"); extraParamJson.addProperty("param2", "param2"); //Add all the json objects created before to the pluginEntry json. pluginEntry.add("device", deviceJson); pluginEntry.add("media", mediaEntryJson); pluginEntry.add("ads", adsJson); pluginEntry.add("properties", propertiesJson); pluginEntry.add("extraParams", extraParamJson); return pluginEntry; } * add null check before setting device code * update devices json * add comment * Update Device.java --- .../plugins/youbora/pluginconfig/Device.java | 543 ++++++++++++++++++ .../youbora/pluginconfig/YouboraConfig.java | 82 ++- 2 files changed, 619 insertions(+), 6 deletions(-) create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.java diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.java new file mode 100644 index 0000000..36b856e --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.java @@ -0,0 +1,543 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig; + +public class Device { + +//If device info config is not given Youbora will add this info according to their internal logic so actually this is optional configuration + + +//// If you want generic information +//youboraOptions.setDeviceCode("xbox360"); // Device will be detected as Xbox 360 +// +//// Or in case you want full customised information of the device: +// +//youboraOptions.setDeviceModel("s8"); +//youboraOptions.setDeviceBrand("samsung"); +//youboraOptions.setDeviceType("smartphone"); +//youboraOptions.setDeviceOsName("android"); +//youboraOptions.setDeviceOsVersion("8.1"); + + private String deviceCode; + private String brand; + private String model; + private String type; + private String osName; + private String osVersion; + + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(String deviceCode) { + this.deviceCode = deviceCode; + } + + public String getBrand() { + return brand; + } + + public void setBrand(String brand) { + this.brand = brand; + } + + public String getModel() { + return model; + } + + public void setModel(String model) { + this.model = model; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getOsName() { + return osName; + } + + public void setOsName(String osName) { + this.osName = osName; + } + + public String getOsVersion() { + return osVersion; + } + + public void setOsVersion(String osVersion) { + this.osVersion = osVersion; + } +} + + + +//[ +// { +// id: 40, +// name: Roku 3, +// code: Roku3 +// }, +// { +// id: 22, +// name: BlackBerry PlayBook, +// code: BlackBerryPlayBook +// }, +// { +// id: 67, +// name: OperaTV, +// code: OperaTV +// }, +// { +// id: 49, +// name: Android TV, +// code: AndroidTV +// }, +// { +// id: 31, +// name: Sony Bluray, +// code: SonyBluray +// }, +// { +// id: 12, +// name: Xbox360, +// code: Xbox360 +// }, +// { +// id: 20, +// name: Nintendo Wii U, +// code: NintendoWiiU +// }, +// { +// id: 75, +// name: Roku 2, +// code: Roku2 +// }, +// { +// id: 6, +// name: Samsung, +// code: Samsung +// }, +// { +// id: 27, +// name: Chrome OS, +// code: ChromeOS +// }, +// { +// id: 55, +// name: STB, +// code: STB +// }, +// { +// id: 89, +// name: HbbTV, +// code: HbbTV +// }, +// { +// id: 68, +// name: 2400SK, +// code: 2400SK +// }, +// { +// id: 62, +// name: STB Supercanal / ARG, +// code: STBSupercanal_ARG +// }, +// { +// id: 83, +// name: Sagemcom, +// code: Sagemcom +// }, +// { +// id: 34, +// name: Roku, +// code: Roku +// }, +// { +// id: 48, +// name: iOS, +// code: iOS +// }, +// { +// id: 19, +// name: BlackBerry, +// code: BlackBerry +// }, +// { +// id: 41, +// name: Roku Stick, +// code: RokuStick +// }, +// { +// id: 13, +// name: Playstation, +// code: Playstation +// }, +// { +// id: 5, +// name: Vodafone STB, +// code: VodafoneSTB +// }, +// { +// id: 28, +// name: FreeBSD, +// code: FreeBSD +// }, +// { +// id: 69, +// name: 4200SK, +// code: 4200SK +// }, +// { +// id: 33, +// name: Chromecast, +// code: Chromecast +// }, +// { +// id: 18, +// name: WuakiTv, +// code: WuakiTv +// }, +// { +// id: 88, +// name: CACTUS, +// code: CACTUS +// }, +// { +// id: 61, +// name: STB Montecable / URU, +// code: STBMontecarlo_URU +// }, +// { +// id: 74, +// name: Roku 1, +// code: Roku1 +// }, +// { +// id: 42, +// name: Hisense, +// code: Hisense +// }, +// { +// id: 47, +// name: Arris STB, +// code: ArrisSTB +// }, +// { +// id: 25, +// name: Xbox One, +// code: XboxOne +// }, +// { +// id: 56, +// name: STB IZZI / MEX, +// code: STBIZZI_MEX +// }, +// { +// id: 84, +// name: Vestel, +// code: Vestel +// }, +// { +// id: 70, +// name: 4201SK, +// code: 4201SK +// }, +// { +// id: 91, +// name: Netrange, +// code: Netrange +// }, +// { +// id: 7, +// name: Philips, +// code: Philips +// }, +// { +// id: 81, +// name: Telecable STB, +// code: TelecableSTB +// }, +// { +// id: 46, +// name: Apple TV, +// code: AppleTV +// }, +// { +// id: 73, +// name: Roku XD, +// code: RokuXD +// }, +// { +// id: 53, +// name: Android tablet, +// code: AndroidTablet +// }, +// { +// id: 90, +// name: Foxxum, +// code: Foxxum +// }, +// { +// id: 36, +// name: Nokia, +// code: Nokia +// }, +// { +// id: 26, +// name: Playstation 2, +// code: Playstation2 +// }, +// { +// id: 45, +// name: Roku 4, +// code: Roku4 +// }, +// { +// id: 8, +// name: LG, +// code: LG +// }, +// { +// id: 35, +// name: SunOS, +// code: SunOS +// }, +// { +// id: 72, +// name: Roku SD, +// code: RokuSD +// }, +// { +// id: 63, +// name: STB Telefonica / PER, +// code: STBTelefonica_PER +// }, +// { +// id: 54, +// name: Android phone, +// code: AndroidPhone +// }, +// { +// id: 82, +// name: Tivo STB, +// code: Tivo_STB +// }, +// { +// id: 17, +// name: Unknown, +// code: Unknown +// }, +// { +// id: 2, +// name: PC( Windows ), +// code: PCWindows +// }, +// { +// id: 51, +// name: FreeSat, +// code: FreeSat +// }, +// { +// id: 37, +// name: VF_STB, +// code: VF_STB +// }, +// { +// id: 58, +// name: STB Telecentro / ARG, +// code: STBTelecentro_ARG +// }, +// { +// id: 9, +// name: iPad, +// code: iPad +// }, +// { +// id: 86, +// name: Lebara Play Coship STB, +// code: LebaraPlayCoshipSTB +// }, +// { +// id: 44, +// name: Samsung - Tizen, +// code: SamsungTizen +// }, +// { +// id: 92, +// name: LYF, +// code: LYF +// }, +// { +// id: 64, +// name: PC (Windows) UWP, +// code: PCWindowsUWP +// }, +// { +// id: 16, +// name: Windows Phone, +// code: WindowsPhone +// }, +// { +// id: 71, +// name: 4500SK, +// code: 4500SK +// }, +// { +// id: 10, +// name: iPhone, +// code: iPhone +// }, +// { +// id: 52, +// name: Lebara STB, +// code: LebaraSTB +// }, +// { +// id: 78, +// name: Roku Premiere, +// code: RokuPremiere +// }, +// { +// id: 43, +// name: tvOS, +// code: tvOS +// }, +// { +// id: 30, +// name: Sony Bravia, +// code: SonyBravia +// }, +// { +// id: 23, +// name: Playstation 3, +// code: Playstation3 +// }, +// { +// id: 15, +// name: Sony, +// code: Sony +// }, +// { +// id: 1, +// name: PC( Linux ), +// code: PCLinux +// }, +// { +// id: 57, +// name: STB TotalPlay / MEX, +// code: STBTotalPlay_MEX +// }, +// { +// id: 85, +// name: Telecable STB Sagemcom, +// code: Telecable STB Sagemcom +// }, +// { +// id: 38, +// name: Roku HD, +// code: RokuHD +// }, +// { +// id: 29, +// name: Netgem, +// code: Netgem +// }, +// { +// id: 80, +// name: TCL, +// code: TCL +// }, +// { +// id: 24, +// name: Playstation 4, +// code: Playstation4 +// }, +// { +// id: 65, +// name: Mobile UWP, +// code: MobileUWP +// }, +// { +// id: 93, +// name: Alhambra STB, +// code: AlhambraSTB +// }, +// { +// id: 79, +// name: Roku Ultra, +// code: RokuUltra +// }, +// { +// id: 77, +// name: Roku Express, +// code: RokuExpress +// }, +// { +// id: 21, +// name: Playstation Vita, +// code: PlaystationVita +// }, +// { +// id: 14, +// name: Curl, +// code: Curl +// }, +// { +// id: 60, +// name: STB TCC / URU, +// code: STBTCC_URU +// }, +// { +// id: 3, +// name: PC( MAC ), +// code: PCMac +// }, +// { +// id: 66, +// name: XBOX ONE UWP, +// code: XboxOneUWP +// }, +// { +// id: 39, +// name: Roku LT, +// code: RokuLT +// }, +// { +// id: 32, +// name: iPod, +// code: iPod +// }, +// { +// id: 11, +// name: Android, +// code: Android +// }, +// { +// id: 4, +// name: Panasonic, +// code: Panasonic +// }, +// { +// id: 50, +// name: FireTV, +// code: FireTV +// }, +// { +// id: 76, +// name: Roku TV, +// code: RokuTV +// }, +// { +// id: 59, +// name: STB NuevoSiglo / URU, +// code: STBNuevoSiglo_URU +// }, +// { +// id: 87, +// name: Horizon STB, +// code: HorizonSTB +// } +//] diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index fc4e59b..95d386e 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -22,6 +22,8 @@ public class YouboraConfig { private boolean httpSecure = true; // youbora events will be sent via https + private Device device; + private Media media; private Ads ads; @@ -74,10 +76,19 @@ public void setHouseHoldId(String houseHoldId) { this.houseHoldId = houseHoldId; } + public void setObfuscateIP(boolean obfuscateIP) { this.obfuscateIP = obfuscateIP; } + public Device getDevice() { + return device; + } + + public void setDevice(Device device) { + this.device = device; + } + public Media getMedia() { return media; } @@ -123,10 +134,35 @@ public Options getYouboraOptions() { youboraLocalConfig.setParseHls(false); youboraLocalConfig.setParseCdnNode(false); - youboraLocalConfig.setDeviceCode(null); //TODO // List of device codes http://mapi.youbora.com:8081/devices youboraLocalConfig.setContentCdn(null); + if (device != null) { + if (device.getDeviceCode() != null) { + //Generic Data by code see in Device class what Codes are available + youboraLocalConfig.setDeviceCode(device.getDeviceCode()); + } + // Specific Data + if (device.getModel() != null) { + youboraLocalConfig.setDeviceModel(device.getModel()); + } + + if (device.getBrand() != null) { + youboraLocalConfig.setDeviceBrand(device.getBrand()); + } + + if (device.getType() != null) { + youboraLocalConfig.setDeviceType(device.getType()); + } + + if (device.getOsName() != null) { + youboraLocalConfig.setDeviceOsName(device.getOsName()); + } + + if (device.getOsVersion() != null) { + youboraLocalConfig.setDeviceOsVersion(device.getOsVersion()); + } + } if (media != null) { youboraLocalConfig.setContentIsLive(media.getIsLive()); @@ -209,24 +245,57 @@ public JsonObject toJson() { JsonPrimitive houseHoldId = new JsonPrimitive(getHouseHoldId() != null ? getHouseHoldId() : ""); JsonPrimitive isObfuscateIP = new JsonPrimitive(isObfuscateIP() ? true : false); JsonPrimitive httpSecure = new JsonPrimitive(getHttpSecure() ? true : false); - + JsonObject device = getDeviceJsonObject(); JsonObject mediaEntry = getMediaJsonObject(); JsonObject adsEntry = new JsonObject(); adsEntry.addProperty("campaign", (getAds() != null && getAds().getCampaign() != null) ? getAds().getCampaign() : ""); JsonObject propertiesEntry = getPropertiesJsonObject(); JsonObject extraParamEntry = getExtraParamJsonObject(); - JsonObject youboraConfig = getYouboraConfigJsonObject(accountCode, username, userType, houseHoldId, isObfuscateIP, httpSecure, mediaEntry, adsEntry, propertiesEntry, extraParamEntry); + JsonObject youboraConfig = getYouboraConfigJsonObject(accountCode, username, userType, houseHoldId, isObfuscateIP, httpSecure, device, mediaEntry, adsEntry, propertiesEntry, extraParamEntry); return youboraConfig; } + private JsonObject getDeviceJsonObject() { + JsonObject deviceJsonObject = new JsonObject(); + Device device = getDevice(); + if (device == null) { + return deviceJsonObject; + } + + if (device.getDeviceCode() != null) { + deviceJsonObject.addProperty("deviceCode", device.getDeviceCode()); + } + + if (device.getModel() != null) { + deviceJsonObject.addProperty("model", device.getModel()); + } + + if (device.getBrand() != null) { + deviceJsonObject.addProperty("brand", device.getBrand()); + } + + if (device.getType() != null) { + deviceJsonObject.addProperty("deviceCode", device.getType()); + } + + if (device.getOsName() != null) { + deviceJsonObject.addProperty("osName", device.getOsName()); + } + + if (device.getOsVersion() != null) { + deviceJsonObject.addProperty("osName", device.getOsVersion()); + } + return deviceJsonObject; + } + @NonNull private JsonObject getMediaJsonObject() { JsonObject mediaEntry = new JsonObject(); - if (getMedia() == null) { + Media media = getMedia(); + if (media == null) { return mediaEntry; } - Media media = getMedia(); mediaEntry.addProperty("isLive", media.getIsLive() != null ? media.getIsLive() : Boolean.FALSE); mediaEntry.addProperty("title", media.getTitle() != null ? media.getTitle() : ""); if (media.getDuration() != null) { @@ -237,7 +306,7 @@ private JsonObject getMediaJsonObject() { @NonNull private JsonObject getYouboraConfigJsonObject(JsonPrimitive accountCode, JsonPrimitive username, JsonPrimitive userType, JsonPrimitive houseHoldId, JsonPrimitive obfuscateIP, JsonPrimitive httpSecure, - JsonObject mediaEntry, JsonObject adsEntry, JsonObject propertiesEntry, JsonObject extraParamEntry) { + JsonObject device, JsonObject mediaEntry, JsonObject adsEntry, JsonObject propertiesEntry, JsonObject extraParamEntry) { JsonObject youboraConfig = new JsonObject(); youboraConfig.add("accountCode", accountCode); youboraConfig.add("username", username); @@ -246,6 +315,7 @@ private JsonObject getYouboraConfigJsonObject(JsonPrimitive accountCode, JsonPri youboraConfig.add("obfuscateIP", obfuscateIP); youboraConfig.add("httpSecure", httpSecure); + youboraConfig.add("device", device); youboraConfig.add("media", mediaEntry); youboraConfig.add("ads", adsEntry); youboraConfig.add("properties", propertiesEntry); From df607aa4ea691ea7d3566dbc4a12e5ee92a7c9e1 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 20 Mar 2019 13:05:58 +0200 Subject: [PATCH 044/143] v3.9.2 --- youboraplugin/version.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youboraplugin/version.gradle b/youboraplugin/version.gradle index 0b5d6e1..a6a3daa 100644 --- a/youboraplugin/version.gradle +++ b/youboraplugin/version.gradle @@ -1,6 +1,6 @@ // Library Version -ext.libVersion = 'dev' +ext.libVersion = '3.9.2' // Append short commit hash to dev builds, i.e. "dev.a1b2c3d" if (libVersion == 'dev') { From 007b06214830dc613346b5be52e2c116dfaad226 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 20 Mar 2019 13:14:48 +0200 Subject: [PATCH 045/143] back to dev --- youboraplugin/version.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youboraplugin/version.gradle b/youboraplugin/version.gradle index a6a3daa..0b5d6e1 100644 --- a/youboraplugin/version.gradle +++ b/youboraplugin/version.gradle @@ -1,6 +1,6 @@ // Library Version -ext.libVersion = '3.9.2' +ext.libVersion = 'dev' // Append short commit hash to dev builds, i.e. "dev.a1b2c3d" if (libVersion == 'dev') { From 29cf16f3fa3741b86d9a9b122837c134a70616bf Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Sun, 7 Apr 2019 11:18:59 +0300 Subject: [PATCH 046/143] add NPE protection (#23) --- .../plugins/youbora/PKYouboraPlayerAdapter.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index 9bf8211..01cf888 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -196,6 +196,10 @@ private void addListeners() { messageBus.addListener(this, PlayerEvent.ended, event -> { printReceivedPlayerEvent(event); + if (isNullAdapter()) { + return; + } + if (PKAdPluginType.server.equals(getLastReportedAdPluginType())) { getPlugin().getAdapter().fireStop(); fireStop(); @@ -296,6 +300,10 @@ private void addListeners() { messageBus.addListener(this, AdEvent.allAdsCompleted, event -> { printReceivedAdEvent(event); + if (isNullAdapter()) { + return; + } + if (adCuePoints != null && adCuePoints.hasPostRoll()) { getPlugin().getAdapter().fireStop(); isFirstPlay = true; @@ -422,6 +430,14 @@ private PKAdPluginType getLastReportedAdPluginType() { return lastReportedAdPluginType; } + private boolean isNullAdapter() { + if (getPlugin() == null || getPlugin().getAdapter() == null) { + log.e("Player Adapter is null"); + return true; + } + return false; + } + public String generateRendition(double bitrate, int width, int height) { if ((width <= 0 || height <= 0) && bitrate <= 0) { From 645bae2da18813146d0af1788f5b55a6aed454b4 Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Mon, 13 May 2019 13:22:58 +0530 Subject: [PATCH 047/143] - Check if pluginManager is null in onUpdateConfig (#24) - Protection for playerErrorException --- .../playkit/plugins/youbora/PKYouboraPlayerAdapter.java | 4 ++-- .../com/kaltura/playkit/plugins/youbora/YouboraPlugin.java | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index 01cf888..5c2f96d 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -121,7 +121,7 @@ private void sendErrorHandler(PKEvent event) { Exception playerErrorException = (Exception) error.exception; String exceptionClass = ""; - if (playerErrorException.getCause() != null && playerErrorException.getCause().getClass() != null) { + if (playerErrorException != null && playerErrorException.getCause() != null && playerErrorException.getCause().getClass() != null) { exceptionClass = playerErrorException.getCause().getClass().getName(); errorMetadata = (playerErrorException.getCause().toString() != null) ? playerErrorException.getCause().toString() : errorMetadata; } else { @@ -132,7 +132,7 @@ private void sendErrorHandler(PKEvent event) { LinkedHashSet causeMessages = getExceptionMessageChain(playerErrorException); StringBuilder exceptionCauseBuilder = new StringBuilder(); - if (causeMessages.isEmpty()) { + if (playerErrorException != null && causeMessages.isEmpty()) { exceptionCauseBuilder.append(playerErrorException.toString()); } else { for (String cause : causeMessages) { diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index 60ee7db..9474db0 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -126,6 +126,9 @@ protected void onUpdateMedia(PKMediaConfig mediaConfig) { @Override protected void onUpdateConfig(Object config) { log.d("youbora - onUpdateConfig"); + if (pluginManager == null) { + return; + } pluginManager.onUpdateConfig(); if (adsManager != null) { adsManager.onUpdateConfig(); From 4b1d21ec3673649670f4c32cda80d940803f583e Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Thu, 4 Jul 2019 15:54:24 +0300 Subject: [PATCH 048/143] Kaltura Player (#26) * protect npe * Fix FEM-2569 Replace of entry id did not work due to exiting the onUpdateConfig too early * fix compilation --- youboraplugin/build.gradle | 1 + .../playkit/plugins/youbora/YouboraPlugin.java | 15 +++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index aed9bc5..b341787 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -35,6 +35,7 @@ dependencies { testImplementation 'junit:junit:4.12' androidTestImplementation 'com.android.support.test:runner:1.0.2' + implementation 'com.android.support:support-annotations:28.0.0' } diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index 9474db0..2750638 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -37,7 +37,7 @@ public class YouboraPlugin extends PKPlugin { public static final Factory factory = new Factory() { @Override public String getName() { - return "Youbora"; + return "youbora"; } @Override @@ -126,6 +126,15 @@ protected void onUpdateMedia(PKMediaConfig mediaConfig) { @Override protected void onUpdateConfig(Object config) { log.d("youbora - onUpdateConfig"); + if (config == null) { + return; + } + this.pluginConfig = parseConfig(config); + // Refresh options with updated media + if (npawPlugin != null && pluginConfig != null) { + npawPlugin.setOptions(pluginConfig.getYouboraOptions()); + } + if (pluginManager == null) { return; } @@ -133,9 +142,7 @@ protected void onUpdateConfig(Object config) { if (adsManager != null) { adsManager.onUpdateConfig(); } - this.pluginConfig = parseConfig(config); - // Refresh options with updated media - npawPlugin.setOptions(pluginConfig.getYouboraOptions()); + } @Override From 47934c730b44fa2399f33fcf713c1825db233674 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Tue, 9 Jul 2019 14:34:49 +0300 Subject: [PATCH 049/143] remove push to bintray (#27) --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index fb00ad2..6c80043 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,8 +14,6 @@ script: - ./gradlew youboraplugin:build after_failure: - cat youboraplugin/build/outputs/lint-results-debug.xml -after_success: - - ./travis-push-to-bintray.sh notifications: email: recipients: From 4d1c3921db4523b23303e9ce58e09a11032381f3 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Mon, 15 Jul 2019 11:11:55 +0300 Subject: [PATCH 050/143] remove warnings (#28) --- .../kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java | 2 +- .../com/kaltura/playkit/plugins/youbora/YouboraPlugin.java | 2 -- .../playkit/plugins/youbora/pluginconfig/YouboraConfig.java | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java index fda1103..3373e34 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java @@ -87,7 +87,7 @@ public void unregisterListeners() { @Override public Long getBitrate() { - return Long.valueOf(lastReportedAdBitrate); + return lastReportedAdBitrate; } @Override diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index 2750638..1eac8e7 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -5,14 +5,12 @@ import com.google.gson.Gson; import com.google.gson.JsonObject; import com.kaltura.playkit.MessageBus; -import com.kaltura.playkit.PKEvent; import com.kaltura.playkit.PKLog; import com.kaltura.playkit.PKMediaConfig; import com.kaltura.playkit.PKPlugin; import com.kaltura.playkit.Player; import com.kaltura.playkit.PlayerEvent; import com.kaltura.playkit.plugin.youbora.BuildConfig; -import com.kaltura.playkit.plugins.ads.AdEvent; import com.kaltura.playkit.plugins.youbora.pluginconfig.YouboraConfig; /** diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index 95d386e..74d4a65 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -243,8 +243,8 @@ public JsonObject toJson() { JsonPrimitive username = new JsonPrimitive(getUsername() != null ? getUsername() : ""); JsonPrimitive userType = new JsonPrimitive(getUserType() != null ? getUserType() : ""); JsonPrimitive houseHoldId = new JsonPrimitive(getHouseHoldId() != null ? getHouseHoldId() : ""); - JsonPrimitive isObfuscateIP = new JsonPrimitive(isObfuscateIP() ? true : false); - JsonPrimitive httpSecure = new JsonPrimitive(getHttpSecure() ? true : false); + JsonPrimitive isObfuscateIP = new JsonPrimitive(isObfuscateIP()); + JsonPrimitive httpSecure = new JsonPrimitive(getHttpSecure()); JsonObject device = getDeviceJsonObject(); JsonObject mediaEntry = getMediaJsonObject(); JsonObject adsEntry = new JsonObject(); From a19e25528465d70a0a5b869111af218373d67a57 Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Tue, 16 Jul 2019 01:10:37 +0530 Subject: [PATCH 051/143] FEM-2502 AndroidX migration (#25) * - AndroidX migration --- youboraplugin/build.gradle | 8 ++++---- .../plugins/youbora/pluginconfig/YouboraConfig.java | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index b341787..e76f8cb 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -12,7 +12,7 @@ android { targetSdkVersion 28 versionName libVersion - testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } @@ -29,13 +29,13 @@ dependencies { //TODO change to latest playkit version after tagging. implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' - //implementation project(":playkit"); + //implementation project(":playkit") api 'com.npaw.youbora:youboralib:6.3.5' testImplementation 'junit:junit:4.12' - androidTestImplementation 'com.android.support.test:runner:1.0.2' - implementation 'com.android.support:support-annotations:28.0.0' + androidTestImplementation 'androidx.test:runner:1.1.1' + implementation 'androidx.annotation:annotation:1.0.2' } diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index 74d4a65..a17e567 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -1,9 +1,10 @@ package com.kaltura.playkit.plugins.youbora.pluginconfig; import android.os.Bundle; -import android.support.annotation.NonNull; import android.text.TextUtils; +import androidx.annotation.NonNull; + import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; import com.npaw.youbora.lib6.plugin.Options; From 4a86f9831b92f8eed81fd48a10cb17e60bbfc798 Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Thu, 18 Jul 2019 13:10:10 +0530 Subject: [PATCH 052/143] FEM-2585 Add support in Youbora to send Youbora Options as Bundle (#29) * - Youbora update to v6.5.1 * - Household Id changes * Youbora upgrade to v6.5.1 * - upgrade version: 6.4.7 --- youboraplugin/build.gradle | 2 +- .../youbora/PKYouboraPlayerAdapter.java | 10 +- .../plugins/youbora/YouboraPlugin.java | 36 ++++-- .../youbora/pluginconfig/YouboraConfig.java | 122 ++++++++++-------- 4 files changed, 98 insertions(+), 72 deletions(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index e76f8cb..6033cb4 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -31,7 +31,7 @@ dependencies { implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' //implementation project(":playkit") - api 'com.npaw.youbora:youboralib:6.3.5' + api 'com.npaw.youbora:youboralib:6.4.7' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.1.1' diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index 5c2f96d..3e7495e 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -29,7 +29,6 @@ import com.kaltura.playkit.ads.PKAdPluginType; import com.kaltura.playkit.plugins.ads.AdCuePoints; import com.kaltura.playkit.plugins.ads.AdEvent; -import com.kaltura.playkit.plugins.youbora.pluginconfig.YouboraConfig; import com.kaltura.playkit.utils.Consts; import com.npaw.youbora.lib6.YouboraUtil; import com.npaw.youbora.lib6.adapter.PlayerAdapter; @@ -66,13 +65,13 @@ class PKYouboraPlayerAdapter extends PlayerAdapter { private boolean isAdPlaying; private AdCuePoints adCuePoints; - PKYouboraPlayerAdapter(Player player, MessageBus messageBus, PKMediaConfig mediaConfig, YouboraConfig pluginConfig) { + PKYouboraPlayerAdapter(Player player, MessageBus messageBus, PKMediaConfig mediaConfig, String houseHoldId) { super(player); log.d("Start PKYouboraPlayerAdapter"); this.messageBus = messageBus; this.mediaConfig = mediaConfig; updateDurationFromMediaConfig(mediaConfig); - this.houseHoldId = pluginConfig.getHouseHoldId(); + this.houseHoldId = houseHoldId; registerListeners(); } @@ -361,6 +360,7 @@ public String getPlayerName() { @Override public String getHouseholdId() { + log.d("Household Id: " + houseHoldId); return houseHoldId; } @@ -478,8 +478,8 @@ public void setMediaConfig(PKMediaConfig mediaConfig) { } - public void setPluginConfig(YouboraConfig pluginConfig) { - this.houseHoldId = pluginConfig.getHouseHoldId(); + public void setHouseHoldId(String houseHoldId) { + this.houseHoldId = houseHoldId; } public void setLastReportedResource(String lastReportedResource) { diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index 1eac8e7..2f375f1 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -1,6 +1,7 @@ package com.kaltura.playkit.plugins.youbora; import android.content.Context; +import android.os.Bundle; import com.google.gson.Gson; import com.google.gson.JsonObject; @@ -12,6 +13,9 @@ import com.kaltura.playkit.PlayerEvent; import com.kaltura.playkit.plugin.youbora.BuildConfig; import com.kaltura.playkit.plugins.youbora.pluginconfig.YouboraConfig; +import com.npaw.youbora.lib6.plugin.Options; + +import static com.kaltura.playkit.plugins.youbora.pluginconfig.YouboraConfig.KEY_HOUSEHOLD_ID; /** * Created by zivilan on 02/11/2016. @@ -24,10 +28,11 @@ public class YouboraPlugin extends PKPlugin { private static PKYouboraAdsAdapter adsManager; private PKMediaConfig mediaConfig; - private YouboraConfig pluginConfig; + private Options pluginConfig; private NPAWPlugin npawPlugin; private Player player; private MessageBus messageBus; + private static String houseHoldId; private boolean isMonitoring = false; private boolean isAdsMonitoring = false; @@ -62,7 +67,7 @@ protected void onLoad(final Player player, Object config, final MessageBus messa this.pluginConfig = parseConfig(config); //YouboraLog.setDebugLevel(YouboraLog.Level.VERBOSE); - npawPlugin = new NPAWPlugin(pluginConfig.getYouboraOptions()); + npawPlugin = new NPAWPlugin(pluginConfig); loadPlugin(); } @@ -79,7 +84,7 @@ private void loadPlugin() { }); messageBus.addListener(this, PlayerEvent.durationChanged, event -> { - log.d("YouboraPlugin DURATION_CHANGE"); + log.d("YouboraPlugin DURATION_CHANGE"); }); messageBus.addListener(this, PlayerEvent.stopped, event -> { @@ -97,16 +102,16 @@ protected void onUpdateMedia(PKMediaConfig mediaConfig) { if (!isMonitoring) { isMonitoring = true; if (pluginManager == null) { - pluginManager = new PKYouboraPlayerAdapter(player, messageBus, mediaConfig, pluginConfig); + pluginManager = new PKYouboraPlayerAdapter(player, messageBus, mediaConfig, houseHoldId); } else { pluginManager.resetPlaybackValues(); pluginManager.registerListeners(); } pluginManager.setMediaConfig(mediaConfig); - pluginManager.setPluginConfig(pluginConfig); + pluginManager.setHouseHoldId(houseHoldId); } - npawPlugin.setOptions(pluginConfig.getYouboraOptions()); + npawPlugin.setOptions(pluginConfig); npawPlugin.setAdapter(pluginManager); if (!isAdsMonitoring) { @@ -127,10 +132,11 @@ protected void onUpdateConfig(Object config) { if (config == null) { return; } + this.pluginConfig = parseConfig(config); // Refresh options with updated media if (npawPlugin != null && pluginConfig != null) { - npawPlugin.setOptions(pluginConfig.getYouboraOptions()); + npawPlugin.setOptions(pluginConfig); } if (pluginManager == null) { @@ -200,13 +206,19 @@ private void stopMonitoring() { } } - private static YouboraConfig parseConfig(Object config) { + private static Options parseConfig(Object config) { if (config instanceof YouboraConfig) { - return ((YouboraConfig) config); - + houseHoldId = ((YouboraConfig) config).getHouseHoldId(); + return ((YouboraConfig) config).getYouboraOptions(); } else if (config instanceof JsonObject) { - return new Gson().fromJson(((JsonObject) config), YouboraConfig.class); + YouboraConfig youboraConfig = new Gson().fromJson(((JsonObject) config), YouboraConfig.class); + houseHoldId = youboraConfig.getHouseHoldId(); + return youboraConfig.getYouboraOptions(); + } else if (config instanceof Bundle) { + Options options = new Options((Bundle) config); + houseHoldId = ((Bundle) config).getString(KEY_HOUSEHOLD_ID); + return options; } return null; } -} \ No newline at end of file +} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index a17e567..1af1ce5 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -11,6 +11,24 @@ public class YouboraConfig { + // Kaltura Youbora Keys for Bundle + + public static final String KEY_HOUSEHOLD_ID = "houseHoldId"; + + public static final String KEY_CONTENT_METADATA_YEAR = "year"; + + public static final String KEY_CONTENT_METADATA_CAST = "cast"; + + public static final String KEY_CONTENT_METADATA_DIRECTOR = "director"; + + public static final String KEY_CONTENT_METADATA_OWNER = "owner"; + + public static final String KEY_CONTENT_METADATA_PARENTAL = "parental"; + + public static final String KEY_CONTENT_METADATA_RATING = "rating"; + + public static final String KEY_CONTENT_METADATA_QUALITY = "quality"; + private String accountCode; private String username; @@ -19,7 +37,7 @@ public class YouboraConfig { private String houseHoldId; // which device is used to play - private boolean obfuscateIP; // ip in dahsbord will be encrytpted + private boolean obfuscateIP; // ip in dashboard will be encrypted private boolean httpSecure = true; // youbora events will be sent via https @@ -124,97 +142,93 @@ public void setExtraParams(ExtraParams extraParams) { public Options getYouboraOptions() { - Options youboraLocalConfig = new Options(); + Options youboraOptions = new Options(); + + youboraOptions.setAccountCode(accountCode); + youboraOptions.setUsername(username); + youboraOptions.setUserType(userType); + youboraOptions.setNetworkObfuscateIp(obfuscateIP); + youboraOptions.setHttpSecure(httpSecure); - youboraLocalConfig.setAccountCode(accountCode); - youboraLocalConfig.setUsername(username); - youboraLocalConfig.setUserType(userType); - youboraLocalConfig.setNetworkObfuscateIp(obfuscateIP); - youboraLocalConfig.setHttpSecure(httpSecure); + youboraOptions.setParseHls(false); + youboraOptions.setParseCdnNode(false); - youboraLocalConfig.setParseHls(false); - youboraLocalConfig.setParseCdnNode(false); + youboraOptions.setDeviceCode(null); //TODO // List of device codes http://mapi.youbora.com:8081/devices + youboraOptions.setContentCdn(null); - youboraLocalConfig.setDeviceCode(null); //TODO // List of device codes http://mapi.youbora.com:8081/devices - youboraLocalConfig.setContentCdn(null); if (device != null) { if (device.getDeviceCode() != null) { //Generic Data by code see in Device class what Codes are available - youboraLocalConfig.setDeviceCode(device.getDeviceCode()); + youboraOptions.setDeviceCode(device.getDeviceCode()); } // Specific Data if (device.getModel() != null) { - youboraLocalConfig.setDeviceModel(device.getModel()); + youboraOptions.setDeviceModel(device.getModel()); } if (device.getBrand() != null) { - youboraLocalConfig.setDeviceBrand(device.getBrand()); + youboraOptions.setDeviceBrand(device.getBrand()); } if (device.getType() != null) { - youboraLocalConfig.setDeviceType(device.getType()); + youboraOptions.setDeviceType(device.getType()); } if (device.getOsName() != null) { - youboraLocalConfig.setDeviceOsName(device.getOsName()); + youboraOptions.setDeviceOsName(device.getOsName()); } if (device.getOsVersion() != null) { - youboraLocalConfig.setDeviceOsVersion(device.getOsVersion()); + youboraOptions.setDeviceOsVersion(device.getOsVersion()); } } if (media != null) { - youboraLocalConfig.setContentIsLive(media.getIsLive()); - youboraLocalConfig.setContentIsLiveNoSeek((media.getIsDVR() != null) ? !media.getIsDVR() : null); - youboraLocalConfig.setContentDuration(media.getDuration()); - youboraLocalConfig.setContentTitle(media.getTitle()); - youboraLocalConfig.setContentTitle2(media.getTitle2()); - youboraLocalConfig.setContentTransactionCode(media.getTransactionCode()); + youboraOptions.setContentIsLive(media.getIsLive()); + youboraOptions.setContentIsLiveNoSeek((media.getIsDVR() != null) ? !media.getIsDVR() : null); + youboraOptions.setContentDuration(media.getDuration()); + youboraOptions.setContentTitle(media.getTitle()); + youboraOptions.setProgram(media.getTitle2()); + youboraOptions.setContentTransactionCode(media.getTransactionCode()); } - - youboraLocalConfig.setAdResource(null); + youboraOptions.setAdResource(null); if (ads != null) { - youboraLocalConfig.setAdCampaign(ads.getCampaign()); + youboraOptions.setAdCampaign(ads.getCampaign()); } - youboraLocalConfig.setAdTitle(""); - - - - youboraLocalConfig.setContentMetadata(getPropertiesBundle()); + youboraOptions.setAdTitle(""); + youboraOptions.setContentMetadata(getPropertiesBundle()); if (ads != null && ads.getExtraParams() != null) { - youboraLocalConfig.setAdExtraparam1(ads.getExtraParams().getParam1()); - youboraLocalConfig.setAdExtraparam2(ads.getExtraParams().getParam2()); - youboraLocalConfig.setAdExtraparam3(ads.getExtraParams().getParam3()); - youboraLocalConfig.setAdExtraparam4(ads.getExtraParams().getParam4()); - youboraLocalConfig.setAdExtraparam5(ads.getExtraParams().getParam5()); - youboraLocalConfig.setAdExtraparam6(ads.getExtraParams().getParam6()); - youboraLocalConfig.setAdExtraparam7(ads.getExtraParams().getParam7()); - youboraLocalConfig.setAdExtraparam8(ads.getExtraParams().getParam8()); - youboraLocalConfig.setAdExtraparam9(ads.getExtraParams().getParam9()); - youboraLocalConfig.setAdExtraparam10(ads.getExtraParams().getParam10()); + youboraOptions.setAdCustomDimension1(ads.getExtraParams().getParam1()); + youboraOptions.setAdCustomDimension2(ads.getExtraParams().getParam2()); + youboraOptions.setAdCustomDimension3(ads.getExtraParams().getParam3()); + youboraOptions.setAdCustomDimension4(ads.getExtraParams().getParam4()); + youboraOptions.setAdCustomDimension5(ads.getExtraParams().getParam5()); + youboraOptions.setAdCustomDimension6(ads.getExtraParams().getParam6()); + youboraOptions.setAdCustomDimension7(ads.getExtraParams().getParam7()); + youboraOptions.setAdCustomDimension8(ads.getExtraParams().getParam8()); + youboraOptions.setAdCustomDimension9(ads.getExtraParams().getParam9()); + youboraOptions.setAdCustomDimension10(ads.getExtraParams().getParam10()); } if (extraParams != null) { - youboraLocalConfig.setExtraparam1(extraParams.getParam1()); - youboraLocalConfig.setExtraparam2(extraParams.getParam2()); - youboraLocalConfig.setExtraparam3(extraParams.getParam3()); - youboraLocalConfig.setExtraparam4(extraParams.getParam4()); - youboraLocalConfig.setExtraparam5(extraParams.getParam5()); - youboraLocalConfig.setExtraparam6(extraParams.getParam6()); - youboraLocalConfig.setExtraparam7(extraParams.getParam7()); - youboraLocalConfig.setExtraparam8(extraParams.getParam8()); - youboraLocalConfig.setExtraparam9(extraParams.getParam9()); - youboraLocalConfig.setExtraparam10(extraParams.getParam10()); - } - return youboraLocalConfig; + youboraOptions.setContentCustomDimension1(extraParams.getParam1()); + youboraOptions.setContentCustomDimension2(extraParams.getParam2()); + youboraOptions.setContentCustomDimension3(extraParams.getParam3()); + youboraOptions.setContentCustomDimension4(extraParams.getParam4()); + youboraOptions.setContentCustomDimension5(extraParams.getParam5()); + youboraOptions.setContentCustomDimension6(extraParams.getParam6()); + youboraOptions.setContentCustomDimension7(extraParams.getParam7()); + youboraOptions.setContentCustomDimension8(extraParams.getParam8()); + youboraOptions.setContentCustomDimension9(extraParams.getParam9()); + youboraOptions.setContentCustomDimension10(extraParams.getParam10()); + } + return youboraOptions; } - private Bundle getPropertiesBundle() { if (getProperties() == null) { return new Bundle(); From 76b86aafda1667fd5e296a89c216e8659f367941 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 11 Sep 2019 15:08:05 +0300 Subject: [PATCH 053/143] upgrade classpath 'com.novoda:bintray-release:0.9.1' (#30) --- build.gradle | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- youboraplugin/version.gradle | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index ecb28a4..af2696d 100644 --- a/build.gradle +++ b/build.gradle @@ -8,8 +8,8 @@ buildscript { maven { url "https://jitpack.io" } } dependencies { - classpath 'com.android.tools.build:gradle:3.1.4' - classpath 'com.novoda:bintray-release:0.8.0' + classpath 'com.android.tools.build:gradle:3.4.2' + classpath 'com.novoda:bintray-release:0.9.1' // NOTE: Do not place your application dependencies here; they belong diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0767316..759564a 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip diff --git a/youboraplugin/version.gradle b/youboraplugin/version.gradle index 0b5d6e1..5aa4a6c 100644 --- a/youboraplugin/version.gradle +++ b/youboraplugin/version.gradle @@ -17,11 +17,11 @@ try { publish { artifactId = 'youboraplugin' - description = 'PlayKit Kava Plugin' + desc = 'PlayKit Kava Plugin' repoName = 'android' userOrg = 'kaltura' groupId = 'com.kaltura.playkit' - version = libVersion + publishVersion = libVersion autoPublish = true licences = ['AGPL-3.0'] } From ecdc2f4d0dbad7c701c93873b71091b0706f0403 Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Wed, 11 Dec 2019 19:13:11 +0530 Subject: [PATCH 054/143] FEM-2747 Upgrade youbora plugin to 6.6.3 (#31) * - Upgrade youbora version 6.6.3 * - Added new properties --- youboraplugin/build.gradle | 2 +- .../playkit/plugins/youbora/NPAWPlugin.java | 11 +- .../plugins/youbora/PKYouboraAdsAdapter.java | 24 ++- .../youbora/PKYouboraPlayerAdapter.java | 2 +- .../plugins/youbora/YouboraPlugin.java | 2 +- .../youbora/pluginconfig/Properties.java | 162 ++++++++++++++++++ .../youbora/pluginconfig/YouboraConfig.java | 98 +++++++---- 7 files changed, 245 insertions(+), 56 deletions(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 6033cb4..0b8c0d8 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -31,7 +31,7 @@ dependencies { implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' //implementation project(":playkit") - api 'com.npaw.youbora:youboralib:6.4.7' + api 'com.npaw.youbora:youboralib:6.6.3' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.1.1' diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/NPAWPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/NPAWPlugin.java index a8730ba..3895a51 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/NPAWPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/NPAWPlugin.java @@ -1,6 +1,7 @@ package com.kaltura.playkit.plugins.youbora; -import com.npaw.youbora.lib6.adapter.PlayerAdapter; +import android.content.Context; + import com.npaw.youbora.lib6.plugin.Options; import com.npaw.youbora.lib6.plugin.Plugin; @@ -10,11 +11,7 @@ public class NPAWPlugin extends Plugin { - public NPAWPlugin(Options options) { - super(options); - } - - public NPAWPlugin(Options options, PlayerAdapter adapter) { - super(options, adapter); + public NPAWPlugin(Options options, Context context) { + super(options, context); } } diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java index 3373e34..207c24a 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java @@ -360,7 +360,6 @@ private void addListeners() { return; } printLastReportedAdPlayhead(); - fireAllAdsCompleted(); sendReportEvent(event.eventType()); }); } @@ -385,18 +384,17 @@ private void handleAdError(PKError error) { PKAdErrorType adErrorType = (PKAdErrorType) error.errorType; - switch (adErrorType) { - case QUIET_LOG_ERROR: - log.d("QUIET_LOG_ERROR. Avoid sending to Youbora."); - fireError(error.message, PKAdErrorType.QUIET_LOG_ERROR.name(), null, null); - return; - default: - log.e("onAdError " + adErrorType.name()); - Exception adException = null; - if (error.exception instanceof Exception) { - adException = (Exception) error.exception; - } - fireFatalError(error.message, adErrorType.name(), null, adException); + if (adErrorType == PKAdErrorType.QUIET_LOG_ERROR) { + log.d("QUIET_LOG_ERROR. Avoid sending to Youbora."); + fireError(error.message, PKAdErrorType.QUIET_LOG_ERROR.name(), null, null); + return; + } else { + log.e("onAdError " + adErrorType.name()); + Exception adException = null; + if (error.exception instanceof Exception) { + adException = (Exception) error.exception; + } + fireFatalError(error.message, adErrorType.name(), null, adException); } sendReportEvent(adErrorType); } diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index 3e7495e..2a7b01f 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -164,7 +164,7 @@ public void registerListeners() { private void addListeners() { messageBus.addListener(this, PlayerEvent.playbackInfoUpdated, event -> { printReceivedPlayerEvent(event); - PlaybackInfo currentPlaybackInfo = ((PlayerEvent.PlaybackInfoUpdated) event).playbackInfo; + PlaybackInfo currentPlaybackInfo = event.playbackInfo; lastReportedBitrate = currentPlaybackInfo.getVideoBitrate(); lastReportedThroughput = currentPlaybackInfo.getVideoThroughput(); lastReportedRendition = generateRendition(lastReportedBitrate, (int) currentPlaybackInfo.getVideoWidth(), (int) currentPlaybackInfo.getVideoHeight()); diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index 2f375f1..559b7b6 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -67,7 +67,7 @@ protected void onLoad(final Player player, Object config, final MessageBus messa this.pluginConfig = parseConfig(config); //YouboraLog.setDebugLevel(YouboraLog.Level.VERBOSE); - npawPlugin = new NPAWPlugin(pluginConfig); + npawPlugin = new NPAWPlugin(pluginConfig, context); loadPlugin(); } diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Properties.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Properties.java index 4fb8090..2610510 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Properties.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Properties.java @@ -17,6 +17,25 @@ public class Properties { private String device; private String quality; + private String contentPackage; + private String contentSaga; + private String contentTvShow; + private String contentSeason; + private String contentEpisodeTitle; + private String contentChannel; + private String contentId; + private String contentImdbId; + private String contentGracenoteId; + private String contentLanguage; + private String contentSubtitles; + private String contentContractedResolution; + private String contentPlaybackType; + private String contentDrm; + private String contentEncodingVideoCodec; + private String contentEncodingAudioCodec; + private String contentEncodingCodecProfile; + private String contentEncodingContainerFormat; + public String getGenre() { return genre; } @@ -129,4 +148,147 @@ public void setQuality(String quality) { this.quality = quality; } + public String getContentPackage() { + return contentPackage; + } + + public void setContentPackage(String contentPackage) { + this.contentPackage = contentPackage; + } + + public String getContentSaga() { + return contentSaga; + } + + public void setContentSaga(String contentSaga) { + this.contentSaga = contentSaga; + } + + public String getContentTvShow() { + return contentTvShow; + } + + public void setContentTvShow(String contentTvShow) { + this.contentTvShow = contentTvShow; + } + + public String getContentSeason() { + return contentSeason; + } + + public void setContentSeason(String contentSeason) { + this.contentSeason = contentSeason; + } + + public String getContentEpisodeTitle() { + return contentEpisodeTitle; + } + + public void setContentEpisodeTitle(String contentEpisodeTitle) { + this.contentEpisodeTitle = contentEpisodeTitle; + } + + public String getContentChannel() { + return contentChannel; + } + + public void setContentChannel(String contentChannel) { + this.contentChannel = contentChannel; + } + + public String getContentId() { + return contentId; + } + + public void setContentId(String contentId) { + this.contentId = contentId; + } + + public String getContentImdbId() { + return contentImdbId; + } + + public void setContentImdbId(String contentImdbId) { + this.contentImdbId = contentImdbId; + } + + public String getContentGracenoteId() { + return contentGracenoteId; + } + + public void setContentGracenoteId(String contentGracenoteId) { + this.contentGracenoteId = contentGracenoteId; + } + + public String getContentLanguage() { + return contentLanguage; + } + + public void setContentLanguage(String contentLanguage) { + this.contentLanguage = contentLanguage; + } + + public String getContentSubtitles() { + return contentSubtitles; + } + + public void setContentSubtitles(String contentSubtitles) { + this.contentSubtitles = contentSubtitles; + } + + public String getContentContractedResolution() { + return contentContractedResolution; + } + + public void setContentContractedResolution(String contentContractedResolution) { + this.contentContractedResolution = contentContractedResolution; + } + + public String getContentPlaybackType() { + return contentPlaybackType; + } + + public void setContentPlaybackType(String contentPlaybackType) { + this.contentPlaybackType = contentPlaybackType; + } + + public String getContentDrm() { + return contentDrm; + } + + public void setContentDrm(String contentDrm) { + this.contentDrm = contentDrm; + } + + public String getContentEncodingVideoCodec() { + return contentEncodingVideoCodec; + } + + public void setContentEncodingVideoCodec(String contentEncodingVideoCodec) { + this.contentEncodingVideoCodec = contentEncodingVideoCodec; + } + + public String getContentEncodingAudioCodec() { + return contentEncodingAudioCodec; + } + + public void setContentEncodingAudioCodec(String contentEncodingAudioCodec) { + this.contentEncodingAudioCodec = contentEncodingAudioCodec; + } + + public String getContentEncodingCodecProfile() { + return contentEncodingCodecProfile; + } + + public void setContentEncodingCodecProfile(String contentEncodingCodecProfile) { + this.contentEncodingCodecProfile = contentEncodingCodecProfile; + } + + public String getContentEncodingContainerFormat() { + return contentEncodingContainerFormat; + } + + public void setContentEncodingContainerFormat(String contentEncodingContainerFormat) { + this.contentEncodingContainerFormat = contentEncodingContainerFormat; + } } \ No newline at end of file diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index 1af1ce5..dd4ee7c 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -37,7 +37,7 @@ public class YouboraConfig { private String houseHoldId; // which device is used to play - private boolean obfuscateIP; // ip in dashboard will be encrypted + private boolean userObfuscateIp; // Option to obfuscate the IP. private boolean httpSecure = true; // youbora events will be sent via https @@ -75,10 +75,6 @@ public void setUserType(String userType) { this.userType = userType; } - public boolean isObfuscateIP() { - return obfuscateIP; - } - public boolean getHttpSecure() { return httpSecure; } @@ -95,9 +91,12 @@ public void setHouseHoldId(String houseHoldId) { this.houseHoldId = houseHoldId; } + public boolean isUserObfuscateIp() { + return userObfuscateIp; + } - public void setObfuscateIP(boolean obfuscateIP) { - this.obfuscateIP = obfuscateIP; + public void setUserObfuscateIp(boolean userObfuscateIp) { + this.userObfuscateIp = userObfuscateIp; } public Device getDevice() { @@ -147,7 +146,7 @@ public Options getYouboraOptions() { youboraOptions.setAccountCode(accountCode); youboraOptions.setUsername(username); youboraOptions.setUserType(userType); - youboraOptions.setNetworkObfuscateIp(obfuscateIP); + youboraOptions.setUserObfuscateIp(userObfuscateIp); youboraOptions.setHttpSecure(httpSecure); youboraOptions.setParseHls(false); @@ -199,7 +198,9 @@ public Options getYouboraOptions() { } youboraOptions.setAdTitle(""); - youboraOptions.setContentMetadata(getPropertiesBundle()); + setContentPropertiesBundle(youboraOptions); + + youboraOptions.setContentMetadata(getContentMetaDataBundle()); if (ads != null && ads.getExtraParams() != null) { youboraOptions.setAdCustomDimension1(ads.getExtraParams().getParam1()); @@ -229,28 +230,60 @@ public Options getYouboraOptions() { return youboraOptions; } - private Bundle getPropertiesBundle() { - if (getProperties() == null) { - return new Bundle(); + private void setContentPropertiesBundle(Options youboraOptions) { + Properties prop = getProperties(); + if (prop == null) { + return; } + youboraOptions.setContentGenre(prop.getGenre()); + youboraOptions.setContentType(prop.getType()); + youboraOptions.setContentTransactionCode(prop.getTransactionType()); + youboraOptions.setContentPrice(prop.getPrice()); + youboraOptions.setContentRendition(prop.getQuality()); // Name or value of the current rendition (quality) of the content. + youboraOptions.setContentPackage(prop.getContentPackage()); + youboraOptions.setContentSaga(prop.getContentSaga()); + youboraOptions.setContentTvShow(prop.getContentTvShow()); + youboraOptions.setContentSeason(prop.getContentSeason()); + youboraOptions.setContentEpisodeTitle(prop.getContentEpisodeTitle()); + youboraOptions.setContentChannel(prop.getContentChannel()); + youboraOptions.setContentId(prop.getContentId()); + youboraOptions.setContentImdbId(prop.getContentImdbId()); + youboraOptions.setContentGracenoteId(prop.getContentGracenoteId()); + youboraOptions.setContentLanguage(prop.getContentLanguage()); + youboraOptions.setContentSubtitles(prop.getContentSubtitles()); + youboraOptions.setContentContractedResolution(prop.getContentContractedResolution()); + youboraOptions.setContentPlaybackType(prop.getContentPlaybackType()); + youboraOptions.setContentDrm(prop.getContentDrm()); + youboraOptions.setContentEncodingVideoCodec(prop.getContentEncodingVideoCodec()); + youboraOptions.setContentEncodingAudioCodec(prop.getContentEncodingAudioCodec()); + youboraOptions.setContentEncodingCodecProfile(prop.getContentEncodingCodecProfile()); + youboraOptions.setContentEncodingContainerFormat(prop.getContentEncodingContainerFormat()); + } + + /** + * Containing mixed extra information about the content like: director, + * parental rating, device info or the audio channels. + * @return bundle having properties + */ + private Bundle getContentMetaDataBundle() { Properties prop = getProperties(); - Bundle propertiesBunble = new Bundle(); - propertiesBunble.putString("genre", (prop.getGenre() != null) ? prop.getGenre() : ""); - propertiesBunble.putString("type", (prop.getType() != null) ? prop.getType() : ""); - propertiesBunble.putString("transaction_type", (prop.getTransactionType() != null) ? prop.getTransactionType() : ""); - propertiesBunble.putString("year", (prop.getYear() != null) ? prop.getYear() : ""); - propertiesBunble.putString("cast", (prop.getCast() != null) ? prop.getCast() : ""); - propertiesBunble.putString("director", (prop.getDirector() != null) ? prop.getDirector() : ""); - propertiesBunble.putString("owner", (prop.getOwner() != null) ? prop.getOwner() : ""); - propertiesBunble.putString("parental", (prop.getParental() != null) ? prop.getParental() : ""); - propertiesBunble.putString("price", (prop.getPrice() != null) ? prop.getPrice() : ""); - propertiesBunble.putString("rating", (prop.getRating() != null) ? prop.getRating() : ""); - propertiesBunble.putString("audioType", (prop.getAudioType() != null) ? prop.getAudioType() : ""); - propertiesBunble.putString("audioChannels", (prop.getAudioChannels() != null) ? prop.getAudioChannels() : ""); - propertiesBunble.putString("device", (prop.getDevice() != null) ? prop.getDevice() : ""); - propertiesBunble.putString("quality", (prop.getQuality() != null) ? prop.getQuality() : ""); - return propertiesBunble; + if (prop == null) { + return new Bundle(); + } + + Bundle propertiesBundle = new Bundle(); + propertiesBundle.putString("director", (prop.getDirector() != null) ? prop.getDirector() : ""); + propertiesBundle.putString("parental", (prop.getParental() != null) ? prop.getParental() : ""); + propertiesBundle.putString("audioType", (prop.getAudioType() != null) ? prop.getAudioType() : ""); + propertiesBundle.putString("audioChannels", (prop.getAudioChannels() != null) ? prop.getAudioChannels() : ""); + propertiesBundle.putString("device", (prop.getDevice() != null) ? prop.getDevice() : ""); + propertiesBundle.putString("rating", (prop.getRating() != null) ? prop.getRating() : ""); + propertiesBundle.putString("year", (prop.getYear() != null) ? prop.getYear() : ""); + propertiesBundle.putString("cast", (prop.getCast() != null) ? prop.getCast() : ""); + propertiesBundle.putString("owner", (prop.getOwner() != null) ? prop.getOwner() : ""); + + return propertiesBundle; } public JsonObject toJson() { @@ -258,7 +291,7 @@ public JsonObject toJson() { JsonPrimitive username = new JsonPrimitive(getUsername() != null ? getUsername() : ""); JsonPrimitive userType = new JsonPrimitive(getUserType() != null ? getUserType() : ""); JsonPrimitive houseHoldId = new JsonPrimitive(getHouseHoldId() != null ? getHouseHoldId() : ""); - JsonPrimitive isObfuscateIP = new JsonPrimitive(isObfuscateIP()); + JsonPrimitive isUserObfuscateIp = new JsonPrimitive(isUserObfuscateIp()); JsonPrimitive httpSecure = new JsonPrimitive(getHttpSecure()); JsonObject device = getDeviceJsonObject(); JsonObject mediaEntry = getMediaJsonObject(); @@ -266,8 +299,7 @@ public JsonObject toJson() { adsEntry.addProperty("campaign", (getAds() != null && getAds().getCampaign() != null) ? getAds().getCampaign() : ""); JsonObject propertiesEntry = getPropertiesJsonObject(); JsonObject extraParamEntry = getExtraParamJsonObject(); - JsonObject youboraConfig = getYouboraConfigJsonObject(accountCode, username, userType, houseHoldId, isObfuscateIP, httpSecure, device, mediaEntry, adsEntry, propertiesEntry, extraParamEntry); - return youboraConfig; + return getYouboraConfigJsonObject(accountCode, username, userType, houseHoldId, isUserObfuscateIp, httpSecure, device, mediaEntry, adsEntry, propertiesEntry, extraParamEntry); } private JsonObject getDeviceJsonObject() { @@ -320,14 +352,14 @@ private JsonObject getMediaJsonObject() { } @NonNull - private JsonObject getYouboraConfigJsonObject(JsonPrimitive accountCode, JsonPrimitive username, JsonPrimitive userType, JsonPrimitive houseHoldId, JsonPrimitive obfuscateIP, JsonPrimitive httpSecure, + private JsonObject getYouboraConfigJsonObject(JsonPrimitive accountCode, JsonPrimitive username, JsonPrimitive userType, JsonPrimitive houseHoldId, JsonPrimitive isUserObfuscateIp, JsonPrimitive httpSecure, JsonObject device, JsonObject mediaEntry, JsonObject adsEntry, JsonObject propertiesEntry, JsonObject extraParamEntry) { JsonObject youboraConfig = new JsonObject(); youboraConfig.add("accountCode", accountCode); youboraConfig.add("username", username); youboraConfig.add("userType", userType); youboraConfig.add("houseHoldId", houseHoldId); - youboraConfig.add("obfuscateIP", obfuscateIP); + youboraConfig.add("obfuscateIP", isUserObfuscateIp); youboraConfig.add("httpSecure", httpSecure); youboraConfig.add("device", device); From 989df08e50cd0fa87ef2e3aabcd3d120a1f46161 Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Thu, 12 Dec 2019 14:58:24 +0530 Subject: [PATCH 055/143] - userObfuscateIp as the JSON key (#32) * - userObfuscateIp as the JSON key --- .../youbora/pluginconfig/YouboraConfig.java | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index dd4ee7c..8923e30 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -359,7 +359,7 @@ private JsonObject getYouboraConfigJsonObject(JsonPrimitive accountCode, JsonPri youboraConfig.add("username", username); youboraConfig.add("userType", userType); youboraConfig.add("houseHoldId", houseHoldId); - youboraConfig.add("obfuscateIP", isUserObfuscateIp); + youboraConfig.add("userObfuscateIp", isUserObfuscateIp); youboraConfig.add("httpSecure", httpSecure); youboraConfig.add("device", device); @@ -392,6 +392,26 @@ private JsonObject getPropertiesJsonObject() { propertiesEntry.addProperty("audioChannels", (prop.getAudioChannels() != null) ? prop.getAudioChannels() : ""); propertiesEntry.addProperty("device", (prop.getDevice() != null) ? prop.getDevice() : ""); propertiesEntry.addProperty("quality", (prop.getQuality() != null) ? prop.getQuality() : ""); + + propertiesEntry.addProperty("contentPackage", (prop.getContentPackage() != null) ? prop.getContentPackage() : ""); + propertiesEntry.addProperty("contentSaga", (prop.getContentSaga() != null) ? prop.getContentSaga() : ""); + propertiesEntry.addProperty("contentTvShow", (prop.getContentTvShow() != null) ? prop.getContentTvShow() : ""); + propertiesEntry.addProperty("contentSeason", (prop.getContentSeason() != null) ? prop.getContentSeason() : ""); + propertiesEntry.addProperty("contentEpisodeTitle", (prop.getContentEpisodeTitle() != null) ? prop.getContentEpisodeTitle() : ""); + propertiesEntry.addProperty("contentChannel", (prop.getContentChannel() != null) ? prop.getContentChannel() : ""); + propertiesEntry.addProperty("contentId", (prop.getContentId() != null) ? prop.getContentId() : ""); + propertiesEntry.addProperty("contentImdbId", (prop.getContentImdbId() != null) ? prop.getContentImdbId() : ""); + propertiesEntry.addProperty("contentGracenoteId", (prop.getContentGracenoteId() != null) ? prop.getContentGracenoteId() : ""); + propertiesEntry.addProperty("contentLanguage", (prop.getContentLanguage() != null) ? prop.getContentLanguage() : ""); + propertiesEntry.addProperty("contentSubtitles", (prop.getContentSubtitles() != null) ? prop.getContentSubtitles() : ""); + propertiesEntry.addProperty("contentContractedResolution", (prop.getContentContractedResolution() != null) ? prop.getContentContractedResolution() : ""); + propertiesEntry.addProperty("contentPlaybackType", (prop.getContentPlaybackType() != null) ? prop.getContentPlaybackType() : ""); + propertiesEntry.addProperty("contentDrm", (prop.getContentDrm() != null) ? prop.getContentDrm() : ""); + propertiesEntry.addProperty("contentEncodingVideoCodec", (prop.getContentEncodingVideoCodec() != null) ? prop.getContentEncodingVideoCodec() : ""); + propertiesEntry.addProperty("contentEncodingAudioCodec", (prop.getContentEncodingAudioCodec() != null) ? prop.getContentEncodingAudioCodec() : ""); + propertiesEntry.addProperty("contentEncodingCodecProfile", (prop.getContentEncodingCodecProfile() != null) ? prop.getContentEncodingCodecProfile() : ""); + propertiesEntry.addProperty("contentEncodingContainerFormat", (prop.getContentEncodingContainerFormat() != null) ? prop.getContentEncodingContainerFormat() : ""); + return propertiesEntry; } From 06b997cbe81cfaf77a92d325dd8ef7502749ed5b Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Tue, 24 Dec 2019 17:00:48 +0530 Subject: [PATCH 056/143] FEM-2747 Upgrade plugin to 6.6.4 (#33) - Internally handling Subtitle and Audio track change and setting to npaw options - Added missing params to mediaEntry JSON - Checking options nullability in npaw object --- youboraplugin/build.gradle | 2 +- .../plugins/youbora/YouboraPlugin.java | 45 +++++++++++++++++++ .../youbora/pluginconfig/YouboraConfig.java | 9 ++-- 3 files changed, 52 insertions(+), 4 deletions(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 0b8c0d8..0bddb38 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -31,7 +31,7 @@ dependencies { implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' //implementation project(":playkit") - api 'com.npaw.youbora:youboralib:6.6.3' + api 'com.npaw.youbora:youboralib:6.6.4' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.1.1' diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index 559b7b6..7b25287 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -11,10 +11,15 @@ import com.kaltura.playkit.PKPlugin; import com.kaltura.playkit.Player; import com.kaltura.playkit.PlayerEvent; +import com.kaltura.playkit.player.AudioTrack; +import com.kaltura.playkit.player.PKTracks; +import com.kaltura.playkit.player.TextTrack; import com.kaltura.playkit.plugin.youbora.BuildConfig; import com.kaltura.playkit.plugins.youbora.pluginconfig.YouboraConfig; import com.npaw.youbora.lib6.plugin.Options; +import java.util.List; + import static com.kaltura.playkit.plugins.youbora.pluginconfig.YouboraConfig.KEY_HOUSEHOLD_ID; /** @@ -83,6 +88,24 @@ private void loadPlugin() { } }); + messageBus.addListener(this, PlayerEvent.tracksAvailable, event -> { + if (npawPlugin != null && npawPlugin.getOptions() != null) { + handleTracksAvailable(event, npawPlugin); + } + }); + + messageBus.addListener(this, PlayerEvent.textTrackChanged, event -> { + if (npawPlugin != null && npawPlugin.getOptions() != null) { + npawPlugin.getOptions().setContentSubtitles(event.newTrack.getLanguage()); + } + }); + + messageBus.addListener(this, PlayerEvent.audioTrackChanged, event -> { + if (npawPlugin != null && npawPlugin.getOptions() != null) { + npawPlugin.getOptions().setContentLanguage(event.newTrack.getLanguage()); + } + }); + messageBus.addListener(this, PlayerEvent.durationChanged, event -> { log.d("YouboraPlugin DURATION_CHANGE"); }); @@ -206,6 +229,28 @@ private void stopMonitoring() { } } + /** + * Player tracks available handler. + * + * @param event = TracksAvailable event. + */ + private void handleTracksAvailable(PlayerEvent.TracksAvailable event, NPAWPlugin npawPlugin) { + PKTracks trackInfo = event.tracksInfo; + if (trackInfo != null) { + List trackInfoAudioTracks = trackInfo.getAudioTracks(); + int defaultAudioTrackIndex = trackInfo.getDefaultAudioTrackIndex(); + if (defaultAudioTrackIndex < trackInfoAudioTracks.size() && trackInfoAudioTracks.get(defaultAudioTrackIndex) != null) { + npawPlugin.getOptions().setContentLanguage(trackInfoAudioTracks.get(defaultAudioTrackIndex).getLanguage()); + } + + List trackInfoTextTracks = trackInfo.getTextTracks(); + int defaultTextTrackIndex = trackInfo.getDefaultTextTrackIndex(); + if (defaultTextTrackIndex < trackInfoTextTracks.size() && trackInfoTextTracks.get(defaultTextTrackIndex) != null) { + npawPlugin.getOptions().setContentSubtitles(trackInfoTextTracks.get(defaultTextTrackIndex).getLanguage()); + } + } + } + private static Options parseConfig(Object config) { if (config instanceof YouboraConfig) { houseHoldId = ((YouboraConfig) config).getHouseHoldId(); diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index 8923e30..96c05e5 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -185,11 +185,10 @@ public Options getYouboraOptions() { if (media != null) { youboraOptions.setContentIsLive(media.getIsLive()); - youboraOptions.setContentIsLiveNoSeek((media.getIsDVR() != null) ? !media.getIsDVR() : null); + youboraOptions.setContentIsLiveNoSeek((media.getIsDVR() != null) ? !media.getIsDVR() : Boolean.FALSE); youboraOptions.setContentDuration(media.getDuration()); youboraOptions.setContentTitle(media.getTitle()); youboraOptions.setProgram(media.getTitle2()); - youboraOptions.setContentTransactionCode(media.getTransactionCode()); } youboraOptions.setAdResource(null); @@ -343,11 +342,15 @@ private JsonObject getMediaJsonObject() { return mediaEntry; } + mediaEntry.addProperty("resource", media.getResource() != null ? media.getResource() : ""); mediaEntry.addProperty("isLive", media.getIsLive() != null ? media.getIsLive() : Boolean.FALSE); + mediaEntry.addProperty("isDVR", media.getIsDVR() != null ? media.getIsDVR() : Boolean.FALSE); mediaEntry.addProperty("title", media.getTitle() != null ? media.getTitle() : ""); + mediaEntry.addProperty("title2", media.getTitle2() != null ? media.getTitle2() : ""); if (media.getDuration() != null) { mediaEntry.addProperty("duration", media.getDuration()); } + mediaEntry.addProperty("transactionCode", media.getTransactionCode() != null ? media.getTransactionCode() : ""); return mediaEntry; } @@ -380,7 +383,7 @@ private JsonObject getPropertiesJsonObject() { Properties prop = getProperties(); propertiesEntry.addProperty("genre", (prop.getGenre() != null) ? prop.getGenre() : ""); propertiesEntry.addProperty("type", (prop.getType() != null) ? prop.getType() : ""); - propertiesEntry.addProperty("transaction_type", (prop.getTransactionType() != null) ? prop.getTransactionType() : ""); + propertiesEntry.addProperty("transactionType", (prop.getTransactionType() != null) ? prop.getTransactionType() : ""); propertiesEntry.addProperty("year", (prop.getYear() != null) ? prop.getYear() : ""); propertiesEntry.addProperty("cast", (prop.getCast() != null) ? prop.getCast() : ""); propertiesEntry.addProperty("director", (prop.getDirector() != null) ? prop.getDirector() : ""); From 64ecd01a79ab023ca510f40a2bb32caefcbb51bc Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 1 Jan 2020 11:48:13 +0200 Subject: [PATCH 057/143] FEM-2782 - add support in kalturaInfo in youbora properties (#34) * add support in kalturaInfo in youbora properties "kalturaInfo": { "entryId": "0_u7exia0g", "uiConfId": "", "sessionId": "f86e4bcc-e38c-4e58-8fad-57494e33f0e0:26bbc18a-0a59-47e8-9ee2-05c37557ed0c" } --- .../playkit/plugins/youbora/YouboraPlugin.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index 7b25287..3f68a3e 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -130,6 +130,7 @@ protected void onUpdateMedia(PKMediaConfig mediaConfig) { pluginManager.resetPlaybackValues(); pluginManager.registerListeners(); } + addKalturaInfoProperty(mediaConfig); pluginManager.setMediaConfig(mediaConfig); pluginManager.setHouseHoldId(houseHoldId); } @@ -149,6 +150,22 @@ protected void onUpdateMedia(PKMediaConfig mediaConfig) { } } + private void addKalturaInfoProperty(PKMediaConfig mediaConfig) { + if (npawPlugin != null && + npawPlugin.getOptions() != null && + npawPlugin.getOptions().getContentMetadata() != null && + player != null && + mediaConfig != null && + mediaConfig.getMediaEntry() != null && + mediaConfig.getMediaEntry().getMetadata() != null + ) { + Bundle kalturaInfoBundle = new Bundle(); + kalturaInfoBundle.putString("entryId", mediaConfig.getMediaEntry().getMetadata().get("entryId")); + kalturaInfoBundle.putString("sessionId", player.getSessionId()); + npawPlugin.getOptions().getContentMetadata().putBundle("kalturaInfo", kalturaInfoBundle); + } + } + @Override protected void onUpdateConfig(Object config) { log.d("youbora - onUpdateConfig"); From 41734f252f13bdd9f88e5aa0c8ba4c361da836a3 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Sun, 19 Jan 2020 11:45:31 +0200 Subject: [PATCH 058/143] remove default to false for isLive in youbora config (#35) * remove default to false for isLive in youbora config so incase this is not passed in config it will be calculated internally * add missing @Override --- .../playkit/plugins/youbora/PKYouboraPlayerAdapter.java | 7 +++++++ .../plugins/youbora/pluginconfig/YouboraConfig.java | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index 2a7b01f..dfb3f05 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -326,14 +326,17 @@ public void unregisterListeners() { } + @Override public Long getBitrate() { return this.lastReportedBitrate; } + @Override public Long getThroughput() { return this.lastReportedThroughput; } + @Override public String getRendition() { return lastReportedRendition; } @@ -364,10 +367,12 @@ public String getHouseholdId() { return houseHoldId; } + @Override public Double getPlayhead() { return (lastReportedMediaPosition != null && lastReportedMediaPosition >= 0) ? lastReportedMediaPosition : 0; } + @Override public String getResource() { //log.d("getResource = " + lastReportedResource); return lastReportedResource; @@ -389,6 +394,7 @@ public Integer getDroppedFrames() { // return lastPlayrate // } + @Override public String getTitle() { if (mediaConfig == null || mediaConfig.getMediaEntry() == null) { return "unknown"; @@ -397,6 +403,7 @@ public String getTitle() { } } + @Override public Boolean getIsLive() { Boolean isLive = Boolean.FALSE; if (mediaConfig != null && mediaConfig.getMediaEntry() != null && (player == null || player.getDuration() <= 0)) { diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index 96c05e5..da5a092 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -343,10 +343,10 @@ private JsonObject getMediaJsonObject() { } mediaEntry.addProperty("resource", media.getResource() != null ? media.getResource() : ""); - mediaEntry.addProperty("isLive", media.getIsLive() != null ? media.getIsLive() : Boolean.FALSE); + mediaEntry.addProperty("isLive", media.getIsLive()); mediaEntry.addProperty("isDVR", media.getIsDVR() != null ? media.getIsDVR() : Boolean.FALSE); mediaEntry.addProperty("title", media.getTitle() != null ? media.getTitle() : ""); - mediaEntry.addProperty("title2", media.getTitle2() != null ? media.getTitle2() : ""); + mediaEntry.addProperty("title2", media.getTitle2() != null ? media.getTitle2() : ""); if (media.getDuration() != null) { mediaEntry.addProperty("duration", media.getDuration()); } From 35ddec6f34527a2146d9d731a221df5a96411303 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 1 Apr 2020 12:29:18 +0300 Subject: [PATCH 059/143] upgrade gradle 3.6.2 _ android sdk 29 --- build.gradle | 2 +- gradle.properties | 3 +++ gradle/wrapper/gradle-wrapper.properties | 5 ++--- youboraplugin/build.gradle | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index af2696d..418416e 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ buildscript { maven { url "https://jitpack.io" } } dependencies { - classpath 'com.android.tools.build:gradle:3.4.2' + classpath 'com.android.tools.build:gradle:3.6.2' classpath 'com.novoda:bintray-release:0.9.1' diff --git a/gradle.properties b/gradle.properties index aac7c9b..6d8cf36 100644 --- a/gradle.properties +++ b/gradle.properties @@ -15,3 +15,6 @@ org.gradle.jvmargs=-Xmx1536m # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true +android.useAndroidX=true +android.enableJetifier=true + diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 759564a..79027c5 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,6 @@ -#Thu Nov 02 14:57:13 IST 2017 +#Wed Apr 01 12:27:53 IDT 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip - +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 0bddb38..96dc97b 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -2,14 +2,14 @@ apply plugin: 'com.android.library' apply from: 'version.gradle' android { - compileSdkVersion 28 + compileSdkVersion 29 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } defaultConfig { minSdkVersion 16 - targetSdkVersion 28 + targetSdkVersion 29 versionName libVersion testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" From e2f2856e7a7510caf46d3d704504f8d4fdbebbdb Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 1 Apr 2020 12:30:07 +0300 Subject: [PATCH 060/143] upgrade gradle 3.6.2 _ android sdk 29 --- youboraplugin/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 96dc97b..1ae259d 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -13,7 +13,6 @@ android { versionName libVersion testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } buildTypes { From 879c3badb079fb9a7f3c6d8c58c7a22ca3853721 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 8 Apr 2020 11:40:20 +0300 Subject: [PATCH 061/143] FEM-9957 - add missing support in appName & appReleaseVersion (#37) * add missing support in appName & appReleaseVersion --- .../youbora/pluginconfig/YouboraConfig.java | 56 +++++++++++++++++-- 1 file changed, 52 insertions(+), 4 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index da5a092..f10f8ea 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -41,6 +41,10 @@ public class YouboraConfig { private boolean httpSecure = true; // youbora events will be sent via https + private String appName = ""; + + private String appReleaseVersion = ""; + private Device device; private Media media; @@ -83,6 +87,22 @@ public void setHttpSecure(boolean httpSecure) { this.httpSecure = httpSecure; } + public String getAppName() { + return appName; + } + + public void setAppName(String appName) { + this.appName = appName; + } + + public String getAppReleaseVersion() { + return appReleaseVersion; + } + + public void setAppReleaseVersion(String appReleaseVersion) { + this.appReleaseVersion = appReleaseVersion; + } + public String getHouseHoldId() { return houseHoldId; } @@ -146,6 +166,8 @@ public Options getYouboraOptions() { youboraOptions.setAccountCode(accountCode); youboraOptions.setUsername(username); youboraOptions.setUserType(userType); + youboraOptions.setAppName(appName); + youboraOptions.setAppReleaseVersion(appReleaseVersion); youboraOptions.setUserObfuscateIp(userObfuscateIp); youboraOptions.setHttpSecure(httpSecure); @@ -155,7 +177,6 @@ public Options getYouboraOptions() { youboraOptions.setDeviceCode(null); //TODO // List of device codes http://mapi.youbora.com:8081/devices youboraOptions.setContentCdn(null); - if (device != null) { if (device.getDeviceCode() != null) { //Generic Data by code see in Device class what Codes are available @@ -289,6 +310,8 @@ public JsonObject toJson() { JsonPrimitive accountCode = new JsonPrimitive(getAccountCode() != null ? getAccountCode() : ""); JsonPrimitive username = new JsonPrimitive(getUsername() != null ? getUsername() : ""); JsonPrimitive userType = new JsonPrimitive(getUserType() != null ? getUserType() : ""); + JsonPrimitive appName = new JsonPrimitive(getAppName() != null ? getAppName() : ""); + JsonPrimitive appReleaseVersion = new JsonPrimitive(getAppReleaseVersion() != null ? getAppReleaseVersion() : ""); JsonPrimitive houseHoldId = new JsonPrimitive(getHouseHoldId() != null ? getHouseHoldId() : ""); JsonPrimitive isUserObfuscateIp = new JsonPrimitive(isUserObfuscateIp()); JsonPrimitive httpSecure = new JsonPrimitive(getHttpSecure()); @@ -298,7 +321,19 @@ public JsonObject toJson() { adsEntry.addProperty("campaign", (getAds() != null && getAds().getCampaign() != null) ? getAds().getCampaign() : ""); JsonObject propertiesEntry = getPropertiesJsonObject(); JsonObject extraParamEntry = getExtraParamJsonObject(); - return getYouboraConfigJsonObject(accountCode, username, userType, houseHoldId, isUserObfuscateIp, httpSecure, device, mediaEntry, adsEntry, propertiesEntry, extraParamEntry); + return getYouboraConfigJsonObject(accountCode, + username, + userType, + appName, + appReleaseVersion, + houseHoldId, + isUserObfuscateIp, + httpSecure, + device, + mediaEntry, + adsEntry, + propertiesEntry, + extraParamEntry); } private JsonObject getDeviceJsonObject() { @@ -355,12 +390,25 @@ private JsonObject getMediaJsonObject() { } @NonNull - private JsonObject getYouboraConfigJsonObject(JsonPrimitive accountCode, JsonPrimitive username, JsonPrimitive userType, JsonPrimitive houseHoldId, JsonPrimitive isUserObfuscateIp, JsonPrimitive httpSecure, - JsonObject device, JsonObject mediaEntry, JsonObject adsEntry, JsonObject propertiesEntry, JsonObject extraParamEntry) { + private JsonObject getYouboraConfigJsonObject(JsonPrimitive accountCode, + JsonPrimitive username, + JsonPrimitive userType, + JsonPrimitive appName, + JsonPrimitive appReleaseVersion, + JsonPrimitive houseHoldId, + JsonPrimitive isUserObfuscateIp, + JsonPrimitive httpSecure, + JsonObject device, + JsonObject mediaEntry, + JsonObject adsEntry, + JsonObject propertiesEntry, + JsonObject extraParamEntry) { JsonObject youboraConfig = new JsonObject(); youboraConfig.add("accountCode", accountCode); youboraConfig.add("username", username); youboraConfig.add("userType", userType); + youboraConfig.add("appName", appName); + youboraConfig.add("appReleaseVersion", appReleaseVersion); youboraConfig.add("houseHoldId", houseHoldId); youboraConfig.add("userObfuscateIp", isUserObfuscateIp); youboraConfig.add("httpSecure", httpSecure); From e7ad01ba9ec931ef12b1a3eb10e95f9db01c1301 Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Sun, 12 Apr 2020 17:41:29 +0530 Subject: [PATCH 062/143] FEC-9916 Upgrade Youbora plugin to 6.7.3 (#36) * - Upgrade plugin to 6.7.3 * add support in fireQuartile messageBus.addListener(this, AdEvent.firstQuartile, event -> { fireQuartile(1); }); messageBus.addListener(this, AdEvent.midpoint, event -> { fireQuartile(2); }); messageBus.addListener(this, AdEvent.thirdQuartile, event -> { fireQuartile(3); }); * move to the end Co-authored-by: Gilad Nadav --- youboraplugin/build.gradle | 2 +- youboraplugin/libs/YouboraLib-5.3.10.jar | Bin 67647 -> 0 bytes .../plugins/youbora/PKYouboraAdsAdapter.java | 27 ++++++++++++------ .../youbora/PKYouboraPlayerAdapter.java | 10 +++---- .../plugins/youbora/YouboraPlugin.java | 2 ++ .../youbora/pluginconfig/YouboraConfig.java | 2 +- 6 files changed, 28 insertions(+), 15 deletions(-) delete mode 100755 youboraplugin/libs/YouboraLib-5.3.10.jar diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 1ae259d..7e58650 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -30,7 +30,7 @@ dependencies { implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' //implementation project(":playkit") - api 'com.npaw.youbora:youboralib:6.6.4' + api 'com.npaw.youbora:youboralib:6.7.3' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.1.1' diff --git a/youboraplugin/libs/YouboraLib-5.3.10.jar b/youboraplugin/libs/YouboraLib-5.3.10.jar deleted file mode 100755 index f3a3517e57395a7fe89870950024d8228bc97635..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 67647 zcmb5VV~}NQ*DPA-vTbzPwyVpwxyrU}+qP|^%eHOXuD-oboEzuIz3=|cJ0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Io2_xQ0H)t$Fz_FNqsHsw^0Hg@f3o8j{{N_wss70S>#F|~_osTYKMBB(8iz8E3}LPN8w~kH z7=Bb#Q+!0fssGRDKUY=!NdSJ7g^_<`0#eK0W5O?D@S|49V*^Gy{uTp%Rn~r#ka%nW zSJ&TSz^@A3kDK2g8&J^mw;1rN()Z&Q=EnwD_x~*h{A0)cPa5HmyHOt-KsNNZ81RpM z(?2ob$3-}@kFsE4hw&Gq%s(OiII!{9E8f%JCjLw0V8J8i5D?VhA2RS`FZ|^ncmEGy{8s${ diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java index 207c24a..f65ea0a 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java @@ -1,10 +1,10 @@ /* * ============================================================================ * Copyright (C) 2017 Kaltura Inc. - * + * * Licensed under the AGPLv3 license, unless a different license for a * particular library is specified in the applicable library path. - * + * * You may obtain a copy of the License at * https://www.gnu.org/licenses/agpl-3.0.html * ============================================================================ @@ -21,18 +21,17 @@ import com.kaltura.playkit.Player; import com.kaltura.playkit.ads.AdController; import com.kaltura.playkit.ads.PKAdErrorType; - import com.kaltura.playkit.ads.PKAdPluginType; import com.kaltura.playkit.plugins.ads.AdEvent; import com.kaltura.playkit.plugins.ads.AdInfo; import com.kaltura.playkit.utils.Consts; -import com.npaw.youbora.lib6.adapter.PlayerAdapter; +import com.npaw.youbora.lib6.adapter.AdAdapter; /** * @hide */ -class PKYouboraAdsAdapter extends PlayerAdapter { +class PKYouboraAdsAdapter extends AdAdapter { private static final PKLog log = PKLog.get("PKYouboraAdsAdapter"); private boolean isFirstPlay = true; @@ -214,7 +213,7 @@ private void addListeners() { currentAdInfo = event.adInfo; populateAdValues(); if (isNullAdapter()) { - return; + return; } getPlugin().getAdapter().fireStart(); fireStart(); @@ -302,6 +301,18 @@ private void addListeners() { sendReportEvent(event.eventType()); }); + messageBus.addListener(this, AdEvent.firstQuartile, event -> { + fireQuartile(1); + }); + + messageBus.addListener(this, AdEvent.midpoint, event -> { + fireQuartile(2); + }); + + messageBus.addListener(this, AdEvent.thirdQuartile, event -> { + fireQuartile(3); + }); + messageBus.addListener(this, AdEvent.error, event -> { printEventName(event); if (isNullAdapter()) { @@ -369,8 +380,8 @@ private PKAdPluginType getLastReportedAdPluginType() { return lastReportedAdPluginType; } - if (player != null) { - AdController adController = player.getController(AdController.class); + if (getPlayer() != null) { + AdController adController = getPlayer().getController(AdController.class); if (adController != null && !adController.isAdError()) { lastReportedAdPluginType = adController.getAdPluginType(); } else { diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index dfb3f05..77cc5d7 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -406,10 +406,10 @@ public String getTitle() { @Override public Boolean getIsLive() { Boolean isLive = Boolean.FALSE; - if (mediaConfig != null && mediaConfig.getMediaEntry() != null && (player == null || player.getDuration() <= 0)) { + if (mediaConfig != null && mediaConfig.getMediaEntry() != null && (getPlayer() == null || getPlayer().getDuration() <= 0)) { isLive = mediaConfig.getMediaEntry().getMediaType() == PKMediaEntry.MediaEntryType.Live || mediaConfig.getMediaEntry().getMediaType() == PKMediaEntry.MediaEntryType.DvrLive; - } else if (player != null) { - isLive = player.isLive(); + } else if (getPlayer() != null) { + isLive = getPlayer().isLive(); } return isLive; } @@ -426,8 +426,8 @@ private PKAdPluginType getLastReportedAdPluginType() { return lastReportedAdPluginType; } - if (player != null) { - AdController adController = player.getController(AdController.class); + if (getPlayer() != null) { + AdController adController = getPlayer().getController(AdController.class); if (adController != null && !adController.isAdError()) { lastReportedAdPluginType = adController.getAdPluginType(); } else { diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index 3f68a3e..00f070d 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -16,6 +16,8 @@ import com.kaltura.playkit.player.TextTrack; import com.kaltura.playkit.plugin.youbora.BuildConfig; import com.kaltura.playkit.plugins.youbora.pluginconfig.YouboraConfig; +import com.npaw.youbora.lib6.adapter.AdAdapter; +import com.npaw.youbora.lib6.adapter.PlayerAdapter; import com.npaw.youbora.lib6.plugin.Options; import java.util.List; diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index f10f8ea..5656c5d 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -171,7 +171,7 @@ public Options getYouboraOptions() { youboraOptions.setUserObfuscateIp(userObfuscateIp); youboraOptions.setHttpSecure(httpSecure); - youboraOptions.setParseHls(false); + youboraOptions.setParseManifest(false); youboraOptions.setParseCdnNode(false); youboraOptions.setDeviceCode(null); //TODO // List of device codes http://mapi.youbora.com:8081/devices From e670344b33c564369d4a65bf0e2104469815655b Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Sun, 12 Apr 2020 16:04:29 +0300 Subject: [PATCH 063/143] prevent fatal error to be sent more than once (#38) --- .../playkit/plugins/youbora/PKYouboraAdsAdapter.java | 4 +++- .../plugins/youbora/PKYouboraPlayerAdapter.java | 10 ++++++++-- .../kaltura/playkit/plugins/youbora/YouboraPlugin.java | 3 +++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java index f65ea0a..8a46c6a 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java @@ -80,7 +80,9 @@ private void sendReportEvent(Enum anEnum) { @Override public void unregisterListeners() { - messageBus.removeListeners(this); + if (messageBus != null) { + messageBus.removeListeners(this); + } super.unregisterListeners(); } diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index 77cc5d7..cfc6074 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -64,6 +64,7 @@ class PKYouboraPlayerAdapter extends PlayerAdapter { private String houseHoldId; private boolean isAdPlaying; private AdCuePoints adCuePoints; + private boolean isFatalErrorSent; PKYouboraPlayerAdapter(Player player, MessageBus messageBus, PKMediaConfig mediaConfig, String houseHoldId) { super(player); @@ -218,11 +219,13 @@ private void addListeners() { messageBus.addListener(this, PlayerEvent.error, event -> { printReceivedPlayerEvent(event); PKError error = event.error; - if (error != null && !error.isFatal()) { + if (isFatalErrorSent || error != null && !error.isFatal()) { log.v("Error eventType = " + error.errorType + " severity = " + error.severity + " errorMessage = " + error.message); return; } + sendErrorHandler(event); + isFatalErrorSent = true; adCuePoints = null; sendReportEvent(event); }); @@ -321,7 +324,9 @@ private void printReceivedAdEvent(PKEvent event) { @Override public void unregisterListeners() { - messageBus.removeListeners(this); + if (messageBus != null) { + messageBus.removeListeners(this); + } super.unregisterListeners(); } @@ -468,6 +473,7 @@ public void resetValues() { mediaConfig = null; houseHoldId = null; isFirstPlay = true; + isFatalErrorSent = false; } public void resetPlaybackValues() { diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index 00f070d..7270afa 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -220,6 +220,9 @@ public void onDestroy() { if (isMonitoring) { stopMonitoring(); } + if (messageBus != null) { + messageBus.removeListeners(this); + } if (pluginManager != null) { pluginManager.unregisterListeners(); pluginManager = null; From 2ccf7c6e67cb748b759087a45d9258c403a5e202 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Thu, 23 Apr 2020 11:24:37 +0300 Subject: [PATCH 064/143] add missing support in adBreakStart adBreakEnded --- .../playkit/plugins/youbora/PKYouboraAdsAdapter.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java index 8a46c6a..5e1e680 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java @@ -199,6 +199,14 @@ private void addListeners() { sendReportEvent(event.eventType()); }); + messageBus.addListener(this, AdEvent.adBreakStarted, event -> { + fireAdBreakStart(); + }); + + messageBus.addListener(this, AdEvent.adBreakEnded, event -> { + fireAdBreakStop(); + }); + messageBus.addListener(this, AdEvent.loaded, event -> { printEventName(event); if (isNullAdapter()) { @@ -240,6 +248,7 @@ private void addListeners() { if (isNullAdapter()) { return; } + currentAdInfo = event.adInfo; lastReportedAdPlayhead = Long.valueOf(currentAdInfo.getAdPlayHead() / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); lastReportedAdBitrate = currentAdInfo.getMediaBitrate(); @@ -314,7 +323,7 @@ private void addListeners() { messageBus.addListener(this, AdEvent.thirdQuartile, event -> { fireQuartile(3); }); - + messageBus.addListener(this, AdEvent.error, event -> { printEventName(event); if (isNullAdapter()) { From dd68c6129b0d913ad69ac00f302463cf1387c258 Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Mon, 1 Jun 2020 14:27:55 +0530 Subject: [PATCH 065/143] - Upgrade plugin to 6.7.8 (#39) --- youboraplugin/build.gradle | 2 +- .../java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 7e58650..0cd7847 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -30,7 +30,7 @@ dependencies { implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' //implementation project(":playkit") - api 'com.npaw.youbora:youboralib:6.7.3' + api 'com.npaw.youbora:youboralib:6.7.8' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.1.1' diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index 7270afa..faa2dcd 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -16,8 +16,6 @@ import com.kaltura.playkit.player.TextTrack; import com.kaltura.playkit.plugin.youbora.BuildConfig; import com.kaltura.playkit.plugins.youbora.pluginconfig.YouboraConfig; -import com.npaw.youbora.lib6.adapter.AdAdapter; -import com.npaw.youbora.lib6.adapter.PlayerAdapter; import com.npaw.youbora.lib6.plugin.Options; import java.util.List; From a45d883b9712b133f4dd3508a3b9278f0fcf9a25 Mon Sep 17 00:00:00 2001 From: ealfonso93 Date: Wed, 22 Jul 2020 15:02:27 +0200 Subject: [PATCH 066/143] EC-10336 - add custom adAdapter support (#40) * add adAdapter support * add support for FastData config * add support for FastDataConfig on the rest of the configs, need to update the plugin version once released * bump youboralib to 6.5.13 --- build.gradle | 1 - youboraplugin/build.gradle | 2 +- .../playkit/plugins/youbora/NPAWPlugin.java | 5 ++- .../plugins/youbora/YouboraPlugin.java | 37 +++++++++++++++++-- .../pluginconfig/YouboraAdAdapterConfig.java | 33 +++++++++++++++++ .../youbora/pluginconfig/YouboraConfig.java | 11 ++++++ 6 files changed, 82 insertions(+), 7 deletions(-) create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraAdAdapterConfig.java diff --git a/build.gradle b/build.gradle index 418416e..4698ac5 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,6 @@ buildscript { classpath 'com.android.tools.build:gradle:3.6.2' classpath 'com.novoda:bintray-release:0.9.1' - // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 0cd7847..67af270 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -30,7 +30,7 @@ dependencies { implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' //implementation project(":playkit") - api 'com.npaw.youbora:youboralib:6.7.8' + api 'com.npaw.youbora:youboralib:6.7.13' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.1.1' diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/NPAWPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/NPAWPlugin.java index 3895a51..9c8dad3 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/NPAWPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/NPAWPlugin.java @@ -2,6 +2,7 @@ import android.content.Context; +import com.npaw.youbora.lib6.comm.transform.ViewTransform; import com.npaw.youbora.lib6.plugin.Options; import com.npaw.youbora.lib6.plugin.Plugin; @@ -11,7 +12,7 @@ public class NPAWPlugin extends Plugin { - public NPAWPlugin(Options options, Context context) { - super(options, context); + public NPAWPlugin(Options options, Context context, ViewTransform.FastDataConfig fastDataConfig) { + super(options, context, fastDataConfig); } } diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index faa2dcd..112984c 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -15,7 +15,11 @@ import com.kaltura.playkit.player.PKTracks; import com.kaltura.playkit.player.TextTrack; import com.kaltura.playkit.plugin.youbora.BuildConfig; +import com.kaltura.playkit.plugins.youbora.pluginconfig.YouboraAdAdapterConfig; import com.kaltura.playkit.plugins.youbora.pluginconfig.YouboraConfig; +import com.npaw.youbora.lib6.adapter.AdAdapter; +import com.npaw.youbora.lib6.comm.transform.ViewTransform; +import com.npaw.youbora.lib6.constants.FastDataConfigFields; import com.npaw.youbora.lib6.plugin.Options; import java.util.List; @@ -38,6 +42,8 @@ public class YouboraPlugin extends PKPlugin { private Player player; private MessageBus messageBus; private static String houseHoldId; + private static AdAdapter customAdAdapter; + private static ViewTransform.FastDataConfig fastDataConfig; private boolean isMonitoring = false; private boolean isAdsMonitoring = false; @@ -72,7 +78,7 @@ protected void onLoad(final Player player, Object config, final MessageBus messa this.pluginConfig = parseConfig(config); //YouboraLog.setDebugLevel(YouboraLog.Level.VERBOSE); - npawPlugin = new NPAWPlugin(pluginConfig, context); + npawPlugin = new NPAWPlugin(pluginConfig, context, fastDataConfig); loadPlugin(); } @@ -145,7 +151,12 @@ protected void onUpdateMedia(PKMediaConfig mediaConfig) { adsManager.resetAdValues(); adsManager.registerListeners(); } - npawPlugin.setAdsAdapter(adsManager); + if (customAdAdapter != null) { + npawPlugin.setAdsAdapter(customAdAdapter); + } else { + npawPlugin.setAdsAdapter(adsManager); + } + isAdsMonitoring = true; } } @@ -274,16 +285,36 @@ private void handleTracksAvailable(PlayerEvent.TracksAvailable event, NPAWPlugin private static Options parseConfig(Object config) { if (config instanceof YouboraConfig) { houseHoldId = ((YouboraConfig) config).getHouseHoldId(); + fastDataConfig = ((YouboraConfig) config).getFastDataConfig(); return ((YouboraConfig) config).getYouboraOptions(); } else if (config instanceof JsonObject) { YouboraConfig youboraConfig = new Gson().fromJson(((JsonObject) config), YouboraConfig.class); houseHoldId = youboraConfig.getHouseHoldId(); + fastDataConfig = youboraConfig.getFastDataConfig(); return youboraConfig.getYouboraOptions(); } else if (config instanceof Bundle) { - Options options = new Options((Bundle) config); + Bundle configBundle = (Bundle) config; + Options options = new Options(configBundle); houseHoldId = ((Bundle) config).getString(KEY_HOUSEHOLD_ID); + fillFastDataConfig(configBundle); + return options; + } else if (config instanceof YouboraAdAdapterConfig) { + YouboraAdAdapterConfig adAdapterConfig = (YouboraAdAdapterConfig) config; + Options options = new Options(adAdapterConfig.getOptBundle()); + houseHoldId = adAdapterConfig.getOptBundle().getString(KEY_HOUSEHOLD_ID); + customAdAdapter = adAdapterConfig.getCustomAdsAdapter(); + fillFastDataConfig(adAdapterConfig.getOptBundle()); return options; } return null; } + + private static void fillFastDataConfig(Bundle configBundle) { + fastDataConfig = new ViewTransform.FastDataConfig(); + fastDataConfig.host = configBundle.getString(FastDataConfigFields.FASTDATA_CONFIG_HOST); + fastDataConfig.code = configBundle.getString(FastDataConfigFields.FASTDATA_CONFIG_CODE); + fastDataConfig.pingTime = configBundle.getInt(FastDataConfigFields.FASTDATA_CONFIG_PINGTIME); + fastDataConfig.beatTime = configBundle.getInt(FastDataConfigFields.FASTDATA_CONFIG_BEATTIME); + fastDataConfig.expirationTime = configBundle.getInt(FastDataConfigFields.FASTDATA_CONFIG_EXPIRATIONTIME); + } } diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraAdAdapterConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraAdAdapterConfig.java new file mode 100644 index 0000000..dd471a4 --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraAdAdapterConfig.java @@ -0,0 +1,33 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig; + +import android.os.Bundle; + +import com.npaw.youbora.lib6.adapter.AdAdapter; + +public class YouboraAdAdapterConfig { + + private AdAdapter adAdapter; + + private Bundle optBundle; + + public YouboraAdAdapterConfig(AdAdapter adAdapter, Bundle optBundle) { + this.adAdapter = adAdapter; + this.optBundle = optBundle; + } + + public void setCustomAdsAdapter(AdAdapter adAdapter) { + this.adAdapter = adAdapter; + } + + public AdAdapter getCustomAdsAdapter() { + return adAdapter; + } + + public Bundle getOptBundle() { + return optBundle; + } + + public void setOptBundle(Bundle optBundle) { + this.optBundle = optBundle; + } +} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index 5656c5d..b7dfa74 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -7,6 +7,7 @@ import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; +import com.npaw.youbora.lib6.comm.transform.ViewTransform; import com.npaw.youbora.lib6.plugin.Options; public class YouboraConfig { @@ -55,6 +56,8 @@ public class YouboraConfig { private ExtraParams extraParams; + private ViewTransform.FastDataConfig fastDataConfig; + public String getAccountCode() { return accountCode; } @@ -159,6 +162,14 @@ public void setExtraParams(ExtraParams extraParams) { this.extraParams = extraParams; } + public ViewTransform.FastDataConfig getFastDataConfig() { + return fastDataConfig; + } + + public void setFastDataConfig(ViewTransform.FastDataConfig fastDataConfig) { + this.fastDataConfig = fastDataConfig; + } + public Options getYouboraOptions() { Options youboraOptions = new Options(); From ba23e703418cab45f65fce27e426e59d5f5ad4a4 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 12 Aug 2020 14:23:57 +0300 Subject: [PATCH 067/143] Upgrade to Youbora V6.7.14 (#41) --- youboraplugin/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 67af270..bf77aa7 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -30,7 +30,7 @@ dependencies { implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' //implementation project(":playkit") - api 'com.npaw.youbora:youboralib:6.7.13' + api 'com.npaw.youbora:youboralib:6.7.14' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.1.1' From 488d410645beacf316cc31b6482d3b3cec33aba8 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Mon, 5 Oct 2020 10:03:02 +0300 Subject: [PATCH 068/143] FEC-10491 avoid filling the fast data config with invalid values + upgrade to 6.7.16 (#42) * avoid filling the fast data config with junk * 6.7.16 upgrade --- youboraplugin/build.gradle | 2 +- .../com/kaltura/playkit/plugins/youbora/YouboraPlugin.java | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index bf77aa7..9d565e5 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -30,7 +30,7 @@ dependencies { implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' //implementation project(":playkit") - api 'com.npaw.youbora:youboralib:6.7.14' + api 'com.npaw.youbora:youboralib:6.7.16' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.1.1' diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index 112984c..9670e81 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -310,6 +310,12 @@ private static Options parseConfig(Object config) { } private static void fillFastDataConfig(Bundle configBundle) { + + fastDataConfig = null; + if (configBundle == null) { + return; + } + fastDataConfig = new ViewTransform.FastDataConfig(); fastDataConfig.host = configBundle.getString(FastDataConfigFields.FASTDATA_CONFIG_HOST); fastDataConfig.code = configBundle.getString(FastDataConfigFields.FASTDATA_CONFIG_CODE); @@ -318,3 +324,4 @@ private static void fillFastDataConfig(Bundle configBundle) { fastDataConfig.expirationTime = configBundle.getInt(FastDataConfigFields.FASTDATA_CONFIG_EXPIRATIONTIME); } } + From 28ec335a84aed7b62567c899dd6a7dfe231a882c Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 7 Oct 2020 14:05:13 +0300 Subject: [PATCH 069/143] upgrade yoboralib 6.7.17 (#44) upgrade androidx --- youboraplugin/build.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 9d565e5..b404f22 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -30,11 +30,11 @@ dependencies { implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' //implementation project(":playkit") - api 'com.npaw.youbora:youboralib:6.7.16' + api 'com.npaw.youbora:youboralib:6.7.17' testImplementation 'junit:junit:4.12' - androidTestImplementation 'androidx.test:runner:1.1.1' - implementation 'androidx.annotation:annotation:1.0.2' + androidTestImplementation 'androidx.test:runner:1.3.0' + implementation 'androidx.annotation:annotation:1.1.0' } From 88630b87c21df924a3ee7170d018866c4ca13cbe Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Mon, 12 Oct 2020 18:40:48 +0300 Subject: [PATCH 070/143] FEC-10464 - send youbora ad start event when on the correct time (#45) * send midroll && postroll - youbora ad start event when it really starts and not in ad loaded event * fix DAI youbora + ads * fix first play --- .../plugins/youbora/PKYouboraAdsAdapter.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java index 5e1e680..a1deb07 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java @@ -24,6 +24,7 @@ import com.kaltura.playkit.ads.PKAdPluginType; import com.kaltura.playkit.plugins.ads.AdEvent; import com.kaltura.playkit.plugins.ads.AdInfo; +import com.kaltura.playkit.plugins.ads.AdPositionType; import com.kaltura.playkit.utils.Consts; import com.npaw.youbora.lib6.adapter.AdAdapter; @@ -200,7 +201,9 @@ private void addListeners() { }); messageBus.addListener(this, AdEvent.adBreakStarted, event -> { - fireAdBreakStart(); + if(currentAdInfo != null && currentAdInfo.getAdPositionType() != AdPositionType.PRE_ROLL) { + fireAdBreakStart(); + } }); messageBus.addListener(this, AdEvent.adBreakEnded, event -> { @@ -215,18 +218,18 @@ private void addListeners() { log.d("AD LOADED: isFirstPlay = " + isFirstPlay); if (isFirstPlay) { isFirstPlay = false; - getPlugin().getAdapter().fireStart(); if (PKAdPluginType.server.equals(getLastReportedAdPluginType())) { + getPlugin().getAdapter().fireStart(); getPlugin().getAdapter().fireJoin(); + fireStart(); } } currentAdInfo = event.adInfo; populateAdValues(); - if (isNullAdapter()) { - return; + if (PKAdPluginType.server.equals(getLastReportedAdPluginType())) { + getPlugin().getAdapter().fireStart(); + fireStart(); } - getPlugin().getAdapter().fireStart(); - fireStart(); sendReportEvent(event.eventType()); }); @@ -361,6 +364,9 @@ private void addListeners() { if (isNullAdapter()) { return; } + + getPlugin().getAdapter().fireStart(); + fireStart(); printLastReportedAdPlayhead(); fireBufferBegin(); sendReportEvent(event.eventType()); From aa8929248add46f6d7e9ca6a0e6574e256ab94ab Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Sun, 8 Nov 2020 15:54:10 +0530 Subject: [PATCH 071/143] - Upgrade to SDK version 30 (Android-11) (#46) --- youboraplugin/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index b404f22..5d02867 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -2,14 +2,14 @@ apply plugin: 'com.android.library' apply from: 'version.gradle' android { - compileSdkVersion 29 + compileSdkVersion 30 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } defaultConfig { minSdkVersion 16 - targetSdkVersion 29 + targetSdkVersion 30 versionName libVersion testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" From 2e1f3654228337eb688a527a58928521c3c23a2f Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Tue, 10 Nov 2020 14:31:27 +0530 Subject: [PATCH 072/143] FEC-10629 Added Content CDN and Device Code for youbora config Json (#47) --- .../playkit/plugins/youbora/pluginconfig/Device.java | 7 ++++--- .../plugins/youbora/pluginconfig/Properties.java | 11 +++++++++++ .../plugins/youbora/pluginconfig/YouboraConfig.java | 6 ++---- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.java index 36b856e..461b7d8 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.java @@ -5,9 +5,10 @@ public class Device { //If device info config is not given Youbora will add this info according to their internal logic so actually this is optional configuration -//// If you want generic information -//youboraOptions.setDeviceCode("xbox360"); // Device will be detected as Xbox 360 -// +// Youbora's device code. If specified it will rewrite info gotten from user agent. +// See a list of codes in http://mapi.youbora.com:8081/devices +// youboraOptions.setDeviceCode("xbox360"); // Device will be detected as Xbox 360 + //// Or in case you want full customised information of the device: // //youboraOptions.setDeviceModel("s8"); diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Properties.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Properties.java index 2610510..a5e5b3a 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Properties.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Properties.java @@ -35,6 +35,9 @@ public class Properties { private String contentEncodingAudioCodec; private String contentEncodingCodecProfile; private String contentEncodingContainerFormat; + // Fetch Codename of the CDN where the content is streaming from. + // See a list of codes in http://mapi.youbora.com:8081/cdns + private String contentCdnCode; public String getGenre() { return genre; @@ -291,4 +294,12 @@ public String getContentEncodingContainerFormat() { public void setContentEncodingContainerFormat(String contentEncodingContainerFormat) { this.contentEncodingContainerFormat = contentEncodingContainerFormat; } + + public String getContentCdnCode() { + return contentCdnCode; + } + + public void setContentCdnCode(String contentCdnCode) { + this.contentCdnCode = contentCdnCode; + } } \ No newline at end of file diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index b7dfa74..c21eaa8 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -170,7 +170,6 @@ public void setFastDataConfig(ViewTransform.FastDataConfig fastDataConfig) { this.fastDataConfig = fastDataConfig; } - public Options getYouboraOptions() { Options youboraOptions = new Options(); @@ -185,9 +184,6 @@ public Options getYouboraOptions() { youboraOptions.setParseManifest(false); youboraOptions.setParseCdnNode(false); - youboraOptions.setDeviceCode(null); //TODO // List of device codes http://mapi.youbora.com:8081/devices - youboraOptions.setContentCdn(null); - if (device != null) { if (device.getDeviceCode() != null) { //Generic Data by code see in Device class what Codes are available @@ -273,6 +269,7 @@ private void setContentPropertiesBundle(Options youboraOptions) { youboraOptions.setContentPrice(prop.getPrice()); youboraOptions.setContentRendition(prop.getQuality()); // Name or value of the current rendition (quality) of the content. youboraOptions.setContentPackage(prop.getContentPackage()); + youboraOptions.setContentCdn(prop.getContentCdnCode()); youboraOptions.setContentSaga(prop.getContentSaga()); youboraOptions.setContentTvShow(prop.getContentTvShow()); youboraOptions.setContentSeason(prop.getContentSeason()); @@ -456,6 +453,7 @@ private JsonObject getPropertiesJsonObject() { propertiesEntry.addProperty("quality", (prop.getQuality() != null) ? prop.getQuality() : ""); propertiesEntry.addProperty("contentPackage", (prop.getContentPackage() != null) ? prop.getContentPackage() : ""); + propertiesEntry.addProperty("contentCdnCode", (prop.getContentCdnCode() != null) ? prop.getContentCdnCode() : ""); propertiesEntry.addProperty("contentSaga", (prop.getContentSaga() != null) ? prop.getContentSaga() : ""); propertiesEntry.addProperty("contentTvShow", (prop.getContentTvShow() != null) ? prop.getContentTvShow() : ""); propertiesEntry.addProperty("contentSeason", (prop.getContentSeason() != null) ? prop.getContentSeason() : ""); From 90b7b8fbfe5fce0b85717828d0da4ff61ed6b0d4 Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Mon, 4 Jan 2021 14:33:19 +0530 Subject: [PATCH 073/143] FEC-10777 Youbora upgrade to 6.7.24 - add deviceId (#48) - Added deviceId in Device options - Fixed json key for device type - Youbora plugin upgrade to 6.7.24 --- youboraplugin/build.gradle | 2 +- .../playkit/plugins/youbora/pluginconfig/Device.java | 9 +++++++++ .../plugins/youbora/pluginconfig/YouboraConfig.java | 10 +++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 5d02867..419fb45 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -30,7 +30,7 @@ dependencies { implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' //implementation project(":playkit") - api 'com.npaw.youbora:youboralib:6.7.17' + api 'com.npaw.youbora:youboralib:6.7.24' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.3.0' diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.java index 461b7d8..03bb2c0 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.java @@ -19,6 +19,7 @@ public class Device { private String deviceCode; private String brand; + private String id; private String model; private String type; private String osName; @@ -40,6 +41,14 @@ public void setBrand(String brand) { this.brand = brand; } + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + public String getModel() { return model; } diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index c21eaa8..f7a9623 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -194,6 +194,10 @@ public Options getYouboraOptions() { youboraOptions.setDeviceModel(device.getModel()); } + if (device.getId() != null) { + youboraOptions.setDeviceId(device.getId()); + } + if (device.getBrand() != null) { youboraOptions.setDeviceBrand(device.getBrand()); } @@ -359,12 +363,16 @@ private JsonObject getDeviceJsonObject() { deviceJsonObject.addProperty("model", device.getModel()); } + if (device.getId() != null) { + deviceJsonObject.addProperty("id", device.getId()); + } + if (device.getBrand() != null) { deviceJsonObject.addProperty("brand", device.getBrand()); } if (device.getType() != null) { - deviceJsonObject.addProperty("deviceCode", device.getType()); + deviceJsonObject.addProperty("type", device.getType()); } if (device.getOsName() != null) { From 1affe5f34d9192f6529e5b1a2ff0840a4dfcca59 Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Mon, 4 Jan 2021 15:58:49 +0530 Subject: [PATCH 074/143] FEC-10593 Fixed ping event firing when autoplay is false in Kaltura Player (#49) --- .../kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java index a1deb07..961bc38 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java @@ -196,7 +196,9 @@ private void addListeners() { if (isNullAdapter()) { return; } - getPlugin().getAdapter().fireStart(); + if (event.isAutoPlay) { + getPlugin().getAdapter().fireStart(); + } sendReportEvent(event.eventType()); }); From 825fc8c1dc3904c68ee37283cf5f7bff65788bc2 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Thu, 11 Mar 2021 11:18:58 +0200 Subject: [PATCH 075/143] FEC-11018 : Enable the parse.manifest && parse.CdnNode option (#50) * add support in Boolean parseManifest, Boolean parseCdnNode, default = false; add: Boolean parseCdnSwitchHeader; ArrayList cdnNodeList; String cdnNameHeaders; Integer parseCdnTTL; --- .../plugins/youbora/pluginconfig/Parse.java | 61 ++++++++++++++++ .../youbora/pluginconfig/YouboraConfig.java | 72 ++++++++++++++++++- 2 files changed, 130 insertions(+), 3 deletions(-) create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Parse.java diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Parse.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Parse.java new file mode 100644 index 0000000..3e7d58f --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Parse.java @@ -0,0 +1,61 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig; + +import java.util.ArrayList; + +public class Parse { + + private Boolean parseManifest; + private Boolean parseCdnNode; + private Boolean parseCdnSwitchHeader; + private ArrayList cdnNodeList; + private String cdnNameHeaders; + private Integer parseCdnTTL; + + public Boolean getParseManifest() { + return parseManifest; + } + + public void setParseManifest(Boolean parseManifest) { + this.parseManifest = parseManifest; + } + + public Boolean getParseCdnNode() { + return parseCdnNode; + } + + public void setParseCdnNode(Boolean parseCdnNode) { + this.parseCdnNode = parseCdnNode; + } + + public Boolean getParseCdnSwitchHeader() { + return parseCdnSwitchHeader; + } + + public void setParseCdnSwitchHeader(Boolean parseCdnSwitchHeader) { + this.parseCdnSwitchHeader = parseCdnSwitchHeader; + } + + public ArrayList getCdnNodeList() { + return cdnNodeList; + } + + public void setCdnNodeList(ArrayList cdnNodeList) { + this.cdnNodeList = cdnNodeList; + } + + public String getCdnNameHeaders() { + return cdnNameHeaders; + } + + public void setCdnNameHeaders(String cdnNameHeaders) { + this.cdnNameHeaders = cdnNameHeaders; + } + + public Integer getParseCdnTTL() { + return parseCdnTTL; + } + + public void setParseCdnTTL(Integer parseCdnTTL) { + this.parseCdnTTL = parseCdnTTL; + } +} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index f7a9623..adcbe0d 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -5,6 +5,7 @@ import androidx.annotation.NonNull; +import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; import com.npaw.youbora.lib6.comm.transform.ViewTransform; @@ -46,6 +47,8 @@ public class YouboraConfig { private String appReleaseVersion = ""; + private Parse parse; + private Device device; private Media media; @@ -122,6 +125,10 @@ public void setUserObfuscateIp(boolean userObfuscateIp) { this.userObfuscateIp = userObfuscateIp; } + public Parse getParse() { + return parse; + } + public Device getDevice() { return device; } @@ -181,8 +188,26 @@ public Options getYouboraOptions() { youboraOptions.setUserObfuscateIp(userObfuscateIp); youboraOptions.setHttpSecure(httpSecure); - youboraOptions.setParseManifest(false); - youboraOptions.setParseCdnNode(false); + if (parse != null) { + if (parse.getParseManifest() != null) { + youboraOptions.setParseManifest(parse.getParseManifest()); + } + if (parse.getParseCdnNode() != null) { + youboraOptions.setParseCdnNode(parse.getParseCdnNode()); + } + if (parse.getParseCdnSwitchHeader() != null) { + youboraOptions.setParseCdnSwitchHeader(parse.getParseCdnSwitchHeader()); + } + if (parse.getCdnNodeList() != null) { + youboraOptions.setParseCdnNodeList(parse.getCdnNodeList()); + } + if (parse.getCdnNameHeaders() != null) { + youboraOptions.setParseCdnNameHeader(parse.getCdnNameHeaders()); + } + if (parse.getParseCdnTTL() != null) { + youboraOptions.setParseCdnTTL(parse.getParseCdnTTL()); + } + } if (device != null) { if (device.getDeviceCode() != null) { @@ -327,6 +352,7 @@ public JsonObject toJson() { JsonPrimitive houseHoldId = new JsonPrimitive(getHouseHoldId() != null ? getHouseHoldId() : ""); JsonPrimitive isUserObfuscateIp = new JsonPrimitive(isUserObfuscateIp()); JsonPrimitive httpSecure = new JsonPrimitive(getHttpSecure()); + JsonObject parse = getParseJsonObject(); JsonObject device = getDeviceJsonObject(); JsonObject mediaEntry = getMediaJsonObject(); JsonObject adsEntry = new JsonObject(); @@ -341,6 +367,7 @@ public JsonObject toJson() { houseHoldId, isUserObfuscateIp, httpSecure, + parse, device, mediaEntry, adsEntry, @@ -348,6 +375,44 @@ public JsonObject toJson() { extraParamEntry); } + private JsonObject getParseJsonObject() { + JsonObject parseJsonObject = new JsonObject(); + Parse parse = getParse(); + if (parse == null) { + return parseJsonObject; + } + + if (parse.getParseManifest() != null) { + parseJsonObject.addProperty("parseManifest", parse.getParseManifest()); + } + + if (parse.getParseCdnNode() != null) { + parseJsonObject.addProperty("parseCdnNode", parse.getParseCdnNode()); + } + + if (parse.getParseCdnSwitchHeader() != null) { + parseJsonObject.addProperty("parseCdnSwitchHeader", parse.getParseCdnSwitchHeader()); + } + + if (parse.getCdnNodeList() != null) { + JsonArray cdnNodeListJsonArray = new JsonArray(); + for(String cdn : parse.getCdnNodeList()) { + cdnNodeListJsonArray.add(cdn); + } + parseJsonObject.add("cdnNodeList", cdnNodeListJsonArray); + } + + if (parse.getCdnNameHeaders() != null) { + parseJsonObject.addProperty("cdnNameHeaders", parse.getCdnNameHeaders() ); + } + + if (parse.getParseCdnTTL() != null) { + parseJsonObject.addProperty("parseCdnTTL", parse.getParseCdnTTL()); + } + + return parseJsonObject; + } + private JsonObject getDeviceJsonObject() { JsonObject deviceJsonObject = new JsonObject(); Device device = getDevice(); @@ -414,6 +479,7 @@ private JsonObject getYouboraConfigJsonObject(JsonPrimitive accountCode, JsonPrimitive houseHoldId, JsonPrimitive isUserObfuscateIp, JsonPrimitive httpSecure, + JsonObject parse, JsonObject device, JsonObject mediaEntry, JsonObject adsEntry, @@ -428,7 +494,7 @@ private JsonObject getYouboraConfigJsonObject(JsonPrimitive accountCode, youboraConfig.add("houseHoldId", houseHoldId); youboraConfig.add("userObfuscateIp", isUserObfuscateIp); youboraConfig.add("httpSecure", httpSecure); - + youboraConfig.add("parse", parse); youboraConfig.add("device", device); youboraConfig.add("media", mediaEntry); youboraConfig.add("ads", adsEntry); From 81ed397f25b3ef3e080038ce04411af3bd08a0c8 Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Thu, 8 Apr 2021 15:09:00 +0530 Subject: [PATCH 076/143] - Upgrade youbora to v6.7.32 (#51) - Added JFrog in repositories --- youboraplugin/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 419fb45..2455060 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -30,7 +30,7 @@ dependencies { implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' //implementation project(":playkit") - api 'com.npaw.youbora:youboralib:6.7.24' + api 'com.nicepeopleatwork:youboralib:6.7.32' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.3.0' @@ -42,5 +42,5 @@ repositories { google() jcenter() maven { url "https://jitpack.io" } - + maven { url "https://npaw.jfrog.io/artifactory/youbora/" } } From 96b5a2acffb77080155023aa023ee65c9f824b3b Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Sun, 11 Apr 2021 22:13:15 +0300 Subject: [PATCH 077/143] FEC-10991 maven central (#52) * bintray --> maven central * add java docs --- README.md | 8 +- build.gradle | 5 +- gradle.properties | 13 ++++ youboraplugin/build.gradle | 10 ++- youboraplugin/gradle-mvn-push.gradle | 109 +++++++++++++++++++++++++++ youboraplugin/gradle.properties | 3 + youboraplugin/version.gradle | 19 ----- 7 files changed, 141 insertions(+), 26 deletions(-) create mode 100644 youboraplugin/gradle-mvn-push.gradle create mode 100644 youboraplugin/gradle.properties diff --git a/README.md b/README.md index e90ec37..5087e93 100644 --- a/README.md +++ b/README.md @@ -1 +1,7 @@ -# playkit-android-youbora \ No newline at end of file +[![CI Status](https://api.travis-ci.org/kaltura/playkit-android-youbora.svg?branch=develop)](https://travis-ci.org/github/kaltura/playkit-android-youbora) +[![Download](https://img.shields.io/maven-central/v/com.kaltura.playkit/youboraplugin?label=Download)](https://search.maven.org/artifact/com.kaltura.playkit/youboraplugin) +[![License](https://img.shields.io/badge/license-AGPLv3-black.svg)](https://github.com/kaltura/playkit-android-kava/blob/master/LICENSE) +![Android](https://img.shields.io/badge/platform-android-green.svg) + + +# playkit-android-youbora diff --git a/build.gradle b/build.gradle index 4698ac5..9939c3f 100644 --- a/build.gradle +++ b/build.gradle @@ -5,12 +5,12 @@ buildscript { repositories { jcenter() google() + mavenCentral() maven { url "https://jitpack.io" } } dependencies { classpath 'com.android.tools.build:gradle:3.6.2' - classpath 'com.novoda:bintray-release:0.9.1' - + // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } @@ -20,6 +20,7 @@ allprojects { repositories { google() jcenter() + mavenCentral() maven { url "https://jitpack.io" } } } diff --git a/gradle.properties b/gradle.properties index 6d8cf36..4be7299 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,3 +18,16 @@ org.gradle.jvmargs=-Xmx1536m android.useAndroidX=true android.enableJetifier=true +VERSION_NAME=libVersion +GROUP=com.kaltura.playkit + +POM_DESCRIPTION=PlayKit Youbora Plugin +POM_URL=https://github.com/kaltura/playkit-android-youbora +POM_SCM_URL=https://github.com/kaltura/playkit-android-youbora +POM_SCM_CONNECTION=scm:git@https://github.com/kaltura/playkit-android-youbora.git +POM_SCM_DEV_CONNECTION=scm:git@https://github.com/kaltura/playkit-android-youbora.git +POM_LICENCE_NAME=GNU Affero General Public License, Version 3.0 +POM_LICENCE_URL=https://www.gnu.org/licenses/agpl-3.0.html +POM_LICENCE_DIST=repo +POM_DEVELOPER_ID=playkitdev +POM_DEVELOPER_NAME=Playkit Dev diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 2455060..77c9058 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -30,17 +30,19 @@ dependencies { implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' //implementation project(":playkit") - api 'com.nicepeopleatwork:youboralib:6.7.32' + api 'com.npaw.youbora:youboralib:6.7.24' - testImplementation 'junit:junit:4.12' + testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test:runner:1.3.0' - implementation 'androidx.annotation:annotation:1.1.0' + implementation 'androidx.annotation:annotation:1.2.0' } repositories { google() jcenter() + mavenCentral() maven { url "https://jitpack.io" } - maven { url "https://npaw.jfrog.io/artifactory/youbora/" } } + +apply from: './gradle-mvn-push.gradle' diff --git a/youboraplugin/gradle-mvn-push.gradle b/youboraplugin/gradle-mvn-push.gradle new file mode 100644 index 0000000..31d090a --- /dev/null +++ b/youboraplugin/gradle-mvn-push.gradle @@ -0,0 +1,109 @@ +apply plugin: 'maven' +apply plugin: 'signing' + +def isReleaseBuild() { + return VERSION_NAME.contains("dev") == false +} + +def getReleaseRepositoryUrl() { + return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL + : "https://oss.sonatype.org/service/local/staging/deploy/maven2/" +} + +def getSnapshotRepositoryUrl() { + return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL + : "https://oss.sonatype.org/content/repositories/snapshots/" +} + +def getRepositoryUsername() { + return System.getenv("NEXUS_USERNAME") +} + +def getRepositoryPassword() { + return System.getenv("NEXUS_PASSWORD") +} + +afterEvaluate { project -> + uploadArchives { + repositories { + mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + + pom.groupId = GROUP + pom.artifactId = POM_ARTIFACT_ID + VERSION_NAME = libVersion + pom.version = VERSION_NAME + + repository(url: getReleaseRepositoryUrl()) { + authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) + } + snapshotRepository(url: getSnapshotRepositoryUrl()) { + authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) + } + + pom.project { + name POM_NAME + packaging POM_PACKAGING + description POM_DESCRIPTION + url POM_URL + + scm { + url POM_SCM_URL + connection POM_SCM_CONNECTION + developerConnection POM_SCM_DEV_CONNECTION + } + + licenses { + license { + name POM_LICENCE_NAME + url POM_LICENCE_URL + distribution POM_LICENCE_DIST + } + } + + developers { + developer { + id POM_DEVELOPER_ID + name POM_DEVELOPER_NAME + } + } + } + } + } + } + + signing { + allprojects { ext."signing.keyId" = System.getenv("MAVEN_KEYID") } + allprojects { ext."signing.password" = System.getenv("MAVEN_PASSWORD") } + allprojects { ext."signing.secretKeyRingFile" = System.getenv("MAVEN_SECRING_PATH") } + + required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") } + sign configurations.archives + } + + task androidJavadocs(type: Javadoc) { + source = android.sourceSets.main.java.srcDirs + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) + } + + afterEvaluate { + androidJavadocs.classpath += files(android.libraryVariants.collect { variant -> + variant.javaCompileProvider.get().classpath.files + }) + } + + task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { + classifier = 'javadoc' + from androidJavadocs.destinationDir + } + + task androidSourcesJar(type: Jar) { + classifier = 'sources' + from android.sourceSets.main.java.sourceFiles + } + + artifacts { + archives androidSourcesJar + archives androidJavadocsJar + } +} diff --git a/youboraplugin/gradle.properties b/youboraplugin/gradle.properties new file mode 100644 index 0000000..8354b48 --- /dev/null +++ b/youboraplugin/gradle.properties @@ -0,0 +1,3 @@ +POM_NAME=Youboraplugin +POM_ARTIFACT_ID=youboraplugin +POM_PACKAGING=aar diff --git a/youboraplugin/version.gradle b/youboraplugin/version.gradle index 5aa4a6c..1d80a85 100644 --- a/youboraplugin/version.gradle +++ b/youboraplugin/version.gradle @@ -9,22 +9,3 @@ if (libVersion == 'dev') { def commit = proc.text.trim() ext.libVersion = 'dev.' + commit } - - -// Publish to Bintray -try { - apply plugin: 'bintray-release' - - publish { - artifactId = 'youboraplugin' - desc = 'PlayKit Kava Plugin' - repoName = 'android' - userOrg = 'kaltura' - groupId = 'com.kaltura.playkit' - publishVersion = libVersion - autoPublish = true - licences = ['AGPL-3.0'] - } -} catch (UnknownPluginException ignored) { - // Ignore - it's ok not to have this plugin - it's only used for bintray uploads. -} From 1e013fbd650e8de5eb46e8601ccd8a562835bb8f Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Mon, 12 Apr 2021 14:59:35 +0300 Subject: [PATCH 078/143] run gradle-mvn-push only if relevant (#54) --- youboraplugin/build.gradle | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 77c9058..d5006a0 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -45,4 +45,6 @@ repositories { maven { url "https://jitpack.io" } } -apply from: './gradle-mvn-push.gradle' +if (hasProperty('VERSION_NAME')) { + apply from: './gradle-mvn-push.gradle' +} From 1d06f69ea2db44172025873fa29dcb00133cd0b2 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 21 Apr 2021 12:32:38 +0300 Subject: [PATCH 079/143] FEC-11127 - Align Config (#56) * align to youbora Options model * populate values only if they are given * add missing configs * upgrade youbora 6.7.32 --- youboraplugin/build.gradle | 3 +- .../pluginconfig/AdCustomDimensions.java | 106 ++ .../plugins/youbora/pluginconfig/Ads.java | 92 +- .../plugins/youbora/pluginconfig/App.java | 22 + .../plugins/youbora/pluginconfig/Content.java | 378 ++++++ .../pluginconfig/CustomDimensions.java | 206 +++ .../plugins/youbora/pluginconfig/Device.java | 77 +- .../plugins/youbora/pluginconfig/Errors.java | 35 + .../youbora/pluginconfig/ExtraParams.java | 96 -- .../plugins/youbora/pluginconfig/Media.java | 76 -- .../plugins/youbora/pluginconfig/Network.java | 44 + .../youbora/pluginconfig/Properties.java | 141 +- .../youbora/pluginconfig/YouboraConfig.java | 1175 +++++++++++------ .../YouboraConfigJsonBuilder.java | 563 ++++++++ 14 files changed, 2359 insertions(+), 655 deletions(-) create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/AdCustomDimensions.java create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/App.java create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Content.java create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/CustomDimensions.java create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Errors.java delete mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/ExtraParams.java delete mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Media.java create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Network.java create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index d5006a0..34ec830 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -30,7 +30,7 @@ dependencies { implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' //implementation project(":playkit") - api 'com.npaw.youbora:youboralib:6.7.24' + api 'com.nicepeopleatwork:youboralib:6.7.32' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test:runner:1.3.0' @@ -42,6 +42,7 @@ repositories { google() jcenter() mavenCentral() + maven { url "https://npaw.jfrog.io/artifactory/youbora/" } maven { url "https://jitpack.io" } } diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/AdCustomDimensions.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/AdCustomDimensions.java new file mode 100644 index 0000000..74f3850 --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/AdCustomDimensions.java @@ -0,0 +1,106 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig; + +import com.google.gson.annotations.SerializedName; + +public class AdCustomDimensions { + @SerializedName(value="adCustomDimension1", alternate={"param1"}) + private String adCustomDimension1; + @SerializedName(value="adCustomDimension2", alternate={"param2"}) + private String adCustomDimension2; + @SerializedName(value="adCustomDimension3", alternate={"param3"}) + private String adCustomDimension3; + @SerializedName(value="adCustomDimension4", alternate={"param4"}) + private String adCustomDimension4; + @SerializedName(value="adCustomDimension5", alternate={"param5"}) + private String adCustomDimension5; + @SerializedName(value="adCustomDimension6", alternate={"param6"}) + private String adCustomDimension6; + @SerializedName(value="adCustomDimension7", alternate={"param7"}) + private String adCustomDimension7; + @SerializedName(value="adCustomDimension8", alternate={"param8"}) + private String adCustomDimension8; + @SerializedName(value="adCustomDimension9", alternate={"param9"}) + private String adCustomDimension9; + @SerializedName(value="adCustomDimension10", alternate={"param10"}) + private String adCustomDimension10; + + public String getAdCustomDimension1() { + return adCustomDimension1; + } + + public void setAdCustomDimension1(String adCustomDimension1) { + this.adCustomDimension1 = adCustomDimension1; + } + + public String getAdCustomDimension2() { + return adCustomDimension2; + } + + public void setAdCustomDimension2(String adCustomDimension2) { + this.adCustomDimension2 = adCustomDimension2; + } + + public String getAdCustomDimension3() { + return adCustomDimension3; + } + + public void setAdCustomDimension3(String adCustomDimension3) { + this.adCustomDimension3 = adCustomDimension3; + } + + public String getAdCustomDimension4() { + return adCustomDimension4; + } + + public void setAdCustomDimension4(String adCustomDimension4) { + this.adCustomDimension4 = adCustomDimension4; + } + + public String getAdCustomDimension5() { + return adCustomDimension5; + } + + public void setAdCustomDimension5(String adCustomDimension5) { + this.adCustomDimension5 = adCustomDimension5; + } + + public String getAdCustomDimension6() { + return adCustomDimension6; + } + + public void setAdCustomDimension6(String adCustomDimension6) { + this.adCustomDimension6 = adCustomDimension6; + } + + public String getAdCustomDimension7() { + return adCustomDimension7; + } + + public void setAdCustomDimension7(String adCustomDimension7) { + this.adCustomDimension7 = adCustomDimension7; + } + + public String getAdCustomDimension8() { + return adCustomDimension8; + } + + public void setAdCustomDimension8(String adCustomDimension8) { + this.adCustomDimension8 = adCustomDimension8; + } + + public String getAdCustomDimension9() { + return adCustomDimension9; + } + + public void setAdCustomDimension9(String adCustomDimension9) { + this.adCustomDimension9 = adCustomDimension9; + } + + public String getAdCustomDimension10() { + return adCustomDimension10; + } + + public void setAdCustomDimension10(String adCustomDimension10) { + this.adCustomDimension10 = adCustomDimension10; + } +} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Ads.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Ads.java index 92b2da6..d778e68 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Ads.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Ads.java @@ -1,23 +1,95 @@ package com.kaltura.playkit.plugins.youbora.pluginconfig; +import com.google.gson.annotations.SerializedName; + +import java.util.ArrayList; + public class Ads { - private String campaign; - private ExtraParams extraParams; + private ArrayList adBreaksTime; + @SerializedName(value="adCampaign", alternate={"campaign"}) + private String adCampaign; + private String adCreativeId; + private Integer adExpectedBreaks; + //private Bundle adExpectedPattern; + private Integer adGivenBreaks; + //private Bundle adMetadata; + private String adProvider; + private String adResource; + private String adTitle; + + @SerializedName(value="adCustomDimensions", alternate={"extraParams"}) + private AdCustomDimensions adCustomDimensions; + + public ArrayList getAdBreaksTime() { + return adBreaksTime; + } + + public void setAdBreaksTime(ArrayList adBreaksTime) { + this.adBreaksTime = adBreaksTime; + } + + public String getAdCampaign() { + return adCampaign; + } + + public void setAdCampaign(String adCampaign) { + this.adCampaign = adCampaign; + } + + public String getAdCreativeId() { + return adCreativeId; + } + + public void setAdCreativeId(String adCreativeId) { + this.adCreativeId = adCreativeId; + } + + public Integer getAdExpectedBreaks() { + return adExpectedBreaks; + } + + public void setAdExpectedBreaks(Integer adExpectedBreaks) { + this.adExpectedBreaks = adExpectedBreaks; + } + + public Integer getAdGivenBreaks() { + return adGivenBreaks; + } + + public void setAdGivenBreaks(Integer adGivenBreaks) { + this.adGivenBreaks = adGivenBreaks; + } + + public String getAdProvider() { + return adProvider; + } + + public void setAdProvider(String adProvider) { + this.adProvider = adProvider; + } + + public String getAdResource() { + return adResource; + } + + public void setAdResource(String adResource) { + this.adResource = adResource; + } - public String getCampaign() { - return campaign; + public String getAdTitle() { + return adTitle; } - public void setCampaign(String campaign) { - this.campaign = campaign; + public void setAdTitle(String adTitle) { + this.adTitle = adTitle; } - public ExtraParams getExtraParams() { - return extraParams; + public AdCustomDimensions getAdCustomDimensions() { + return adCustomDimensions; } - public void setExtraParams(ExtraParams extraParams) { - this.extraParams = extraParams; + public void setAdCustomDimensions(AdCustomDimensions adCustomDimensions) { + this.adCustomDimensions = adCustomDimensions; } } \ No newline at end of file diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/App.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/App.java new file mode 100644 index 0000000..9d88d93 --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/App.java @@ -0,0 +1,22 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig; + +public class App { + private String appName = ""; + private String appReleaseVersion = ""; + + public String getAppName() { + return appName; + } + + public void setAppName(String appName) { + this.appName = appName; + } + + public String getAppReleaseVersion() { + return appReleaseVersion; + } + + public void setAppReleaseVersion(String appReleaseVersion) { + this.appReleaseVersion = appReleaseVersion; + } +} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Content.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Content.java new file mode 100644 index 0000000..cbaefd4 --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Content.java @@ -0,0 +1,378 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig; + +import com.google.gson.annotations.SerializedName; + +public class Content { + + private Long contentBitrate; + private String contentCdn; + private String contentCdnNode; + private String contentCdnType; + private String contentChannel; + private String contentContractedResolution; + private String contentCost; + + private String contentDrm; + @SerializedName(value="contentDuration", alternate={"duration"}) + private Double contentDuration; + + private String contentEncodingAudioCodec; + private String contentEncodingCodecProfile; + //private Bundle contentEncodingCodecSettings + private String contentEncodingContainerFormat; + private String contentEncodingVideoCodec; + @SerializedName(value="contentEpisodeTitle", alternate={"title2"}) + private String contentEpisodeTitle; + + private Double contentFps; + + private String contentGenre; + private String contentGracenoteId; + + private String contentId; + private String contentImdbId; + @SerializedName(value="contentIsLive", alternate={"isLive"}) + private Boolean contentIsLive; + @SerializedName(value="contentIsLiveNoSeek", alternate={"isDVR"}) + private Boolean contentIsLiveNoSeek; + + private String contentLanguage; + + //private Bundle contentMetrics; + + private String contentPackage; + private String contentPlaybackType; + private String contentPrice; + private String contentProgram; + + private String contentRendition; + @SerializedName(value="contentResource", alternate={"resource"}) + private String contentResource; + + private String contentSaga; + private String contentSeason; + private String contentStreamingProtocol; + private String contentSubtitles; + + private Long contentThroughput; + @SerializedName(value="contentTitle", alternate={"title"}) + private String contentTitle; + @SerializedName(value="contentTransactionCode", alternate={"transactionType"}) + private String contentTransactionCode; + private Long contentTotalBytes; + private boolean contentSendTotalBytes; + private String contentTvShow; + private String contentType; + + public Long getContentBitrate() { + return contentBitrate; + } + + public void setContentBitrate(Long contentBitrate) { + this.contentBitrate = contentBitrate; + } + + public String getContentCdn() { + return contentCdn; + } + + public void setContentCdn(String contentCdn) { + this.contentCdn = contentCdn; + } + + public String getContentCdnNode() { + return contentCdnNode; + } + + public void setContentCdnNode(String contentCdnNode) { + this.contentCdnNode = contentCdnNode; + } + + public String getContentCdnType() { + return contentCdnType; + } + + public void setContentCdnType(String contentCdnType) { + this.contentCdnType = contentCdnType; + } + + public String getContentChannel() { + return contentChannel; + } + + public void setContentChannel(String contentChannel) { + this.contentChannel = contentChannel; + } + + public String getContentContractedResolution() { + return contentContractedResolution; + } + + public void setContentContractedResolution(String contentContractedResolution) { + this.contentContractedResolution = contentContractedResolution; + } + + public String getContentCost() { + return contentCost; + } + + public void setContentCost(String contentCost) { + this.contentCost = contentCost; + } + + public String getContentDrm() { + return contentDrm; + } + + public void setContentDrm(String contentDrm) { + this.contentDrm = contentDrm; + } + + public Double getContentDuration() { + return contentDuration; + } + + public void setContentDuration(Double contentDuration) { + this.contentDuration = contentDuration; + } + + public String getContentEncodingAudioCodec() { + return contentEncodingAudioCodec; + } + + public void setContentEncodingAudioCodec(String contentEncodingAudioCodec) { + this.contentEncodingAudioCodec = contentEncodingAudioCodec; + } + + public String getContentEncodingCodecProfile() { + return contentEncodingCodecProfile; + } + + public void setContentEncodingCodecProfile(String contentEncodingCodecProfile) { + this.contentEncodingCodecProfile = contentEncodingCodecProfile; + } + + public String getContentEncodingContainerFormat() { + return contentEncodingContainerFormat; + } + + public void setContentEncodingContainerFormat(String contentEncodingContainerFormat) { + this.contentEncodingContainerFormat = contentEncodingContainerFormat; + } + + public String getContentEncodingVideoCodec() { + return contentEncodingVideoCodec; + } + + public void setContentEncodingVideoCodec(String contentEncodingVideoCodec) { + this.contentEncodingVideoCodec = contentEncodingVideoCodec; + } + + public String getContentEpisodeTitle() { + return contentEpisodeTitle; + } + + public void setContentEpisodeTitle(String contentEpisodeTitle) { + this.contentEpisodeTitle = contentEpisodeTitle; + } + + public Double getContentFps() { + return contentFps; + } + + public void setContentFps(Double contentFps) { + this.contentFps = contentFps; + } + + public String getContentGenre() { + return contentGenre; + } + + public void setContentGenre(String contentGenre) { + this.contentGenre = contentGenre; + } + + public String getContentGracenoteId() { + return contentGracenoteId; + } + + public void setContentGracenoteId(String contentGracenoteId) { + this.contentGracenoteId = contentGracenoteId; + } + + public String getContentId() { + return contentId; + } + + public void setContentId(String contentId) { + this.contentId = contentId; + } + + public String getContentImdbId() { + return contentImdbId; + } + + public void setContentImdbId(String contentImdbId) { + this.contentImdbId = contentImdbId; + } + + public Boolean getContentIsLive() { + return contentIsLive; + } + + public void setContentIsLive(Boolean contentIsLive) { + this.contentIsLive = contentIsLive; + } + + public Boolean getContentIsLiveNoSeek() { + return contentIsLiveNoSeek; + } + + public void setContentIsLiveNoSeek(Boolean contentIsLiveNoSeek) { + this.contentIsLiveNoSeek = contentIsLiveNoSeek; + } + + public String getContentLanguage() { + return contentLanguage; + } + + public void setContentLanguage(String contentLanguage) { + this.contentLanguage = contentLanguage; + } + + public String getContentPackage() { + return contentPackage; + } + + public void setContentPackage(String contentPackage) { + this.contentPackage = contentPackage; + } + + public String getContentPlaybackType() { + return contentPlaybackType; + } + + public void setContentPlaybackType(String contentPlaybackType) { + this.contentPlaybackType = contentPlaybackType; + } + + public String getContentPrice() { + return contentPrice; + } + + public void setContentPrice(String contentPrice) { + this.contentPrice = contentPrice; + } + + public String getContentProgram() { + return contentProgram; + } + + public void setContentProgram(String contentProgram) { + this.contentProgram = contentProgram; + } + + public String getContentRendition() { + return contentRendition; + } + + public void setContentRendition(String contentRendition) { + this.contentRendition = contentRendition; + } + + public String getContentResource() { + return contentResource; + } + + public void setContentResource(String contentResource) { + this.contentResource = contentResource; + } + + public String getContentSaga() { + return contentSaga; + } + + public void setContentSaga(String contentSaga) { + this.contentSaga = contentSaga; + } + + public String getContentSeason() { + return contentSeason; + } + + public void setContentSeason(String contentSeason) { + this.contentSeason = contentSeason; + } + + public String getContentStreamingProtocol() { + return contentStreamingProtocol; + } + + public void setContentStreamingProtocol(String contentStreamingProtocol) { + this.contentStreamingProtocol = contentStreamingProtocol; + } + + public String getContentSubtitles() { + return contentSubtitles; + } + + public void setContentSubtitles(String contentSubtitles) { + this.contentSubtitles = contentSubtitles; + } + + public Long getContentThroughput() { + return contentThroughput; + } + + public void setContentThroughput(Long contentThroughput) { + this.contentThroughput = contentThroughput; + } + + public String getContentTitle() { + return contentTitle; + } + + public void setContentTitle(String contentTitle) { + this.contentTitle = contentTitle; + } + + public String getContentTransactionCode() { + return contentTransactionCode; + } + + public void setContentTransactionCode(String contentTransactionCode) { + this.contentTransactionCode = contentTransactionCode; + } + + public Long getContentTotalBytes() { + return contentTotalBytes; + } + + public void setContentTotalBytes(Long contentTotalBytes) { + this.contentTotalBytes = contentTotalBytes; + } + + public boolean getContentSendTotalBytes() { + return contentSendTotalBytes; + } + + public void setContentSendTotalBytes(boolean contentSendTotalBytes) { + this.contentSendTotalBytes = contentSendTotalBytes; + } + + public String getContentTvShow() { + return contentTvShow; + } + + public void setContentTvShow(String contentTvShow) { + this.contentTvShow = contentTvShow; + } + + public String getContentType() { + return contentType; + } + + public void setContentType(String contentType) { + this.contentType = contentType; + } +} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/CustomDimensions.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/CustomDimensions.java new file mode 100644 index 0000000..b54c5ba --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/CustomDimensions.java @@ -0,0 +1,206 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig; + +import com.google.gson.annotations.SerializedName; + +public class CustomDimensions { + @SerializedName(value="customDimension1", alternate={"param1"}) + private String customDimension1; + @SerializedName(value="customDimension2", alternate={"param2"}) + private String customDimension2; + @SerializedName(value="customDimension3", alternate={"param3"}) + private String customDimension3; + @SerializedName(value="customDimension4", alternate={"param4"}) + private String customDimension4; + @SerializedName(value="customDimension5", alternate={"param5"}) + private String customDimension5; + @SerializedName(value="customDimension6", alternate={"param6"}) + private String customDimension6; + @SerializedName(value="customDimension7", alternate={"param7"}) + private String customDimension7; + @SerializedName(value="customDimension8", alternate={"param8"}) + private String customDimension8; + @SerializedName(value="customDimension9", alternate={"param9"}) + private String customDimension9; + @SerializedName(value="customDimension10", alternate={"param10"}) + private String customDimension10; + @SerializedName(value="customDimension11", alternate={"param11"}) + private String customDimension11; + @SerializedName(value="customDimension12", alternate={"param12"}) + private String customDimension12; + @SerializedName(value="customDimension13", alternate={"param13"}) + private String customDimension13; + @SerializedName(value="customDimension14", alternate={"param14"}) + private String customDimension14; + @SerializedName(value="customDimension15", alternate={"param15"}) + private String customDimension15; + @SerializedName(value="customDimension16", alternate={"param16"}) + private String customDimension16; + @SerializedName(value="customDimension17", alternate={"param17"}) + private String customDimension17; + @SerializedName(value="customDimension18", alternate={"param18"}) + private String customDimension18; + @SerializedName(value="customDimension19", alternate={"param19"}) + private String customDimension19; + @SerializedName(value="customDimension20", alternate={"param20"}) + private String customDimension20; + + public String getCustomDimension1() { + return customDimension1; + } + + public void setCustomDimension1(String customDimension1) { + this.customDimension1 = customDimension1; + } + + public String getCustomDimension2() { + return customDimension2; + } + + public void setCustomDimension2(String customDimension2) { + this.customDimension2 = customDimension2; + } + + public String getCustomDimension3() { + return customDimension3; + } + + public void setCustomDimension3(String customDimension3) { + this.customDimension3 = customDimension3; + } + + public String getCustomDimension4() { + return customDimension4; + } + + public void setCustomDimension4(String customDimension4) { + this.customDimension4 = customDimension4; + } + + public String getCustomDimension5() { + return customDimension5; + } + + public void setCustomDimension5(String customDimension5) { + this.customDimension5 = customDimension5; + } + + public String getCustomDimension6() { + return customDimension6; + } + + public void setCustomDimension6(String customDimension6) { + this.customDimension6 = customDimension6; + } + + public String getCustomDimension7() { + return customDimension7; + } + + public void setCustomDimension7(String customDimension7) { + this.customDimension7 = customDimension7; + } + + public String getCustomDimension8() { + return customDimension8; + } + + public void setCustomDimension8(String customDimension8) { + this.customDimension8 = customDimension8; + } + + public String getCustomDimension9() { + return customDimension9; + } + + public void setCustomDimension9(String customDimension9) { + this.customDimension9 = customDimension9; + } + + public String getCustomDimension10() { + return customDimension10; + } + + public void setCustomDimension10(String customDimension10) { + this.customDimension10 = customDimension10; + } + + public String getCustomDimension11() { + return customDimension11; + } + + public void setCustomDimension11(String customDimension11) { + this.customDimension11 = customDimension11; + } + + public String getCustomDimension12() { + return customDimension12; + } + + public void setCustomDimension12(String customDimension12) { + this.customDimension12 = customDimension12; + } + + public String getCustomDimension13() { + return customDimension13; + } + + public void setCustomDimension13(String customDimension13) { + this.customDimension13 = customDimension13; + } + + public String getCustomDimension14() { + return customDimension14; + } + + public void setCustomDimension14(String customDimension14) { + this.customDimension14 = customDimension14; + } + + public String getCustomDimension15() { + return customDimension15; + } + + public void setCustomDimension15(String customDimension15) { + this.customDimension15 = customDimension15; + } + + public String getCustomDimension16() { + return customDimension16; + } + + public void setCustomDimension16(String customDimension16) { + this.customDimension16 = customDimension16; + } + + public String getCustomDimension17() { + return customDimension17; + } + + public void setCustomDimension17(String customDimension17) { + this.customDimension17 = customDimension17; + } + + public String getCustomDimension18() { + return customDimension18; + } + + public void setCustomDimension18(String customDimension18) { + this.customDimension18 = customDimension18; + } + + public String getCustomDimension19() { + return customDimension19; + } + + public void setCustomDimension19(String customDimension19) { + this.customDimension19 = customDimension19; + } + + public String getCustomDimension20() { + return customDimension20; + } + + public void setCustomDimension20(String customDimension20) { + this.customDimension20 = customDimension20; + } +} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.java index 03bb2c0..5b9e86e 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.java @@ -1,5 +1,7 @@ package com.kaltura.playkit.plugins.youbora.pluginconfig; +import com.google.gson.annotations.SerializedName; + public class Device { //If device info config is not given Youbora will add this info according to their internal logic so actually this is optional configuration @@ -17,13 +19,28 @@ public class Device { //youboraOptions.setDeviceOsName("android"); //youboraOptions.setDeviceOsVersion("8.1"); + @SerializedName(value="deviceBrand", alternate={"brand"}) + private String deviceBrand; private String deviceCode; - private String brand; - private String id; - private String model; - private String type; - private String osName; - private String osVersion; + @SerializedName(value="deviceId", alternate={"id"}) + private String deviceId; + @SerializedName(value="deviceModel", alternate={"model"}) + private String deviceModel; + @SerializedName(value="deviceOsName", alternate={"osName"}) + private String deviceOsName; + @SerializedName(value="deviceOsVersion", alternate={"osVersion"}) + private String deviceOsVersion; + @SerializedName(value="deviceType", alternate={"type"}) + private String deviceType; + private boolean deviceIsAnonymous; + + public String getDeviceBrand() { + return deviceBrand; + } + + public void setDeviceBrand(String deviceBrand) { + this.deviceBrand = deviceBrand; + } public String getDeviceCode() { return deviceCode; @@ -33,52 +50,52 @@ public void setDeviceCode(String deviceCode) { this.deviceCode = deviceCode; } - public String getBrand() { - return brand; + public String getDeviceId() { + return deviceId; } - public void setBrand(String brand) { - this.brand = brand; + public void setDeviceId(String deviceId) { + this.deviceId = deviceId; } - public String getId() { - return id; + public String getDeviceModel() { + return deviceModel; } - public void setId(String id) { - this.id = id; + public void setDeviceModel(String deviceModel) { + this.deviceModel = deviceModel; } - public String getModel() { - return model; + public String getDeviceOsName() { + return deviceOsName; } - public void setModel(String model) { - this.model = model; + public void setDeviceOsName(String deviceOsName) { + this.deviceOsName = deviceOsName; } - public String getType() { - return type; + public String getDeviceOsVersion() { + return deviceOsVersion; } - public void setType(String type) { - this.type = type; + public void setDeviceOsVersion(String deviceOsVersion) { + this.deviceOsVersion = deviceOsVersion; } - public String getOsName() { - return osName; + public String getDeviceType() { + return deviceType; } - public void setOsName(String osName) { - this.osName = osName; + public void setDeviceType(String deviceType) { + this.deviceType = deviceType; } - public String getOsVersion() { - return osVersion; + public boolean getDeviceIsAnonymous() { + return deviceIsAnonymous; } - public void setOsVersion(String osVersion) { - this.osVersion = osVersion; + public void setDeviceIsAnonymous(boolean deviceIsAnonymous) { + this.deviceIsAnonymous = deviceIsAnonymous; } } diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Errors.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Errors.java new file mode 100644 index 0000000..d1f73e0 --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Errors.java @@ -0,0 +1,35 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig; + +import java.util.ArrayList; +import java.util.List; + +public class Errors { + + private String[] errorsIgnore; + private String[] errorsFatal; + private String[] errorsNonFatal; + + public String[] getErrorsIgnore() { + return errorsIgnore; + } + + public void setErrorsIgnore(String[] errorsIgnore) { + this.errorsIgnore = errorsIgnore; + } + + public String[] getErrorsFatal() { + return errorsFatal; + } + + public void setErrorsFatal(String[] errorsFatal) { + this.errorsFatal = errorsFatal; + } + + public String[] getErrorsNonFatal() { + return errorsNonFatal; + } + + public void setErrorsNonFatal(String[] errorsNonFatal) { + this.errorsNonFatal = errorsNonFatal; + } +} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/ExtraParams.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/ExtraParams.java deleted file mode 100644 index 4993dda..0000000 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/ExtraParams.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.kaltura.playkit.plugins.youbora.pluginconfig; - -public class ExtraParams { - - private String param1; - private String param2; - private String param3; - private String param4; - private String param5; - private String param6; - private String param7; - private String param8; - private String param9; - private String param10; - - - public String getParam1() { - return param1; - } - - public void setParam1(String param1) { - this.param1 = param1; - } - - public String getParam2() { - return param2; - } - - public void setParam2(String param2) { - this.param2 = param2; - } - - public String getParam3() { - return param3; - } - - public void setParam3(String param3) { - this.param3 = param3; - } - - public String getParam4() { - return param4; - } - - public void setParam4(String param4) { - this.param4 = param4; - } - - public String getParam5() { - return param5; - } - - public void setParam5(String param5) { - this.param5 = param5; - } - - public String getParam6() { - return param6; - } - - public void setParam6(String param6) { - this.param6 = param6; - } - - public String getParam7() { - return param7; - } - - public void setParam7(String param7) { - this.param7 = param7; - } - - public String getParam8() { - return param8; - } - - public void setParam8(String param8) { - this.param8 = param8; - } - - public String getParam9() { - return param9; - } - - public void setParam9(String param9) { - this.param9 = param9; - } - - public String getParam10() { - return param10; - } - - public void setParam10(String param10) { - this.param10 = param10; - } -} \ No newline at end of file diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Media.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Media.java deleted file mode 100644 index c53a138..0000000 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Media.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.kaltura.playkit.plugins.youbora.pluginconfig; - -public class Media { - - private String resource; - private Boolean isLive; - private Boolean isDVR; - private String title; - private String title2; - private Double duration; - private String transactionCode; - - public String getResource() { - return resource; - } - - public void setResource(String resource) { - this.resource = resource; - } - - public Boolean getLive() { - return isLive; - } - - public void setLive(Boolean live) { - isLive = live; - } - - public Boolean getIsDVR() { - return isDVR; - } - - public void setIsDVR(Boolean isDVR) { - this.isDVR = isDVR; - } - - public Boolean getIsLive() { - return isLive; - } - - public void setIsLive(Boolean isLive) { - this.isLive = isLive; - } - - public String getTitle() { - return title; - } - - public void setTitle(String title) { - this.title = title; - } - - public String getTitle2() { - return title2; - } - - public void setTitle2(String title2) { - this.title2 = title2; - } - - public Double getDuration() { - return duration; - } - - public void setDuration(Double duration) { - this.duration = duration; - } - - public String getTransactionCode() { - return transactionCode; - } - - public void setTransactionCode(String transactionCode) { - this.transactionCode = transactionCode; - } -} \ No newline at end of file diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Network.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Network.java new file mode 100644 index 0000000..6d8f131 --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Network.java @@ -0,0 +1,44 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig; + +public class Network { + /** + * See a list of codes in + * http://mapi.youbora.com:8081/connectionTypes. + */ + private String networkConnectionType; + + /** + * IP of the viewer/user, e.g. "48.15.16.23". + */ + private String networkIP; + + /** + * Name of the internet service provider of the viewer/user. + */ + private String networkIsp; + + + public String getNetworkConnectionType() { + return networkConnectionType; + } + + public void setNetworkConnectionType(String networkConnectionType) { + this.networkConnectionType = networkConnectionType; + } + + public String getNetworkIP() { + return networkIP; + } + + public void setNetworkIP(String networkIP) { + this.networkIP = networkIP; + } + + public String getNetworkIsp() { + return networkIsp; + } + + public void setNetworkIsp(String networkIsp) { + this.networkIsp = networkIsp; + } +} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Properties.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Properties.java index a5e5b3a..6465b22 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Properties.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Properties.java @@ -1,67 +1,14 @@ package com.kaltura.playkit.plugins.youbora.pluginconfig; public class Properties { - - private String genre; - private String type; - private String transactionType; private String year; private String cast; private String director; private String owner; private String parental; - private String price; private String rating; - private String audioType; - private String audioChannels; private String device; - private String quality; - - private String contentPackage; - private String contentSaga; - private String contentTvShow; - private String contentSeason; - private String contentEpisodeTitle; - private String contentChannel; - private String contentId; - private String contentImdbId; - private String contentGracenoteId; - private String contentLanguage; - private String contentSubtitles; - private String contentContractedResolution; - private String contentPlaybackType; - private String contentDrm; - private String contentEncodingVideoCodec; - private String contentEncodingAudioCodec; - private String contentEncodingCodecProfile; - private String contentEncodingContainerFormat; - // Fetch Codename of the CDN where the content is streaming from. - // See a list of codes in http://mapi.youbora.com:8081/cdns - private String contentCdnCode; - - public String getGenre() { - return genre; - } - - public void setGenre(String genre) { - this.genre = genre; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getTransactionType() { - return transactionType; - } - - public void setTransactionType(String transactionType) { - this.transactionType = transactionType; - } + private String audioChannels; public String getYear() { return year; @@ -103,14 +50,6 @@ public void setParental(String parental) { this.parental = parental; } - public String getPrice() { - return price; - } - - public void setPrice(String price) { - this.price = price; - } - public String getRating() { return rating; } @@ -119,12 +58,12 @@ public void setRating(String rating) { this.rating = rating; } - public String getAudioType() { - return audioType; + public String getDevice() { + return device; } - public void setAudioType(String audioType) { - this.audioType = audioType; + public void setDevice(String device) { + this.device = device; } public String getAudioChannels() { @@ -135,12 +74,74 @@ public void setAudioChannels(String audioChannels) { this.audioChannels = audioChannels; } - public String getDevice() { - return device; + /// DEPRECATED LEGACY MOVED TO Media + + private String genre; + private String type; + private String transactionType; + + private String price; + private String audioType; + private String quality; + + private String contentPackage; + private String contentSaga; + private String contentTvShow; + private String contentSeason; + private String contentEpisodeTitle; + private String contentChannel; + private String contentId; + private String contentImdbId; + private String contentGracenoteId; + private String contentLanguage; + private String contentSubtitles; + private String contentContractedResolution; + private String contentPlaybackType; + private String contentDrm; + private String contentEncodingVideoCodec; + private String contentEncodingAudioCodec; + private String contentEncodingCodecProfile; + private String contentEncodingContainerFormat; + private String contentCdnCode; + + public String getGenre() { + return genre; } - public void setDevice(String device) { - this.device = device; + public void setGenre(String genre) { + this.genre = genre; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getTransactionType() { + return transactionType; + } + + public void setTransactionType(String transactionType) { + this.transactionType = transactionType; + } + + public String getPrice() { + return price; + } + + public void setPrice(String price) { + this.price = price; + } + + public String getAudioType() { + return audioType; + } + + public void setAudioType(String audioType) { + this.audioType = audioType; } public String getQuality() { diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index adcbe0d..9e1c1a3 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -8,6 +8,7 @@ import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; +import com.google.gson.annotations.SerializedName; import com.npaw.youbora.lib6.comm.transform.ViewTransform; import com.npaw.youbora.lib6.plugin.Options; @@ -29,12 +30,14 @@ public class YouboraConfig { public static final String KEY_CONTENT_METADATA_RATING = "rating"; - public static final String KEY_CONTENT_METADATA_QUALITY = "quality"; - private String accountCode; private String username; + private String userEmail; + + private String userAnonymousId; + private String userType; // any string - free / paid etc. private String houseHoldId; // which device is used to play @@ -47,17 +50,35 @@ public class YouboraConfig { private String appReleaseVersion = ""; + private boolean isAutoStart = true; + + private boolean isAutoDetectBackground = true; + + private boolean isEnabled = true; + + private boolean isForceInit; + + private boolean isOffline; + + private App app; + private Parse parse; private Device device; - private Media media; + @SerializedName(value="content", alternate={"media"}) + private Content content; + + private Network network; + + private Errors errors; private Ads ads; private Properties properties; - private ExtraParams extraParams; + @SerializedName(value="customDimensions", alternate={"extraParams"}) + private CustomDimensions customDimensions; private ViewTransform.FastDataConfig fastDataConfig; @@ -77,6 +98,22 @@ public void setUsername(String username) { this.username = username; } + public String getUserEmail() { + return userEmail; + } + + public void setUserEmail(String userEmail) { + this.userEmail = userEmail; + } + + public String getUserAnonymousId() { + return userAnonymousId; + } + + public void setUserAnonymousId(String userAnonymousId) { + this.userAnonymousId = userAnonymousId; + } + public String getUserType() { return userType; } @@ -117,7 +154,7 @@ public void setHouseHoldId(String houseHoldId) { this.houseHoldId = houseHoldId; } - public boolean isUserObfuscateIp() { + public boolean getUserObfuscateIp() { return userObfuscateIp; } @@ -125,10 +162,62 @@ public void setUserObfuscateIp(boolean userObfuscateIp) { this.userObfuscateIp = userObfuscateIp; } + public boolean getIsAutoStart() { + return isAutoStart; + } + + public void setIsAutoStart(boolean isAutoStart) { + this.isAutoStart = isAutoStart; + } + + public boolean getIsAutoDetectBackground() { + return isAutoDetectBackground; + } + + public void setIsAutoDetectBackground(boolean isAutoDetectBackground) { + this.isAutoDetectBackground = isAutoDetectBackground; + } + + public boolean getIsEnabled() { + return isEnabled; + } + + public void setIsEnabled(boolean isEnabled) { + this.isEnabled = isEnabled; + } + + public boolean getIsForceInit() { + return isForceInit; + } + + public void setForceInit(boolean forceInit) { + isForceInit = forceInit; + } + + public boolean getIsOffline() { + return isOffline; + } + + public void setIsOffline(boolean isOffline) { + this.isOffline = isOffline; + } + + public App getApp() { + return app; + } + + public void setApp(App app) { + this.app = app; + } + public Parse getParse() { return parse; } + public void setParse(Parse parse) { + this.parse = parse; + } + public Device getDevice() { return device; } @@ -137,12 +226,28 @@ public void setDevice(Device device) { this.device = device; } - public Media getMedia() { - return media; + public Content getContent() { + return content; + } + + public void setContent(Content content) { + this.content = content; + } + + public Network getNetwork() { + return network; + } + + public void setNetwork(Network network) { + this.network = network; } - public void setMedia(Media media) { - this.media = media; + public Errors getErrors() { + return errors; + } + + public void setErrors(Errors errors) { + this.errors = errors; } public Ads getAds() { @@ -161,12 +266,12 @@ public void setProperties(Properties properties) { this.properties = properties; } - public ExtraParams getExtraParams() { - return extraParams; + public CustomDimensions getCustomDimensions() { + return customDimensions; } - public void setExtraParams(ExtraParams extraParams) { - this.extraParams = extraParams; + public void setCustomDimensions(CustomDimensions customDimensions) { + this.customDimensions = customDimensions; } public ViewTransform.FastDataConfig getFastDataConfig() { @@ -182,11 +287,27 @@ public Options getYouboraOptions() { youboraOptions.setAccountCode(accountCode); youboraOptions.setUsername(username); + youboraOptions.setUserEmail(userEmail); + youboraOptions.setUserAnonymousId(userAnonymousId); youboraOptions.setUserType(userType); youboraOptions.setAppName(appName); youboraOptions.setAppReleaseVersion(appReleaseVersion); youboraOptions.setUserObfuscateIp(userObfuscateIp); youboraOptions.setHttpSecure(httpSecure); + youboraOptions.setAutoStart(isAutoStart); + youboraOptions.setAutoDetectBackground(isAutoDetectBackground); + youboraOptions.setEnabled(isEnabled); + youboraOptions.setForceInit(isForceInit); + youboraOptions.setOffline(isOffline); + + if (app != null) { + if (app.getAppName() != null) { + youboraOptions.setAppName(app.getAppName()); + } + if (app.getAppReleaseVersion() != null) { + youboraOptions.setAppReleaseVersion(app.getAppReleaseVersion()); + } + } if (parse != null) { if (parse.getParseManifest() != null) { @@ -215,107 +336,323 @@ public Options getYouboraOptions() { youboraOptions.setDeviceCode(device.getDeviceCode()); } // Specific Data - if (device.getModel() != null) { - youboraOptions.setDeviceModel(device.getModel()); + if (device.getDeviceModel() != null) { + youboraOptions.setDeviceModel(device.getDeviceModel()); } - if (device.getId() != null) { - youboraOptions.setDeviceId(device.getId()); + if (device.getDeviceId() != null) { + youboraOptions.setDeviceId(device.getDeviceId()); } - if (device.getBrand() != null) { - youboraOptions.setDeviceBrand(device.getBrand()); + if (device.getDeviceBrand() != null) { + youboraOptions.setDeviceBrand(device.getDeviceBrand()); } - if (device.getType() != null) { - youboraOptions.setDeviceType(device.getType()); + if (device.getDeviceType() != null) { + youboraOptions.setDeviceType(device.getDeviceType()); } - if (device.getOsName() != null) { - youboraOptions.setDeviceOsName(device.getOsName()); + if (device.getDeviceOsName() != null) { + youboraOptions.setDeviceOsName(device.getDeviceOsName()); } - if (device.getOsVersion() != null) { - youboraOptions.setDeviceOsVersion(device.getOsVersion()); + if (device.getDeviceOsVersion() != null) { + youboraOptions.setDeviceOsVersion(device.getDeviceOsVersion()); } - } - if (media != null) { - youboraOptions.setContentIsLive(media.getIsLive()); - youboraOptions.setContentIsLiveNoSeek((media.getIsDVR() != null) ? !media.getIsDVR() : Boolean.FALSE); - youboraOptions.setContentDuration(media.getDuration()); - youboraOptions.setContentTitle(media.getTitle()); - youboraOptions.setProgram(media.getTitle2()); + if (device.getDeviceType() != null) { + youboraOptions.setDeviceOsVersion(device.getDeviceOsVersion()); + } + youboraOptions.setDeviceIsAnonymous(device.getDeviceIsAnonymous()); } - youboraOptions.setAdResource(null); - if (ads != null) { - youboraOptions.setAdCampaign(ads.getCampaign()); + if (content != null) { + if (content.getContentBitrate() != null) { + youboraOptions.setContentBitrate(content.getContentBitrate()); + } + if (content.getContentCdn() != null) { + youboraOptions.setContentCdn(content.getContentCdn()); + } + if (content.getContentCdnNode() != null) { + youboraOptions.setContentCdnNode(content.getContentCdnNode()); + } + if (content.getContentCdnType() != null) { + youboraOptions.setContentCdnType(content.getContentCdnType()); + } + if (content.getContentChannel() != null) { + youboraOptions.setContentChannel(content.getContentChannel()); + } + if (content.getContentContractedResolution() != null) { + youboraOptions.setContentContractedResolution(content.getContentContractedResolution()); + } + if (content.getContentCost() != null) { + youboraOptions.setContentCost(content.getContentCost()); + } + if (content.getContentDrm() != null) { + youboraOptions.setContentDrm(content.getContentDrm()); + } + if (content.getContentDuration() != null) { + youboraOptions.setContentDuration(content.getContentDuration()); + } + if (content.getContentEncodingAudioCodec() != null) { + youboraOptions.setContentEncodingAudioCodec(content.getContentEncodingAudioCodec()); + } + if (content.getContentEncodingCodecProfile() != null) { + youboraOptions.setContentEncodingCodecProfile(content.getContentEncodingCodecProfile()); + } + if (content.getContentEncodingContainerFormat() != null) { + youboraOptions.setContentEncodingContainerFormat(content.getContentEncodingContainerFormat()); + } + if (content.getContentEncodingVideoCodec() != null) { + youboraOptions.setContentEncodingVideoCodec(content.getContentEncodingVideoCodec()); + } + if (content.getContentEpisodeTitle() != null) { + youboraOptions.setContentEpisodeTitle(content.getContentEpisodeTitle()); + } + if (content.getContentFps() != null) { + youboraOptions.setContentFps(content.getContentFps()); + } + if (content.getContentGenre() != null) { + youboraOptions.setContentGenre(content.getContentGenre()); + } + if (content.getContentGracenoteId() != null) { + youboraOptions.setContentGracenoteId(content.getContentGracenoteId()); + } + if (content.getContentId() != null) { + youboraOptions.setContentId(content.getContentId()); + } + if (content.getContentImdbId() != null) { + youboraOptions.setContentImdbId(content.getContentImdbId()); + } + youboraOptions.setContentIsLive(content.getContentIsLive() != null ? content.getContentIsLive() : Boolean.FALSE); + youboraOptions.setContentIsLiveNoSeek((content.getContentIsLiveNoSeek() != null) ? content.getContentIsLiveNoSeek() : Boolean.FALSE); + if (content.getContentLanguage() != null) { + youboraOptions.setContentLanguage(content.getContentLanguage()); + } + if (content.getContentPackage() != null) { + youboraOptions.setContentPackage(content.getContentPackage()); + } + if (content.getContentPlaybackType() != null) { + youboraOptions.setContentPlaybackType(content.getContentPlaybackType()); + } + if (content.getContentPrice() != null) { + youboraOptions.setContentPrice(content.getContentPrice()); + } + if (content.getContentProgram() != null) { + youboraOptions.setProgram(content.getContentProgram()); + } + if (content.getContentRendition() != null) { + youboraOptions.setContentRendition(content.getContentRendition()); + } + if (content.getContentResource() != null) { + youboraOptions.setContentResource(content.getContentResource()); + } + if (content.getContentSaga() != null) { + youboraOptions.setContentSaga(content.getContentSaga()); + } + if (content.getContentSeason() != null) { + youboraOptions.setContentSeason(content.getContentSeason()); + } + if (content.getContentStreamingProtocol() != null) { + youboraOptions.setContentStreamingProtocol(content.getContentStreamingProtocol()); + } + if (content.getContentSubtitles() != null) { + youboraOptions.setContentSubtitles(content.getContentSubtitles()); + } + if (content.getContentThroughput() != null) { + youboraOptions.setContentThroughput(content.getContentThroughput()); + } + if (content.getContentTitle() != null) { + youboraOptions.setContentTitle(content.getContentTitle()); + } + if (content.getContentTransactionCode() != null) { + youboraOptions.setContentTransactionCode(content.getContentTransactionCode()); + } + if (content.getContentTotalBytes() != null) { + youboraOptions.setContentTotalBytes(content.getContentTotalBytes()); + } + youboraOptions.setContentSendTotalBytes(content.getContentSendTotalBytes()); + if (content.getContentTvShow() != null) { + youboraOptions.setContentTvShow(content.getContentTvShow()); + } + if (content.getContentType() != null) { + youboraOptions.setContentType(content.getContentType()); + } } - youboraOptions.setAdTitle(""); - setContentPropertiesBundle(youboraOptions); + setLegacyContentPropertiesBundle(youboraOptions); youboraOptions.setContentMetadata(getContentMetaDataBundle()); - if (ads != null && ads.getExtraParams() != null) { - youboraOptions.setAdCustomDimension1(ads.getExtraParams().getParam1()); - youboraOptions.setAdCustomDimension2(ads.getExtraParams().getParam2()); - youboraOptions.setAdCustomDimension3(ads.getExtraParams().getParam3()); - youboraOptions.setAdCustomDimension4(ads.getExtraParams().getParam4()); - youboraOptions.setAdCustomDimension5(ads.getExtraParams().getParam5()); - youboraOptions.setAdCustomDimension6(ads.getExtraParams().getParam6()); - youboraOptions.setAdCustomDimension7(ads.getExtraParams().getParam7()); - youboraOptions.setAdCustomDimension8(ads.getExtraParams().getParam8()); - youboraOptions.setAdCustomDimension9(ads.getExtraParams().getParam9()); - youboraOptions.setAdCustomDimension10(ads.getExtraParams().getParam10()); - } - - if (extraParams != null) { - youboraOptions.setContentCustomDimension1(extraParams.getParam1()); - youboraOptions.setContentCustomDimension2(extraParams.getParam2()); - youboraOptions.setContentCustomDimension3(extraParams.getParam3()); - youboraOptions.setContentCustomDimension4(extraParams.getParam4()); - youboraOptions.setContentCustomDimension5(extraParams.getParam5()); - youboraOptions.setContentCustomDimension6(extraParams.getParam6()); - youboraOptions.setContentCustomDimension7(extraParams.getParam7()); - youboraOptions.setContentCustomDimension8(extraParams.getParam8()); - youboraOptions.setContentCustomDimension9(extraParams.getParam9()); - youboraOptions.setContentCustomDimension10(extraParams.getParam10()); + //youboraOptions.setContentMetrics(getContentMetricsBundle()); + //youboraOptions.setContentEncodingCodecSettings(getContentEncodingCodecSettingsBundle()); + + + if (network != null) { + if (network.getNetworkConnectionType() != null) { + youboraOptions.setNetworkConnectionType(network.getNetworkConnectionType()); + } + if (network.getNetworkIP() != null) { + youboraOptions.setNetworkIP(network.getNetworkIP()); + } + if (network.getNetworkIsp() != null) { + youboraOptions.setNetworkIsp(network.getNetworkIsp()); + } + } + + if (errors != null) { + if (errors.getErrorsIgnore() != null) { + youboraOptions.setErrorsToIgnore(errors.getErrorsIgnore()); + } + if (errors.getErrorsFatal() != null) { + youboraOptions.setFatalErrors(errors.getErrorsFatal()); + } + if (errors.getErrorsNonFatal() != null) { + youboraOptions.setNonFatalErrors(errors.getErrorsNonFatal()); + } + } + + if (ads != null) { + if (ads.getAdBreaksTime() != null) { + youboraOptions.setAdBreaksTime(ads.getAdBreaksTime()); + } + youboraOptions.setAdCampaign(ads.getAdCampaign()); + youboraOptions.setAdCreativeId(ads.getAdCreativeId()); + + + if (ads.getAdExpectedBreaks() != null) { + youboraOptions.setAdExpectedBreaks(ads.getAdExpectedBreaks()); + } + if (ads.getAdGivenBreaks() != null) { + youboraOptions.setAdGivenBreaks(ads.getAdGivenBreaks()); + } + + youboraOptions.setAdProvider(ads.getAdProvider()); + youboraOptions.setAdResource(ads.getAdResource()); + youboraOptions.setAdTitle(ads.getAdTitle()); + + if (ads.getAdCustomDimensions() != null) { + youboraOptions.setAdCustomDimension1(ads.getAdCustomDimensions().getAdCustomDimension1()); + youboraOptions.setAdCustomDimension2(ads.getAdCustomDimensions().getAdCustomDimension2()); + youboraOptions.setAdCustomDimension3(ads.getAdCustomDimensions().getAdCustomDimension3()); + youboraOptions.setAdCustomDimension4(ads.getAdCustomDimensions().getAdCustomDimension4()); + youboraOptions.setAdCustomDimension5(ads.getAdCustomDimensions().getAdCustomDimension5()); + youboraOptions.setAdCustomDimension6(ads.getAdCustomDimensions().getAdCustomDimension6()); + youboraOptions.setAdCustomDimension7(ads.getAdCustomDimensions().getAdCustomDimension7()); + youboraOptions.setAdCustomDimension8(ads.getAdCustomDimensions().getAdCustomDimension8()); + youboraOptions.setAdCustomDimension9(ads.getAdCustomDimensions().getAdCustomDimension9()); + youboraOptions.setAdCustomDimension10(ads.getAdCustomDimensions().getAdCustomDimension10()); + } + + //UNSUPPORTED YET + //youboraOptions.setAdMetadata(getAdMetaDataBundle()); + //youboraOptions.setAdExpectedPattern(getAdExpectedPatternBundle()); + } + + if (customDimensions != null) { + youboraOptions.setContentCustomDimension1(customDimensions.getCustomDimension1()); + youboraOptions.setContentCustomDimension2(customDimensions.getCustomDimension2()); + youboraOptions.setContentCustomDimension3(customDimensions.getCustomDimension3()); + youboraOptions.setContentCustomDimension4(customDimensions.getCustomDimension4()); + youboraOptions.setContentCustomDimension5(customDimensions.getCustomDimension5()); + youboraOptions.setContentCustomDimension6(customDimensions.getCustomDimension6()); + youboraOptions.setContentCustomDimension7(customDimensions.getCustomDimension7()); + youboraOptions.setContentCustomDimension8(customDimensions.getCustomDimension8()); + youboraOptions.setContentCustomDimension9(customDimensions.getCustomDimension9()); + youboraOptions.setContentCustomDimension10(customDimensions.getCustomDimension10()); + youboraOptions.setContentCustomDimension11(customDimensions.getCustomDimension11()); + youboraOptions.setContentCustomDimension12(customDimensions.getCustomDimension12()); + youboraOptions.setContentCustomDimension13(customDimensions.getCustomDimension13()); + youboraOptions.setContentCustomDimension14(customDimensions.getCustomDimension14()); + youboraOptions.setContentCustomDimension15(customDimensions.getCustomDimension15()); + youboraOptions.setContentCustomDimension16(customDimensions.getCustomDimension16()); + youboraOptions.setContentCustomDimension17(customDimensions.getCustomDimension17()); + youboraOptions.setContentCustomDimension18(customDimensions.getCustomDimension18()); + youboraOptions.setContentCustomDimension19(customDimensions.getCustomDimension19()); + youboraOptions.setContentCustomDimension20(customDimensions.getCustomDimension20()); } return youboraOptions; } - private void setContentPropertiesBundle(Options youboraOptions) { + private void setLegacyContentPropertiesBundle(Options youboraOptions) { Properties prop = getProperties(); if (prop == null) { return; } - youboraOptions.setContentGenre(prop.getGenre()); - youboraOptions.setContentType(prop.getType()); - youboraOptions.setContentTransactionCode(prop.getTransactionType()); - youboraOptions.setContentPrice(prop.getPrice()); - youboraOptions.setContentRendition(prop.getQuality()); // Name or value of the current rendition (quality) of the content. - youboraOptions.setContentPackage(prop.getContentPackage()); - youboraOptions.setContentCdn(prop.getContentCdnCode()); - youboraOptions.setContentSaga(prop.getContentSaga()); - youboraOptions.setContentTvShow(prop.getContentTvShow()); - youboraOptions.setContentSeason(prop.getContentSeason()); - youboraOptions.setContentEpisodeTitle(prop.getContentEpisodeTitle()); - youboraOptions.setContentChannel(prop.getContentChannel()); - youboraOptions.setContentId(prop.getContentId()); - youboraOptions.setContentImdbId(prop.getContentImdbId()); - youboraOptions.setContentGracenoteId(prop.getContentGracenoteId()); - youboraOptions.setContentLanguage(prop.getContentLanguage()); - youboraOptions.setContentSubtitles(prop.getContentSubtitles()); - youboraOptions.setContentContractedResolution(prop.getContentContractedResolution()); - youboraOptions.setContentPlaybackType(prop.getContentPlaybackType()); - youboraOptions.setContentDrm(prop.getContentDrm()); - youboraOptions.setContentEncodingVideoCodec(prop.getContentEncodingVideoCodec()); - youboraOptions.setContentEncodingAudioCodec(prop.getContentEncodingAudioCodec()); - youboraOptions.setContentEncodingCodecProfile(prop.getContentEncodingCodecProfile()); - youboraOptions.setContentEncodingContainerFormat(prop.getContentEncodingContainerFormat()); + // For Legacy + if (prop.getGenre() != null) { + youboraOptions.setContentGenre(prop.getGenre()); + } + if (prop.getType() != null) { + youboraOptions.setContentType(prop.getType()); + } + if (prop.getTransactionType() != null) { + youboraOptions.setContentTransactionCode(prop.getTransactionType()); + } + if (prop.getPrice() != null) { + youboraOptions.setContentPrice(prop.getPrice()); + } + if (prop.getQuality() != null) { + youboraOptions.setContentRendition(prop.getQuality()); // Name or value of the current rendition (quality) of the content. + } + if (prop.getContentPackage() != null) { + youboraOptions.setContentPackage(prop.getContentPackage()); + } + if (prop.getContentCdnCode() != null) { + youboraOptions.setContentCdn(prop.getContentCdnCode()); + } + if (prop.getContentSaga() != null) { + youboraOptions.setContentSaga(prop.getContentSaga()); + } + if (prop.getContentTvShow() != null) { + youboraOptions.setContentTvShow(prop.getContentTvShow()); + } + if (prop.getContentSeason() != null) { + youboraOptions.setContentSeason(prop.getContentSeason()); + } + if (prop.getContentEpisodeTitle() != null) { + youboraOptions.setContentEpisodeTitle(prop.getContentEpisodeTitle()); + } + if (prop.getContentChannel() != null) { + youboraOptions.setContentChannel(prop.getContentChannel()); + } + if (prop.getContentId() != null) { + youboraOptions.setContentId(prop.getContentId()); + } + if (prop.getContentImdbId() != null) { + youboraOptions.setContentImdbId(prop.getContentImdbId()); + } + if (prop.getContentGracenoteId() != null) { + youboraOptions.setContentGracenoteId(prop.getContentGracenoteId()); + } + if (prop.getContentLanguage() != null) { + youboraOptions.setContentLanguage(prop.getContentLanguage()); + } + if (prop.getContentSubtitles() != null) { + youboraOptions.setContentSubtitles(prop.getContentSubtitles()); + } + if (prop.getContentContractedResolution() != null) { + youboraOptions.setContentContractedResolution(prop.getContentContractedResolution()); + } + if (prop.getContentPlaybackType() != null) { + youboraOptions.setContentPlaybackType(prop.getContentPlaybackType()); + } + if (prop.getContentDrm() != null) { + youboraOptions.setContentDrm(prop.getContentDrm()); + } + if (prop.getContentEncodingVideoCodec() != null) { + youboraOptions.setContentEncodingVideoCodec(prop.getContentEncodingVideoCodec()); + } + if (prop.getContentEncodingAudioCodec() != null) { + youboraOptions.setContentEncodingAudioCodec(prop.getContentEncodingAudioCodec()); + } + if (prop.getContentEncodingCodecProfile() != null) { + youboraOptions.setContentEncodingCodecProfile(prop.getContentEncodingCodecProfile()); + } + if (prop.getContentEncodingContainerFormat() != null) { + youboraOptions.setContentEncodingContainerFormat(prop.getContentEncodingContainerFormat()); + } } /** @@ -330,297 +667,380 @@ private Bundle getContentMetaDataBundle() { } Bundle propertiesBundle = new Bundle(); - propertiesBundle.putString("director", (prop.getDirector() != null) ? prop.getDirector() : ""); - propertiesBundle.putString("parental", (prop.getParental() != null) ? prop.getParental() : ""); - propertiesBundle.putString("audioType", (prop.getAudioType() != null) ? prop.getAudioType() : ""); - propertiesBundle.putString("audioChannels", (prop.getAudioChannels() != null) ? prop.getAudioChannels() : ""); - propertiesBundle.putString("device", (prop.getDevice() != null) ? prop.getDevice() : ""); - propertiesBundle.putString("rating", (prop.getRating() != null) ? prop.getRating() : ""); - propertiesBundle.putString("year", (prop.getYear() != null) ? prop.getYear() : ""); - propertiesBundle.putString("cast", (prop.getCast() != null) ? prop.getCast() : ""); - propertiesBundle.putString("owner", (prop.getOwner() != null) ? prop.getOwner() : ""); + if (prop.getDirector() != null) { + propertiesBundle.putString("director", prop.getDirector()); + } + if (prop.getParental() != null) { + propertiesBundle.putString("parental", prop.getParental()); + } + if (prop.getParental() != null) { + propertiesBundle.putString("audioType", prop.getAudioType()); + } + if (prop.getAudioChannels() != null) { + propertiesBundle.putString("audioChannels", prop.getAudioChannels()); + } + if (prop.getDevice() != null) { + propertiesBundle.putString("device", prop.getDevice()); + } + if (prop.getRating() != null) { + propertiesBundle.putString("rating", prop.getRating()); + } + if (prop.getYear() != null) { + propertiesBundle.putString("year", prop.getYear()); + } + if (prop.getCast() != null) { + propertiesBundle.putString("cast", prop.getCast()); + } + if (prop.getOwner() != null) { + propertiesBundle.putString("owner", prop.getOwner()); + } return propertiesBundle; } + private Bundle getContentMetricsBundle() { + return new Bundle(); + } + + private Bundle getContentEncodingCodecSettingsBundle() { + return new Bundle(); + } + + private Bundle getAdMetaDataBundle() { + return new Bundle(); +// AdProperties prop = getAdProperties(); +// if (prop == null) { +// return new Bundle(); +// } +// +// Bundle propertiesBundle = new Bundle(); +// if (prop.getDirector() != null) { +// propertiesBundle.putString("director", prop.getDirector()); +// } +// if (prop.getParental() != null) { +// propertiesBundle.putString("parental", prop.getParental()); +// } +// if (prop.getParental() != null) { +// propertiesBundle.putString("audioType", prop.getAudioType()); +// } +// if (prop.getAudioChannels() != null) { +// propertiesBundle.putString("audioChannels", prop.getAudioChannels()); +// } +// if (prop.getDevice() != null) { +// propertiesBundle.putString("device", prop.getDevice()); +// } +// if (prop.getRating() != null) { +// propertiesBundle.putString("rating", prop.getRating()); +// } +// if (prop.getYear() != null) { +// propertiesBundle.putString("year", prop.getYear()); +// } +// if (prop.getCast() != null) { +// propertiesBundle.putString("cast", prop.getCast()); +// } +// if (prop.getOwner() != null) { +// propertiesBundle.putString("owner", prop.getOwner()); +// } +// +// +// return propertiesBundle; + } + + private Bundle getAdExpectedPatternBundle() { + return new Bundle(); + } + + public JsonObject toJson() { JsonPrimitive accountCode = new JsonPrimitive(getAccountCode() != null ? getAccountCode() : ""); JsonPrimitive username = new JsonPrimitive(getUsername() != null ? getUsername() : ""); + JsonPrimitive userEmail = new JsonPrimitive(getUserEmail() != null ? getUserEmail() : ""); + JsonPrimitive userAnonymousId = new JsonPrimitive(getUserAnonymousId() != null ? getUserAnonymousId() : ""); JsonPrimitive userType = new JsonPrimitive(getUserType() != null ? getUserType() : ""); JsonPrimitive appName = new JsonPrimitive(getAppName() != null ? getAppName() : ""); JsonPrimitive appReleaseVersion = new JsonPrimitive(getAppReleaseVersion() != null ? getAppReleaseVersion() : ""); JsonPrimitive houseHoldId = new JsonPrimitive(getHouseHoldId() != null ? getHouseHoldId() : ""); - JsonPrimitive isUserObfuscateIp = new JsonPrimitive(isUserObfuscateIp()); + JsonPrimitive isUserObfuscateIp = new JsonPrimitive(getUserObfuscateIp()); JsonPrimitive httpSecure = new JsonPrimitive(getHttpSecure()); - JsonObject parse = getParseJsonObject(); - JsonObject device = getDeviceJsonObject(); - JsonObject mediaEntry = getMediaJsonObject(); - JsonObject adsEntry = new JsonObject(); - adsEntry.addProperty("campaign", (getAds() != null && getAds().getCampaign() != null) ? getAds().getCampaign() : ""); - JsonObject propertiesEntry = getPropertiesJsonObject(); - JsonObject extraParamEntry = getExtraParamJsonObject(); - return getYouboraConfigJsonObject(accountCode, + JsonPrimitive isAutoStart = new JsonPrimitive(getIsAutoStart()); + JsonPrimitive isAutoDetectBackground = new JsonPrimitive(getIsAutoDetectBackground()); + JsonPrimitive isEnabled = new JsonPrimitive(getIsEnabled()); + JsonPrimitive isForceInit = new JsonPrimitive(getIsForceInit()); + JsonPrimitive isOffline = new JsonPrimitive(getIsOffline()); + + JsonObject app = YouboraConfigJsonBuilder.getAppJsonObject(getApp()); + JsonObject parse = YouboraConfigJsonBuilder.getParseJsonObject(getParse()); + JsonObject device = YouboraConfigJsonBuilder.getDeviceJsonObject(getDevice()); + JsonObject content = YouboraConfigJsonBuilder.getContentJsonObject(getContent()); + JsonObject network = YouboraConfigJsonBuilder.getNetworkJsonObject(getNetwork()); + JsonObject errors = YouboraConfigJsonBuilder.getErrorsJsonObject(getErrors()); + JsonObject adsEntry = YouboraConfigJsonBuilder.getAdsJsonObject(getAds()); + JsonObject propertiesEntry = YouboraConfigJsonBuilder.getPropertiesJsonObject(getProperties()); + JsonObject customDimentionsEntry = YouboraConfigJsonBuilder.getCustomDimentionsJsonObject(getCustomDimensions()); + return YouboraConfigJsonBuilder.getYouboraConfigJsonObject(accountCode, username, + userEmail, + userAnonymousId, userType, appName, appReleaseVersion, houseHoldId, isUserObfuscateIp, httpSecure, + isAutoStart, + isAutoDetectBackground, + isEnabled, + isForceInit, + isOffline, + app, parse, device, - mediaEntry, + content, + network, + errors, adsEntry, propertiesEntry, - extraParamEntry); + customDimentionsEntry); } - - private JsonObject getParseJsonObject() { - JsonObject parseJsonObject = new JsonObject(); - Parse parse = getParse(); - if (parse == null) { - return parseJsonObject; - } - - if (parse.getParseManifest() != null) { - parseJsonObject.addProperty("parseManifest", parse.getParseManifest()); - } - - if (parse.getParseCdnNode() != null) { - parseJsonObject.addProperty("parseCdnNode", parse.getParseCdnNode()); - } - - if (parse.getParseCdnSwitchHeader() != null) { - parseJsonObject.addProperty("parseCdnSwitchHeader", parse.getParseCdnSwitchHeader()); - } - - if (parse.getCdnNodeList() != null) { - JsonArray cdnNodeListJsonArray = new JsonArray(); - for(String cdn : parse.getCdnNodeList()) { - cdnNodeListJsonArray.add(cdn); - } - parseJsonObject.add("cdnNodeList", cdnNodeListJsonArray); - } - - if (parse.getCdnNameHeaders() != null) { - parseJsonObject.addProperty("cdnNameHeaders", parse.getCdnNameHeaders() ); - } - - if (parse.getParseCdnTTL() != null) { - parseJsonObject.addProperty("parseCdnTTL", parse.getParseCdnTTL()); - } - - return parseJsonObject; - } - - private JsonObject getDeviceJsonObject() { - JsonObject deviceJsonObject = new JsonObject(); - Device device = getDevice(); - if (device == null) { - return deviceJsonObject; - } - - if (device.getDeviceCode() != null) { - deviceJsonObject.addProperty("deviceCode", device.getDeviceCode()); - } - - if (device.getModel() != null) { - deviceJsonObject.addProperty("model", device.getModel()); - } - - if (device.getId() != null) { - deviceJsonObject.addProperty("id", device.getId()); + + public void merge(YouboraConfig youboraConfigUiConf) { + if (youboraConfigUiConf == null) { + return; } - if (device.getBrand() != null) { - deviceJsonObject.addProperty("brand", device.getBrand()); + if (TextUtils.isEmpty(accountCode)) { + accountCode = youboraConfigUiConf.getAccountCode(); } - - if (device.getType() != null) { - deviceJsonObject.addProperty("type", device.getType()); + if (TextUtils.isEmpty(username)) { + username = youboraConfigUiConf.getUsername(); } - - if (device.getOsName() != null) { - deviceJsonObject.addProperty("osName", device.getOsName()); + if (TextUtils.isEmpty(userEmail)) { + userEmail = youboraConfigUiConf.getUserEmail(); } - - if (device.getOsVersion() != null) { - deviceJsonObject.addProperty("osName", device.getOsVersion()); + if (TextUtils.isEmpty(userAnonymousId)) { + userAnonymousId = youboraConfigUiConf.getUserAnonymousId(); } - return deviceJsonObject; - } - - @NonNull - private JsonObject getMediaJsonObject() { - JsonObject mediaEntry = new JsonObject(); - Media media = getMedia(); - if (media == null) { - return mediaEntry; + if (TextUtils.isEmpty(userType)) { + userType = youboraConfigUiConf.getUserType(); } - mediaEntry.addProperty("resource", media.getResource() != null ? media.getResource() : ""); - mediaEntry.addProperty("isLive", media.getIsLive()); - mediaEntry.addProperty("isDVR", media.getIsDVR() != null ? media.getIsDVR() : Boolean.FALSE); - mediaEntry.addProperty("title", media.getTitle() != null ? media.getTitle() : ""); - mediaEntry.addProperty("title2", media.getTitle2() != null ? media.getTitle2() : ""); - if (media.getDuration() != null) { - mediaEntry.addProperty("duration", media.getDuration()); + if (content != null) { + if (youboraConfigUiConf.getContent() != null) { + if (content.getContentBitrate() == null) { + content.setContentBitrate(youboraConfigUiConf.getContent().getContentBitrate()); + } + if (content.getContentCdn() == null) { + content.setContentCdn(youboraConfigUiConf.getContent().getContentCdn()); + } + if (content.getContentCdnNode() == null) { + content.setContentCdnNode(youboraConfigUiConf.getContent().getContentCdnNode()); + } + if (content.getContentCdnType() == null) { + content.setContentCdnType(youboraConfigUiConf.getContent().getContentCdnType()); + } + if (content.getContentChannel() == null) { + content.setContentChannel(youboraConfigUiConf.getContent().getContentChannel()); + } + if (content.getContentContractedResolution() == null) { + content.setContentContractedResolution(youboraConfigUiConf.getContent().getContentContractedResolution()); + } + if (content.getContentCost() == null) { + content.setContentCost(youboraConfigUiConf.getContent().getContentCost()); + } + if (content.getContentDrm() == null) { + content.setContentDrm(youboraConfigUiConf.getContent().getContentDrm()); + } + if (content.getContentDuration() == null) { + content.setContentDuration(youboraConfigUiConf.getContent().getContentDuration()); + } + if (content.getContentEncodingAudioCodec() == null) { + content.setContentEncodingAudioCodec(youboraConfigUiConf.getContent().getContentEncodingAudioCodec()); + } + if (content.getContentEncodingCodecProfile() == null) { + content.setContentEncodingCodecProfile(youboraConfigUiConf.getContent().getContentEncodingCodecProfile()); + } + if (content.getContentEncodingContainerFormat() == null) { + content.setContentEncodingContainerFormat(youboraConfigUiConf.getContent().getContentEncodingContainerFormat()); + } + if (content.getContentEncodingVideoCodec() == null) { + content.setContentEncodingVideoCodec(youboraConfigUiConf.getContent().getContentEncodingVideoCodec()); + } + if (content.getContentEpisodeTitle() == null) { + content.setContentEpisodeTitle(youboraConfigUiConf.getContent().getContentEpisodeTitle()); + } + if (content.getContentFps() == null) { + content.setContentFps(youboraConfigUiConf.getContent().getContentFps()); + } + if (content.getContentGenre() == null) { + content.setContentGenre(youboraConfigUiConf.getContent().getContentGenre()); + } + if (content.getContentGracenoteId() == null) { + content.setContentGracenoteId(youboraConfigUiConf.getContent().getContentGracenoteId()); + } + if (content.getContentId() == null) { + content.setContentId(youboraConfigUiConf.getContent().getContentId()); + } + if (content.getContentImdbId() == null) { + content.setContentImdbId(youboraConfigUiConf.getContent().getContentImdbId()); + } + if (content.getContentIsLive() == null) { + content.setContentIsLive(youboraConfigUiConf.getContent().getContentIsLive()); + } + if (content.getContentIsLiveNoSeek() == null) { + content.setContentIsLiveNoSeek(youboraConfigUiConf.getContent().getContentIsLiveNoSeek()); + } + if (content.getContentLanguage() == null) { + content.setContentLanguage(youboraConfigUiConf.getContent().getContentLanguage()); + } + if (content.getContentPackage() == null) { + content.setContentPackage(youboraConfigUiConf.getContent().getContentPackage()); + } + if (content.getContentPlaybackType() == null) { + content.setContentPlaybackType(youboraConfigUiConf.getContent().getContentPlaybackType()); + } + if (content.getContentPrice() == null) { + content.setContentPrice(youboraConfigUiConf.getContent().getContentPrice()); + } + if (content.getContentProgram() == null) { + content.setContentProgram(youboraConfigUiConf.getContent().getContentProgram()); + } + if (content.getContentRendition() == null) { + content.setContentRendition(youboraConfigUiConf.getContent().getContentRendition()); + } + if (content.getContentResource() == null) { + content.setContentResource(youboraConfigUiConf.getContent().getContentResource()); + } + if (content.getContentSaga() == null) { + content.setContentSaga(youboraConfigUiConf.getContent().getContentSaga()); + } + if (content.getContentSeason() == null) { + content.setContentSeason(youboraConfigUiConf.getContent().getContentSeason()); + } + if (content.getContentStreamingProtocol() == null) { + content.setContentStreamingProtocol(youboraConfigUiConf.getContent().getContentStreamingProtocol()); + } + if (content.getContentSubtitles() == null) { + content.setContentSubtitles(youboraConfigUiConf.getContent().getContentSubtitles()); + } + if (content.getContentThroughput() == null) { + content.setContentThroughput(youboraConfigUiConf.getContent().getContentThroughput()); + } + if (content.getContentTitle() == null) { + content.setContentTitle(youboraConfigUiConf.getContent().getContentTitle()); + } + if (content.getContentTransactionCode() == null) { + content.setContentTransactionCode(youboraConfigUiConf.getContent().getContentTransactionCode()); + } + if (content.getContentTotalBytes() == null) { + content.setContentTotalBytes(youboraConfigUiConf.getContent().getContentTotalBytes()); + } + content.setContentSendTotalBytes(youboraConfigUiConf.getContent().getContentSendTotalBytes()); + if (content.getContentTvShow() == null) { + content.setContentTvShow(youboraConfigUiConf.getContent().getContentTvShow()); + } + if (content.getContentType() == null) { + content.setContentType(youboraConfigUiConf.getContent().getContentType()); + } + } + } else { + content = youboraConfigUiConf.getContent(); } - mediaEntry.addProperty("transactionCode", media.getTransactionCode() != null ? media.getTransactionCode() : ""); - return mediaEntry; - } - @NonNull - private JsonObject getYouboraConfigJsonObject(JsonPrimitive accountCode, - JsonPrimitive username, - JsonPrimitive userType, - JsonPrimitive appName, - JsonPrimitive appReleaseVersion, - JsonPrimitive houseHoldId, - JsonPrimitive isUserObfuscateIp, - JsonPrimitive httpSecure, - JsonObject parse, - JsonObject device, - JsonObject mediaEntry, - JsonObject adsEntry, - JsonObject propertiesEntry, - JsonObject extraParamEntry) { - JsonObject youboraConfig = new JsonObject(); - youboraConfig.add("accountCode", accountCode); - youboraConfig.add("username", username); - youboraConfig.add("userType", userType); - youboraConfig.add("appName", appName); - youboraConfig.add("appReleaseVersion", appReleaseVersion); - youboraConfig.add("houseHoldId", houseHoldId); - youboraConfig.add("userObfuscateIp", isUserObfuscateIp); - youboraConfig.add("httpSecure", httpSecure); - youboraConfig.add("parse", parse); - youboraConfig.add("device", device); - youboraConfig.add("media", mediaEntry); - youboraConfig.add("ads", adsEntry); - youboraConfig.add("properties", propertiesEntry); - youboraConfig.add("extraParams", extraParamEntry); - return youboraConfig; - } - - @NonNull - private JsonObject getPropertiesJsonObject() { - JsonObject propertiesEntry = new JsonObject(); - if (getProperties() == null) { - return propertiesEntry; + if (app != null) { + if (youboraConfigUiConf.getApp() != null) { + if (app.getAppName() == null) { + app.setAppName(youboraConfigUiConf.getApp().getAppName()); + } + if (app.getAppReleaseVersion() == null) { + app.setAppReleaseVersion(youboraConfigUiConf.getAppReleaseVersion()); + } + } else { + app = youboraConfigUiConf.getApp(); + } } - Properties prop = getProperties(); - propertiesEntry.addProperty("genre", (prop.getGenre() != null) ? prop.getGenre() : ""); - propertiesEntry.addProperty("type", (prop.getType() != null) ? prop.getType() : ""); - propertiesEntry.addProperty("transactionType", (prop.getTransactionType() != null) ? prop.getTransactionType() : ""); - propertiesEntry.addProperty("year", (prop.getYear() != null) ? prop.getYear() : ""); - propertiesEntry.addProperty("cast", (prop.getCast() != null) ? prop.getCast() : ""); - propertiesEntry.addProperty("director", (prop.getDirector() != null) ? prop.getDirector() : ""); - propertiesEntry.addProperty("owner", (prop.getOwner() != null) ? prop.getOwner() : ""); - propertiesEntry.addProperty("parental", (prop.getParental() != null) ? prop.getParental() : ""); - propertiesEntry.addProperty("price", (prop.getPrice() != null) ? prop.getPrice() : ""); - propertiesEntry.addProperty("rating", (prop.getRating() != null) ? prop.getRating() : ""); - propertiesEntry.addProperty("audioType", (prop.getAudioType() != null) ? prop.getAudioType() : ""); - propertiesEntry.addProperty("audioChannels", (prop.getAudioChannels() != null) ? prop.getAudioChannels() : ""); - propertiesEntry.addProperty("device", (prop.getDevice() != null) ? prop.getDevice() : ""); - propertiesEntry.addProperty("quality", (prop.getQuality() != null) ? prop.getQuality() : ""); - - propertiesEntry.addProperty("contentPackage", (prop.getContentPackage() != null) ? prop.getContentPackage() : ""); - propertiesEntry.addProperty("contentCdnCode", (prop.getContentCdnCode() != null) ? prop.getContentCdnCode() : ""); - propertiesEntry.addProperty("contentSaga", (prop.getContentSaga() != null) ? prop.getContentSaga() : ""); - propertiesEntry.addProperty("contentTvShow", (prop.getContentTvShow() != null) ? prop.getContentTvShow() : ""); - propertiesEntry.addProperty("contentSeason", (prop.getContentSeason() != null) ? prop.getContentSeason() : ""); - propertiesEntry.addProperty("contentEpisodeTitle", (prop.getContentEpisodeTitle() != null) ? prop.getContentEpisodeTitle() : ""); - propertiesEntry.addProperty("contentChannel", (prop.getContentChannel() != null) ? prop.getContentChannel() : ""); - propertiesEntry.addProperty("contentId", (prop.getContentId() != null) ? prop.getContentId() : ""); - propertiesEntry.addProperty("contentImdbId", (prop.getContentImdbId() != null) ? prop.getContentImdbId() : ""); - propertiesEntry.addProperty("contentGracenoteId", (prop.getContentGracenoteId() != null) ? prop.getContentGracenoteId() : ""); - propertiesEntry.addProperty("contentLanguage", (prop.getContentLanguage() != null) ? prop.getContentLanguage() : ""); - propertiesEntry.addProperty("contentSubtitles", (prop.getContentSubtitles() != null) ? prop.getContentSubtitles() : ""); - propertiesEntry.addProperty("contentContractedResolution", (prop.getContentContractedResolution() != null) ? prop.getContentContractedResolution() : ""); - propertiesEntry.addProperty("contentPlaybackType", (prop.getContentPlaybackType() != null) ? prop.getContentPlaybackType() : ""); - propertiesEntry.addProperty("contentDrm", (prop.getContentDrm() != null) ? prop.getContentDrm() : ""); - propertiesEntry.addProperty("contentEncodingVideoCodec", (prop.getContentEncodingVideoCodec() != null) ? prop.getContentEncodingVideoCodec() : ""); - propertiesEntry.addProperty("contentEncodingAudioCodec", (prop.getContentEncodingAudioCodec() != null) ? prop.getContentEncodingAudioCodec() : ""); - propertiesEntry.addProperty("contentEncodingCodecProfile", (prop.getContentEncodingCodecProfile() != null) ? prop.getContentEncodingCodecProfile() : ""); - propertiesEntry.addProperty("contentEncodingContainerFormat", (prop.getContentEncodingContainerFormat() != null) ? prop.getContentEncodingContainerFormat() : ""); - - return propertiesEntry; - } - - @NonNull - private JsonObject getExtraParamJsonObject() { - JsonObject extraParamEntry = new JsonObject(); - if (getExtraParams() == null) { - return extraParamEntry; - } - ExtraParams extraParams = getExtraParams(); - if (extraParams.getParam1() != null) { - extraParamEntry.addProperty("param1", extraParams.getParam1()); - } - if (extraParams.getParam2() != null) { - extraParamEntry.addProperty("param2", extraParams.getParam2()); - } - if (extraParams.getParam3() != null) { - extraParamEntry.addProperty("param3", extraParams.getParam3()); - } - if (extraParams.getParam4() != null) { - extraParamEntry.addProperty("param4", extraParams.getParam4()); - } - if (extraParams.getParam5() != null) { - extraParamEntry.addProperty("param5", extraParams.getParam5()); - } - if (extraParams.getParam6() != null) { - extraParamEntry.addProperty("param6", extraParams.getParam6()); - } - if (extraParams.getParam7() != null) { - extraParamEntry.addProperty("param7", extraParams.getParam7()); - } - if (extraParams.getParam8() != null) { - extraParamEntry.addProperty("param8", extraParams.getParam8()); - } - if (extraParams.getParam9() != null) { - extraParamEntry.addProperty("param9", extraParams.getParam9()); - } - if (extraParams.getParam10() != null) { - extraParamEntry.addProperty("param10", extraParams.getParam10()); - } - return extraParamEntry; - } - - public void merge(YouboraConfig youboraConfigUiConf) { - if (youboraConfigUiConf == null) { - return; + if (parse != null) { + if (youboraConfigUiConf.getParse() != null) { + if (parse.getParseManifest() == null) { + parse.setParseManifest(youboraConfigUiConf.getParse().getParseManifest()); + } + if (parse.getParseCdnNode() == null) { + parse.setParseCdnNode(youboraConfigUiConf.getParse().getParseCdnNode()); + } + if (parse.getCdnNodeList() == null) { + parse.setCdnNodeList(youboraConfigUiConf.getParse().getCdnNodeList()); + } + if (parse.getParseCdnTTL() == null) { + parse.setParseCdnTTL(youboraConfigUiConf.getParse().getParseCdnTTL()); + } + if (parse.getCdnNameHeaders() == null) { + parse.setCdnNameHeaders(youboraConfigUiConf.getParse().getCdnNameHeaders()); + } + if (parse.getParseCdnSwitchHeader() == null) { + parse.setParseCdnSwitchHeader(youboraConfigUiConf.getParse().getParseCdnSwitchHeader()); + } + } + } else { + parse = youboraConfigUiConf.getParse(); } - if (TextUtils.isEmpty(accountCode)) { - accountCode = youboraConfigUiConf.getAccountCode(); - } - if (TextUtils.isEmpty(username)) { - username = youboraConfigUiConf.getUsername(); + if (network != null) { + if (youboraConfigUiConf.getNetwork() != null) { + if (network.getNetworkConnectionType() == null) { + network.setNetworkConnectionType(youboraConfigUiConf.getNetwork().getNetworkConnectionType()); + } + if (network.getNetworkIP() == null) { + network.setNetworkIP(youboraConfigUiConf.getNetwork().getNetworkIP()); + } + if (network.getNetworkIsp() == null) { + network.setNetworkIsp(youboraConfigUiConf.getNetwork().getNetworkIsp()); + } + } + } else { + network = youboraConfigUiConf.getNetwork(); } - if (media != null) { - if (youboraConfigUiConf.getMedia() != null) { - if (media.getIsLive() == null) { - media.setIsLive(youboraConfigUiConf.getMedia().getIsLive()); + if (errors != null) { + if (youboraConfigUiConf.getErrors() != null) { + if (errors.getErrorsIgnore() == null) { + errors.setErrorsIgnore(youboraConfigUiConf.getErrors().getErrorsIgnore()); } - if (media.getTitle() == null) { - media.setTitle(youboraConfigUiConf.getMedia().getTitle()); + if (errors.getErrorsFatal() == null) { + errors.setErrorsFatal(youboraConfigUiConf.getErrors().getErrorsFatal()); } - if (media.getDuration() == null) { - media.setDuration(youboraConfigUiConf.getMedia().getDuration()); + if (errors.getErrorsNonFatal() == null) { + errors.setErrorsNonFatal(youboraConfigUiConf.getErrors().getErrorsNonFatal()); } } } else { - media = youboraConfigUiConf.getMedia(); + errors = youboraConfigUiConf.getErrors(); } if (ads != null) { - if (ads.getCampaign() == null) { - if (youboraConfigUiConf.getAds() != null) { - ads.setCampaign(youboraConfigUiConf.getAds().getCampaign()); + if (youboraConfigUiConf.getAds() != null) { + if (ads.getAdBreaksTime() == null) { + ads.setAdBreaksTime(youboraConfigUiConf.getAds().getAdBreaksTime()); + } + if (ads.getAdCampaign() == null) { + ads.setAdCampaign(youboraConfigUiConf.getAds().getAdCampaign()); + } + if (ads.getAdCreativeId() == null) { + ads.setAdCreativeId(youboraConfigUiConf.getAds().getAdCreativeId()); + } + if (ads.getAdExpectedBreaks() == null) { + ads.setAdExpectedBreaks(youboraConfigUiConf.getAds().getAdExpectedBreaks()); + } + if (ads.getAdGivenBreaks() == null) { + ads.setAdGivenBreaks(youboraConfigUiConf.getAds().getAdGivenBreaks()); + } + if (ads.getAdProvider() == null) { + ads.setAdProvider(youboraConfigUiConf.getAds().getAdProvider()); + } + if (ads.getAdResource() == null) { + ads.setAdResource(youboraConfigUiConf.getAds().getAdResource()); + } + if (ads.getAdTitle() == null) { + ads.setAdTitle(youboraConfigUiConf.getAds().getAdTitle()); } } } else { @@ -630,21 +1050,10 @@ public void merge(YouboraConfig youboraConfigUiConf) { if (properties != null) { if (youboraConfigUiConf.getProperties() != null) { Properties propUiConf = youboraConfigUiConf.getProperties(); - if (TextUtils.isEmpty((properties.getGenre()))) { - properties.setGenre(propUiConf.getGenre()); - } - if (TextUtils.isEmpty((properties.getType()))) { - properties.setType(propUiConf.getType()); - } - if (TextUtils.isEmpty((properties.getTransactionType()))) { - properties.setTransactionType(propUiConf.getTransactionType()); - } + if (TextUtils.isEmpty((properties.getAudioChannels()))) { properties.setAudioChannels(propUiConf.getAudioChannels()); } - if (TextUtils.isEmpty((properties.getAudioType()))) { - properties.setAudioType(propUiConf.getAudioType()); - } if (TextUtils.isEmpty((properties.getCast()))) { properties.setCast(propUiConf.getCast()); } @@ -663,58 +1072,80 @@ public void merge(YouboraConfig youboraConfigUiConf) { if (TextUtils.isEmpty((properties.getYear()))) { properties.setYear(propUiConf.getYear()); } - if (TextUtils.isEmpty((properties.getQuality()))) { - properties.setQuality(propUiConf.getQuality()); - } if (TextUtils.isEmpty((properties.getRating()))) { properties.setRating(propUiConf.getRating()); } - } } else { properties = youboraConfigUiConf.getProperties(); } - if (extraParams != null) { - if (youboraConfigUiConf.getExtraParams() != null) { - ExtraParams extraParamsUiConf = youboraConfigUiConf.getExtraParams(); - if (TextUtils.isEmpty((extraParams.getParam1()))) { - extraParams.setParam1(extraParamsUiConf.getParam1()); + if (customDimensions != null) { + if (youboraConfigUiConf.getCustomDimensions() != null) { + CustomDimensions customDimensionsUiConf = youboraConfigUiConf.getCustomDimensions(); + if (TextUtils.isEmpty((customDimensions.getCustomDimension1()))) { + customDimensions.setCustomDimension1(customDimensionsUiConf.getCustomDimension1()); + } + if (TextUtils.isEmpty((customDimensions.getCustomDimension2()))) { + customDimensions.setCustomDimension2(customDimensionsUiConf.getCustomDimension2()); } - if (TextUtils.isEmpty((extraParams.getParam1()))) { - extraParams.setParam1(extraParamsUiConf.getParam1()); + if (TextUtils.isEmpty((customDimensions.getCustomDimension3()))) { + customDimensions.setCustomDimension3(customDimensionsUiConf.getCustomDimension3()); } - if (TextUtils.isEmpty((extraParams.getParam2()))) { - extraParams.setParam2(extraParamsUiConf.getParam2()); + if (TextUtils.isEmpty((customDimensions.getCustomDimension4()))) { + customDimensions.setCustomDimension4(customDimensionsUiConf.getCustomDimension4()); } - if (TextUtils.isEmpty((extraParams.getParam3()))) { - extraParams.setParam3(extraParamsUiConf.getParam3()); + if (TextUtils.isEmpty((customDimensions.getCustomDimension5()))) { + customDimensions.setCustomDimension5(customDimensionsUiConf.getCustomDimension5()); } - if (TextUtils.isEmpty((extraParams.getParam4()))) { - extraParams.setParam4(extraParamsUiConf.getParam4()); + if (TextUtils.isEmpty((customDimensions.getCustomDimension6()))) { + customDimensions.setCustomDimension6(customDimensionsUiConf.getCustomDimension6()); } - if (TextUtils.isEmpty((extraParams.getParam5()))) { - extraParams.setParam5(extraParamsUiConf.getParam5()); + if (TextUtils.isEmpty((customDimensions.getCustomDimension7()))) { + customDimensions.setCustomDimension7(customDimensionsUiConf.getCustomDimension7()); } - if (TextUtils.isEmpty((extraParams.getParam6()))) { - extraParams.setParam6(extraParamsUiConf.getParam6()); + if (TextUtils.isEmpty((customDimensions.getCustomDimension8()))) { + customDimensions.setCustomDimension8(customDimensionsUiConf.getCustomDimension8()); } - if (TextUtils.isEmpty((extraParams.getParam7()))) { - extraParams.setParam7(extraParamsUiConf.getParam7()); + if (TextUtils.isEmpty((customDimensions.getCustomDimension9()))) { + customDimensions.setCustomDimension9(customDimensionsUiConf.getCustomDimension9()); } - if (TextUtils.isEmpty((extraParams.getParam8()))) { - extraParams.setParam8(extraParamsUiConf.getParam8()); + if (TextUtils.isEmpty((customDimensions.getCustomDimension10()))) { + customDimensions.setCustomDimension10(customDimensionsUiConf.getCustomDimension10()); } - if (TextUtils.isEmpty((extraParams.getParam1()))) { - extraParams.setParam9(extraParamsUiConf.getParam9()); + if (TextUtils.isEmpty((customDimensions.getCustomDimension11()))) { + customDimensions.setCustomDimension11(customDimensionsUiConf.getCustomDimension11()); } - if (TextUtils.isEmpty((extraParams.getParam10()))) { - extraParams.setParam10(extraParamsUiConf.getParam10()); + if (TextUtils.isEmpty((customDimensions.getCustomDimension12()))) { + customDimensions.setCustomDimension12(customDimensionsUiConf.getCustomDimension12()); + } + if (TextUtils.isEmpty((customDimensions.getCustomDimension13()))) { + customDimensions.setCustomDimension13(customDimensionsUiConf.getCustomDimension13()); + } + if (TextUtils.isEmpty((customDimensions.getCustomDimension14()))) { + customDimensions.setCustomDimension14(customDimensionsUiConf.getCustomDimension14()); + } + if (TextUtils.isEmpty((customDimensions.getCustomDimension15()))) { + customDimensions.setCustomDimension15(customDimensionsUiConf.getCustomDimension15()); + } + if (TextUtils.isEmpty((customDimensions.getCustomDimension16()))) { + customDimensions.setCustomDimension16(customDimensionsUiConf.getCustomDimension16()); + } + if (TextUtils.isEmpty((customDimensions.getCustomDimension17()))) { + customDimensions.setCustomDimension17(customDimensionsUiConf.getCustomDimension17()); + } + if (TextUtils.isEmpty((customDimensions.getCustomDimension18()))) { + customDimensions.setCustomDimension18(customDimensionsUiConf.getCustomDimension18()); + } + if (TextUtils.isEmpty((customDimensions.getCustomDimension19()))) { + customDimensions.setCustomDimension19(customDimensionsUiConf.getCustomDimension19()); + } + if (TextUtils.isEmpty((customDimensions.getCustomDimension20()))) { + customDimensions.setCustomDimension20(customDimensionsUiConf.getCustomDimension20()); } } } else { - extraParams = youboraConfigUiConf.getExtraParams(); + customDimensions = youboraConfigUiConf.getCustomDimensions(); } - } } \ No newline at end of file diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java new file mode 100644 index 0000000..a7901b3 --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java @@ -0,0 +1,563 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig; + +import androidx.annotation.NonNull; + +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; + + + + +public class YouboraConfigJsonBuilder { + + @NonNull + static JsonObject getYouboraConfigJsonObject(JsonPrimitive accountCode, + JsonPrimitive username, + JsonPrimitive userEmail, + JsonPrimitive userAnonymousId, + JsonPrimitive userType, + JsonPrimitive appName, + JsonPrimitive appReleaseVersion, + JsonPrimitive houseHoldId, + JsonPrimitive isUserObfuscateIp, + JsonPrimitive httpSecure, + JsonPrimitive isAutoStart, + JsonPrimitive isAutoDetectBackground, + JsonPrimitive isEnabled, + JsonPrimitive isForceInit, + JsonPrimitive isOffline, + JsonObject app, + JsonObject parse, + JsonObject device, + JsonObject content, + JsonObject network, + JsonObject errors, + JsonObject adsEntry, + JsonObject propertiesEntry, + JsonObject customDimentionsEntry) { + JsonObject youboraConfig = new JsonObject(); + youboraConfig.add("accountCode", accountCode); + youboraConfig.add("username", username); + youboraConfig.add("userEmail", userEmail); + youboraConfig.add("userAnonymousId", userAnonymousId); + youboraConfig.add("userType", userType); + youboraConfig.add("appName", appName); + youboraConfig.add("appReleaseVersion", appReleaseVersion); + youboraConfig.add("houseHoldId", houseHoldId); + youboraConfig.add("userObfuscateIp", isUserObfuscateIp); + youboraConfig.add("httpSecure", httpSecure); + + youboraConfig.add("isAutoStart", isAutoStart); + youboraConfig.add("isAutoDetectBackground", isAutoDetectBackground); + youboraConfig.add("isEnabled", isEnabled); + youboraConfig.add("isForceInit", isForceInit); + youboraConfig.add("isOffline", isOffline); + + youboraConfig.add("app", app); + youboraConfig.add("parse", parse); + youboraConfig.add("device", device); + youboraConfig.add("content", content); + youboraConfig.add("network", network); + youboraConfig.add("errors", errors); + youboraConfig.add("ads", adsEntry); + youboraConfig.add("properties", propertiesEntry); + youboraConfig.add("customDimentionsEntry", customDimentionsEntry); + return youboraConfig; + } + + @NonNull + static JsonObject getAppJsonObject(App app) { + JsonObject appJsonObject = new JsonObject(); + if (app == null) { + return appJsonObject; + } + + if (app.getAppName() != null) { + appJsonObject.addProperty("appName", app.getAppName()); + } + + if (app.getAppReleaseVersion() != null) { + appJsonObject.addProperty("appName", app.getAppReleaseVersion()); + } + + return appJsonObject; + } + + @NonNull + static JsonObject getParseJsonObject(Parse parse) { + + JsonObject parseJsonObject = new JsonObject(); + if (parse == null) { + return parseJsonObject; + } + + if (parse.getParseManifest() != null) { + parseJsonObject.addProperty("parseManifest", parse.getParseManifest()); + } + + if (parse.getParseCdnNode() != null) { + parseJsonObject.addProperty("parseCdnNode", parse.getParseCdnNode()); + } + + if (parse.getParseCdnSwitchHeader() != null) { + parseJsonObject.addProperty("parseCdnSwitchHeader", parse.getParseCdnSwitchHeader()); + } + + if (parse.getCdnNodeList() != null) { + JsonArray cdnNodeListJsonArray = new JsonArray(); + for(String cdn : parse.getCdnNodeList()) { + cdnNodeListJsonArray.add(cdn); + } + parseJsonObject.add("cdnNodeList", cdnNodeListJsonArray); + } + + if (parse.getCdnNameHeaders() != null) { + parseJsonObject.addProperty("cdnNameHeaders", parse.getCdnNameHeaders() ); + } + + if (parse.getParseCdnTTL() != null) { + parseJsonObject.addProperty("parseCdnTTL", parse.getParseCdnTTL()); + } + return parseJsonObject; + } + + @NonNull + static JsonObject getDeviceJsonObject(Device device) { + JsonObject deviceJsonObject = new JsonObject(); + if (device == null) { + return deviceJsonObject; + } + + if (device.getDeviceCode() != null) { + deviceJsonObject.addProperty("deviceCode", device.getDeviceCode()); + } + + if (device.getDeviceModel() != null) { + deviceJsonObject.addProperty("deviceModel", device.getDeviceModel()); + } + + if (device.getDeviceId() != null) { + deviceJsonObject.addProperty("deviceId", device.getDeviceId()); + } + + if (device.getDeviceBrand() != null) { + deviceJsonObject.addProperty("deviceBrand", device.getDeviceBrand()); + } + + if (device.getDeviceType() != null) { + deviceJsonObject.addProperty("deviceType", device.getDeviceType()); + } + + if (device.getDeviceOsName() != null) { + deviceJsonObject.addProperty("deviceOsName", device.getDeviceOsName()); + } + + if (device.getDeviceOsVersion() != null) { + deviceJsonObject.addProperty("deviceOsVersion", device.getDeviceOsVersion()); + } + return deviceJsonObject; + } + + @NonNull + static JsonObject getContentJsonObject(Content content) { + + JsonObject contentEntry = new JsonObject(); + if (content == null) { + return contentEntry; + } + + if (content.getContentBitrate() != null) { + contentEntry.addProperty("contentBitrate", content.getContentBitrate()); + } + if (content.getContentCdn() != null) { + contentEntry.addProperty("contentCdn", content.getContentCdn()); + } + if (content.getContentCdnNode() != null) { + contentEntry.addProperty("contentCdnNode", content.getContentCdnNode()); + } + if (content.getContentCdnType() != null) { + contentEntry.addProperty("contentCdnType", content.getContentCdnType()); + } + if (content.getContentChannel() != null) { + contentEntry.addProperty("contentChannel", content.getContentChannel()); + } + if (content.getContentContractedResolution() != null) { + contentEntry.addProperty("contentContractedResolution", content.getContentContractedResolution()); + } + if (content.getContentCost() != null) { + contentEntry.addProperty("contentCost", content.getContentCost()); + } + if (content.getContentDrm() != null) { + contentEntry.addProperty("contentDrm", content.getContentDrm()); + } + if (content.getContentDuration() != null) { + contentEntry.addProperty("contentDuration", content.getContentDuration()); + } + if (content.getContentEncodingAudioCodec() != null) { + contentEntry.addProperty("contentEncodingAudioCodec", content.getContentEncodingAudioCodec()); + } + if (content.getContentEncodingCodecProfile() != null) { + contentEntry.addProperty("contentEncodingCodecProfile", content.getContentEncodingCodecProfile()); + } + if (content.getContentEncodingContainerFormat() != null) { + contentEntry.addProperty("contentEncodingContainerFormat", content.getContentEncodingContainerFormat()); + } + if (content.getContentEncodingVideoCodec() != null) { + contentEntry.addProperty("contentEncodingVideoCodec", content.getContentEncodingVideoCodec()); + } + if (content.getContentEpisodeTitle() != null) { + contentEntry.addProperty("contentEpisodeTitle", content.getContentEpisodeTitle()); + } + if (content.getContentFps() != null) { + contentEntry.addProperty("contentFps", content.getContentFps()); + } + if (content.getContentGenre() != null) { + contentEntry.addProperty("contentGenre", content.getContentGenre()); + } + if (content.getContentGracenoteId() != null) { + contentEntry.addProperty("contentGracenoteId", content.getContentGracenoteId()); + } + if (content.getContentId() != null) { + contentEntry.addProperty("contentId", content.getContentId()); + } + if (content.getContentImdbId() != null) { + contentEntry.addProperty("contentImdbId", content.getContentImdbId()); + } + contentEntry.addProperty("contentisLive", content.getContentIsLive() != null ? content.getContentIsLive() : Boolean.FALSE); + contentEntry.addProperty("contentIsLiveNoSeek", content.getContentIsLiveNoSeek() != null ? content.getContentIsLiveNoSeek() : Boolean.FALSE); + if (content.getContentLanguage() != null) { + contentEntry.addProperty("contentLanguage", content.getContentLanguage()); + } + if (content.getContentPackage() != null) { + contentEntry.addProperty("contentPackage", content.getContentPackage()); + } + if (content.getContentPlaybackType() != null) { + contentEntry.addProperty("contentPlaybackType", content.getContentPlaybackType()); + } + if (content.getContentPrice() != null) { + contentEntry.addProperty("contentPrice", content.getContentPrice()); + } + if (content.getContentProgram() != null) { + contentEntry.addProperty("contentProgram", content.getContentProgram()); + } + if (content.getContentRendition() != null) { + contentEntry.addProperty("conetentRendition", content.getContentRendition()); + } + if (content.getContentResource() != null) { + contentEntry.addProperty("contentResource", content.getContentResource()); + } + if (content.getContentSaga() != null) { + contentEntry.addProperty("contentSaga", content.getContentSaga()); + } + if (content.getContentSeason() != null) { + contentEntry.addProperty("contentSeason", content.getContentSeason()); + } + if (content.getContentStreamingProtocol() != null) { + contentEntry.addProperty("contentStreamingProtocol", content.getContentStreamingProtocol()); + } + if (content.getContentSubtitles() != null) { + contentEntry.addProperty("contentSubtitles", content.getContentSubtitles()); + } + if (content.getContentThroughput() != null) { + contentEntry.addProperty("contentThroughput", content.getContentThroughput()); + } + if (content.getContentTitle() != null) { + contentEntry.addProperty("contentTitle", content.getContentTitle()); + } + if (content.getContentTransactionCode() != null) { + contentEntry.addProperty("contentTransactionCode", content.getContentTransactionCode()); + } + if (content.getContentTotalBytes() != null) { + contentEntry.addProperty("contentTotalBytes", content.getContentTotalBytes()); + } + contentEntry.addProperty("contentSendTotalBytes", content.getContentSendTotalBytes()); + if (content.getContentTvShow() != null) { + contentEntry.addProperty("contentTvShow", content.getContentTvShow()); + } + if (content.getContentType() != null) { + contentEntry.addProperty("contentType", content.getContentType()); + } + + return contentEntry; + } + + @NonNull + static JsonObject getNetworkJsonObject(Network network) { + + JsonObject networkJsonObject = new JsonObject(); + if (network == null) { + return networkJsonObject; + } + + if (network.getNetworkConnectionType() != null) { + networkJsonObject.addProperty("networkConnectionType", network.getNetworkConnectionType()); + } + + if (network.getNetworkIP() != null) { + networkJsonObject.addProperty("networkIP", network.getNetworkIP()); + } + + if (network.getNetworkIsp() != null) { + networkJsonObject.addProperty("setNetworkIsp", network.getNetworkIsp()); + } + + return networkJsonObject; + } + + @NonNull + static JsonObject getErrorsJsonObject(Errors errors) { + + JsonObject errorsJsonObject = new JsonObject(); + if (errors == null) { + return errorsJsonObject; + } + + if (errors.getErrorsIgnore() != null) { + JsonArray errorsIgnoreJsonArray = new JsonArray(); + for(String errorIgnore : errors.getErrorsIgnore()) { + errorsIgnoreJsonArray.add(errorIgnore); + } + errorsJsonObject.add("errorsIgnore", errorsIgnoreJsonArray); + } + + if (errors.getErrorsFatal() != null) { + JsonArray errorsFatalJsonArray = new JsonArray(); + for(String errorFatal : errors.getErrorsFatal()) { + errorsFatalJsonArray.add(errorFatal); + } + errorsJsonObject.add("errorsFatal", errorsFatalJsonArray); + } + + if (errors.getErrorsNonFatal() != null) { + JsonArray errorsNonFatalJsonArray = new JsonArray(); + + for(String errorNonFatal : errors.getErrorsNonFatal()) { + errorsNonFatalJsonArray.add(errorNonFatal); + } + errorsJsonObject.add("errorsNonFatal", errorsNonFatalJsonArray); + } + + return errorsJsonObject; + } + + + @NonNull + static JsonObject getAdsJsonObject(Ads ads) { + + JsonObject adsEntry = new JsonObject(); + if (ads == null) { + return adsEntry; + } + + if (ads.getAdBreaksTime() != null) { + JsonArray adBreaksTimeArray = new JsonArray(); + for (Integer adBreak : ads.getAdBreaksTime()) { + adBreaksTimeArray.add(adBreak); + } + adsEntry.add("adBreaksTime", adBreaksTimeArray); + } + if (ads.getAdCampaign() != null) { + adsEntry.addProperty("adCampaign", ads.getAdCampaign()); + } + if (ads.getAdCreativeId() != null) { + adsEntry.addProperty("adCreativeId", ads.getAdCreativeId()); + } + if (ads.getAdExpectedBreaks() != null) { + adsEntry.addProperty("adExpectedBreaks", ads.getAdExpectedBreaks()); + } + if (ads.getAdGivenBreaks() != null) { + adsEntry.addProperty("adGivenBreaks", ads.getAdGivenBreaks()); + } + if (ads.getAdProvider() != null) { + adsEntry.addProperty("adProvider", ads.getAdProvider()); + } + if (ads.getAdResource() != null) { + adsEntry.addProperty("adResource", ads.getAdResource()); + } + if (ads.getAdTitle() != null) { + adsEntry.addProperty("adTitle", ads.getAdTitle()); + } + + return adsEntry; + } + + @NonNull + static JsonObject getPropertiesJsonObject(Properties prop) { + JsonObject propertiesEntry = new JsonObject(); + if (prop == null) { + return propertiesEntry; + } + + if (prop.getYear() != null) { + propertiesEntry.addProperty("year", prop.getYear()); + } + if (prop.getCast() != null) { + propertiesEntry.addProperty("cast", prop.getCast()); + } + if (prop.getDirector() != null) { + propertiesEntry.addProperty("director", prop.getDirector()); + } + if (prop.getOwner() != null) { + propertiesEntry.addProperty("owner", prop.getOwner()); + } + if (prop.getParental() != null) { + propertiesEntry.addProperty("parental", prop.getParental()); + } + if (prop.getRating() != null) { + propertiesEntry.addProperty("rating", prop.getRating()); + } + if (prop.getDevice() != null) { + propertiesEntry.addProperty("device", prop.getDevice()); + } + if (prop.getAudioChannels() != null) { + propertiesEntry.addProperty("audioChannels", prop.getAudioChannels()); + } + + /// LEGACY SUPPORT: + if (prop.getGenre() != null) { + propertiesEntry.addProperty("genre", prop.getGenre()); + } + if (prop.getType() != null) { + propertiesEntry.addProperty("type", prop.getType()); + } + if (prop.getTransactionType() != null) { + propertiesEntry.addProperty("transactionType", prop.getTransactionType()); + } + if (prop.getDevice() != null) { + propertiesEntry.addProperty("device", prop.getDevice()); + } + if (prop.getQuality() != null) { + propertiesEntry.addProperty("quality", prop.getQuality()); + } + if (prop.getContentPackage() != null) { + propertiesEntry.addProperty("contentPackage", prop.getContentPackage()); + } + if (prop.getContentCdnCode() != null) { + propertiesEntry.addProperty("contentCdnCode", prop.getContentCdnCode()); + } + if (prop.getContentSaga() != null) { + propertiesEntry.addProperty("contentSaga", prop.getContentSaga()); + } + if (prop.getContentTvShow() != null) { + propertiesEntry.addProperty("contentTvShow", prop.getContentTvShow()); + } + if (prop.getContentSeason() != null) { + propertiesEntry.addProperty("contentSeason", prop.getContentSeason()); + } + if (prop.getContentEpisodeTitle() != null) { + propertiesEntry.addProperty("contentEpisodeTitle", prop.getContentEpisodeTitle()); + } + if (prop.getContentChannel() != null) { + propertiesEntry.addProperty("contentChannel", prop.getContentChannel()); + } + if (prop.getContentId() != null) { + propertiesEntry.addProperty("contentId", prop.getContentId()); + } + if (prop.getContentImdbId() != null) { + propertiesEntry.addProperty("contentImdbId", prop.getContentImdbId()); + } + if (prop.getContentGracenoteId() != null) { + propertiesEntry.addProperty("contentGracenoteId", prop.getContentGracenoteId()); + } + if (prop.getContentLanguage() != null) { + propertiesEntry.addProperty("contentLanguage", prop.getContentLanguage()); + } + if (prop.getContentSubtitles() != null) { + propertiesEntry.addProperty("contentSubtitles", prop.getContentSubtitles()); + } + if (prop.getContentContractedResolution() != null) { + propertiesEntry.addProperty("contentContractedResolution", prop.getContentContractedResolution()); + } + if (prop.getContentPlaybackType() != null) { + propertiesEntry.addProperty("contentPlaybackType", prop.getContentPlaybackType()); + } + if (prop.getContentDrm() != null) { + propertiesEntry.addProperty("contentDrm", prop.getContentDrm()); + } + if (prop.getContentEncodingVideoCodec() != null) { + propertiesEntry.addProperty("contentEncodingVideoCodec", prop.getContentEncodingVideoCodec()); + } + if (prop.getContentEncodingAudioCodec() != null) { + propertiesEntry.addProperty("contentEncodingAudioCodec", prop.getContentEncodingAudioCodec()); + } + if (prop.getContentEncodingCodecProfile() != null) { + propertiesEntry.addProperty("contentEncodingCodecProfile", prop.getContentEncodingCodecProfile()); + } + if (prop.getContentEncodingContainerFormat() != null) { + propertiesEntry.addProperty("contentEncodingContainerFormat", prop.getContentEncodingContainerFormat()); + } + + return propertiesEntry; + } + + @NonNull + static JsonObject getCustomDimentionsJsonObject(CustomDimensions customDimensions) { + JsonObject customDimensionsEntry = new JsonObject(); + if (customDimensions== null) { + return customDimensionsEntry; + } + + if (customDimensions.getCustomDimension1() != null) { + customDimensionsEntry.addProperty("customDimension1", customDimensions.getCustomDimension1()); + } + if (customDimensions.getCustomDimension2() != null) { + customDimensionsEntry.addProperty("customDimension2", customDimensions.getCustomDimension2()); + } + if (customDimensions.getCustomDimension3() != null) { + customDimensionsEntry.addProperty("customDimension3", customDimensions.getCustomDimension3()); + } + if (customDimensions.getCustomDimension4() != null) { + customDimensionsEntry.addProperty("customDimension4", customDimensions.getCustomDimension4()); + } + if (customDimensions.getCustomDimension5() != null) { + customDimensionsEntry.addProperty("customDimension5", customDimensions.getCustomDimension5()); + } + if (customDimensions.getCustomDimension6() != null) { + customDimensionsEntry.addProperty("customDimension6", customDimensions.getCustomDimension6()); + } + if (customDimensions.getCustomDimension7() != null) { + customDimensionsEntry.addProperty("customDimension7", customDimensions.getCustomDimension7()); + } + if (customDimensions.getCustomDimension8() != null) { + customDimensionsEntry.addProperty("customDimension8", customDimensions.getCustomDimension8()); + } + if (customDimensions.getCustomDimension9() != null) { + customDimensionsEntry.addProperty("customDimension9", customDimensions.getCustomDimension9()); + } + if (customDimensions.getCustomDimension10() != null) { + customDimensionsEntry.addProperty("customDimension10", customDimensions.getCustomDimension10()); + } + if (customDimensions.getCustomDimension11() != null) { + customDimensionsEntry.addProperty("customDimension11", customDimensions.getCustomDimension11()); + } + if (customDimensions.getCustomDimension12() != null) { + customDimensionsEntry.addProperty("customDimension12", customDimensions.getCustomDimension12()); + } + if (customDimensions.getCustomDimension13() != null) { + customDimensionsEntry.addProperty("customDimension13", customDimensions.getCustomDimension13()); + } + if (customDimensions.getCustomDimension14() != null) { + customDimensionsEntry.addProperty("customDimension14", customDimensions.getCustomDimension14()); + } + if (customDimensions.getCustomDimension15() != null) { + customDimensionsEntry.addProperty("customDimension15", customDimensions.getCustomDimension15()); + } + if (customDimensions.getCustomDimension16() != null) { + customDimensionsEntry.addProperty("customDimension16", customDimensions.getCustomDimension16()); + } + if (customDimensions.getCustomDimension17() != null) { + customDimensionsEntry.addProperty("customDimension17", customDimensions.getCustomDimension17()); + } + if (customDimensions.getCustomDimension18() != null) { + customDimensionsEntry.addProperty("customDimension18", customDimensions.getCustomDimension18()); + } + if (customDimensions.getCustomDimension19() != null) { + customDimensionsEntry.addProperty("customDimension19", customDimensions.getCustomDimension19()); + } + if (customDimensions.getCustomDimension20() != null) { + customDimensionsEntry.addProperty("customDimension20", customDimensions.getCustomDimension20()); + } + return customDimensionsEntry; + } +} From c92d2e59a4213f535d133bd8f705d8e48822e6ad Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Thu, 22 Apr 2021 21:49:09 +0300 Subject: [PATCH 080/143] FEC-11127 cont fix isLive legacy logic (#57) * fix isLive legacy logic * make plugin to decide isLive alone * extra braces --- .../plugins/youbora/pluginconfig/Content.java | 11 ++++++++-- .../youbora/pluginconfig/YouboraConfig.java | 20 +++++++++++++++---- .../YouboraConfigJsonBuilder.java | 7 ++++++- 3 files changed, 31 insertions(+), 7 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Content.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Content.java index cbaefd4..fe061dc 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Content.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Content.java @@ -33,9 +33,8 @@ public class Content { private String contentImdbId; @SerializedName(value="contentIsLive", alternate={"isLive"}) private Boolean contentIsLive; - @SerializedName(value="contentIsLiveNoSeek", alternate={"isDVR"}) private Boolean contentIsLiveNoSeek; - + private Boolean isDVR; //LEGACY - the opposite value from contentIsLiveNoSeek private String contentLanguage; //private Bundle contentMetrics; @@ -232,6 +231,14 @@ public void setContentIsLiveNoSeek(Boolean contentIsLiveNoSeek) { this.contentIsLiveNoSeek = contentIsLiveNoSeek; } + public Boolean getIsDVR() { + return isDVR; + } + + public void setIsDVR(Boolean isDVR) { + this.isDVR = isDVR; + } + public String getContentLanguage() { return contentLanguage; } diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index 9e1c1a3..4bf77e2 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -30,6 +30,8 @@ public class YouboraConfig { public static final String KEY_CONTENT_METADATA_RATING = "rating"; + public static final String KEY_CONTENT_METADATA_QUALITY = "quality"; + private String accountCode; private String username; @@ -424,8 +426,15 @@ public Options getYouboraOptions() { if (content.getContentImdbId() != null) { youboraOptions.setContentImdbId(content.getContentImdbId()); } - youboraOptions.setContentIsLive(content.getContentIsLive() != null ? content.getContentIsLive() : Boolean.FALSE); - youboraOptions.setContentIsLiveNoSeek((content.getContentIsLiveNoSeek() != null) ? content.getContentIsLiveNoSeek() : Boolean.FALSE); + if (content.getContentIsLive() != null) { + youboraOptions.setContentIsLive(content.getContentIsLive()); + } + if (content.getContentIsLiveNoSeek() != null) { + youboraOptions.setContentIsLiveNoSeek(content.getContentIsLiveNoSeek()); + } else if (content.getIsDVR() != null) { + youboraOptions.setContentIsLiveNoSeek(!content.getIsDVR()); + } + if (content.getContentLanguage() != null) { youboraOptions.setContentLanguage(content.getContentLanguage()); } @@ -886,8 +895,11 @@ public void merge(YouboraConfig youboraConfigUiConf) { if (content.getContentIsLive() == null) { content.setContentIsLive(youboraConfigUiConf.getContent().getContentIsLive()); } - if (content.getContentIsLiveNoSeek() == null) { - content.setContentIsLiveNoSeek(youboraConfigUiConf.getContent().getContentIsLiveNoSeek()); + if (content.getContentIsLiveNoSeek() == null && youboraConfigUiConf.getContent().getContentIsLiveNoSeek() != null) { + content.setContentIsLiveNoSeek(youboraConfigUiConf.getContent().getContentIsLiveNoSeek()); + } + if (content.getIsDVR() == null && youboraConfigUiConf.getContent().getIsDVR() != null) { + content.setContentIsLiveNoSeek(!youboraConfigUiConf.getContent().getIsDVR()); } if (content.getContentLanguage() == null) { content.setContentLanguage(youboraConfigUiConf.getContent().getContentLanguage()); diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java index a7901b3..6a649ee 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java @@ -225,7 +225,12 @@ static JsonObject getContentJsonObject(Content content) { contentEntry.addProperty("contentImdbId", content.getContentImdbId()); } contentEntry.addProperty("contentisLive", content.getContentIsLive() != null ? content.getContentIsLive() : Boolean.FALSE); - contentEntry.addProperty("contentIsLiveNoSeek", content.getContentIsLiveNoSeek() != null ? content.getContentIsLiveNoSeek() : Boolean.FALSE); + if (content.getContentIsLiveNoSeek() != null) { + contentEntry.addProperty("contentIsLiveNoSeek", content.getContentIsLiveNoSeek()); + } else if (content.getIsDVR() != null) { + contentEntry.addProperty("contentIsLiveNoSeek", !content.getIsDVR()); + } + if (content.getContentLanguage() != null) { contentEntry.addProperty("contentLanguage", content.getContentLanguage()); } From 150c9ea996d2b0eaf3eb310c5df431032ea79993 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Sun, 25 Apr 2021 11:00:04 +0300 Subject: [PATCH 081/143] fix to customDimentions json key name (#58) --- .../plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java index 6a649ee..98c5024 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java @@ -62,7 +62,7 @@ static JsonObject getYouboraConfigJsonObject(JsonPrimitive accountCode, youboraConfig.add("errors", errors); youboraConfig.add("ads", adsEntry); youboraConfig.add("properties", propertiesEntry); - youboraConfig.add("customDimentionsEntry", customDimentionsEntry); + youboraConfig.add("customDimentions", customDimentionsEntry); return youboraConfig; } From b7359143dc739be06288f1fb38feb92d77d2009a Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Thu, 29 Apr 2021 20:02:00 +0300 Subject: [PATCH 082/143] FEC-11127 cont add missing attributes (#59) * add missing attributes * add transportForamt; * add urlToParse ; * add linkedViewId * add givenAds --- .../plugins/youbora/pluginconfig/Ads.java | 9 ++++ .../youbora/pluginconfig/YouboraConfig.java | 50 +++++++++++++++++-- .../YouboraConfigJsonBuilder.java | 6 +++ 3 files changed, 61 insertions(+), 4 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Ads.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Ads.java index d778e68..e703612 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Ads.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Ads.java @@ -12,6 +12,7 @@ public class Ads { private String adCreativeId; private Integer adExpectedBreaks; //private Bundle adExpectedPattern; + private Integer givenAds; private Integer adGivenBreaks; //private Bundle adMetadata; private String adProvider; @@ -53,6 +54,14 @@ public void setAdExpectedBreaks(Integer adExpectedBreaks) { this.adExpectedBreaks = adExpectedBreaks; } + public Integer getGivenAds() { + return givenAds; + } + + public void setGivenAds(Integer givenAds) { + this.givenAds = givenAds; + } + public Integer getAdGivenBreaks() { return adGivenBreaks; } diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index 4bf77e2..cdae422 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -3,9 +3,6 @@ import android.os.Bundle; import android.text.TextUtils; -import androidx.annotation.NonNull; - -import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; import com.google.gson.annotations.SerializedName; @@ -52,6 +49,12 @@ public class YouboraConfig { private String appReleaseVersion = ""; + private String transportFormat; + + private String urlToParse; + + private String linkedViewId; + private boolean isAutoStart = true; private boolean isAutoDetectBackground = true; @@ -148,6 +151,30 @@ public void setAppReleaseVersion(String appReleaseVersion) { this.appReleaseVersion = appReleaseVersion; } + public String getTransportFormat() { + return transportFormat; + } + + public void setTransportFormat(String transportFormat) { + this.transportFormat = transportFormat; + } + + public String getUrlToParse() { + return urlToParse; + } + + public void setUrlToParse(String urlToParse) { + this.urlToParse = urlToParse; + } + + public String getLinkedViewId() { + return linkedViewId; + } + + public void setLinkedViewId(String linkedViewId) { + this.linkedViewId = linkedViewId; + } + public String getHouseHoldId() { return houseHoldId; } @@ -294,6 +321,9 @@ public Options getYouboraOptions() { youboraOptions.setUserType(userType); youboraOptions.setAppName(appName); youboraOptions.setAppReleaseVersion(appReleaseVersion); + youboraOptions.setTransportFormat(transportFormat); + youboraOptions.setUrlToParse(urlToParse); + youboraOptions.setLinkedViewId(linkedViewId); youboraOptions.setUserObfuscateIp(userObfuscateIp); youboraOptions.setHttpSecure(httpSecure); youboraOptions.setAutoStart(isAutoStart); @@ -532,6 +562,9 @@ public Options getYouboraOptions() { if (ads.getAdExpectedBreaks() != null) { youboraOptions.setAdExpectedBreaks(ads.getAdExpectedBreaks()); } + if (ads.getGivenAds() != null) { + youboraOptions.setGivenAds(ads.getGivenAds()); + } if (ads.getAdGivenBreaks() != null) { youboraOptions.setAdGivenBreaks(ads.getAdGivenBreaks()); } @@ -769,6 +802,9 @@ public JsonObject toJson() { JsonPrimitive appName = new JsonPrimitive(getAppName() != null ? getAppName() : ""); JsonPrimitive appReleaseVersion = new JsonPrimitive(getAppReleaseVersion() != null ? getAppReleaseVersion() : ""); JsonPrimitive houseHoldId = new JsonPrimitive(getHouseHoldId() != null ? getHouseHoldId() : ""); + JsonPrimitive transportFormat = new JsonPrimitive(getTransportFormat()); + JsonPrimitive urlToParse = new JsonPrimitive(getUrlToParse()); + JsonPrimitive linkedViewId = new JsonPrimitive(getLinkedViewId()); JsonPrimitive isUserObfuscateIp = new JsonPrimitive(getUserObfuscateIp()); JsonPrimitive httpSecure = new JsonPrimitive(getHttpSecure()); JsonPrimitive isAutoStart = new JsonPrimitive(getIsAutoStart()); @@ -794,6 +830,9 @@ public JsonObject toJson() { appName, appReleaseVersion, houseHoldId, + transportFormat, + urlToParse, + linkedViewId, isUserObfuscateIp, httpSecure, isAutoStart, @@ -1042,6 +1081,9 @@ public void merge(YouboraConfig youboraConfigUiConf) { if (ads.getAdExpectedBreaks() == null) { ads.setAdExpectedBreaks(youboraConfigUiConf.getAds().getAdExpectedBreaks()); } + if (ads.getGivenAds() == null) { + ads.setGivenAds(youboraConfigUiConf.getAds().getGivenAds()); + } if (ads.getAdGivenBreaks() == null) { ads.setAdGivenBreaks(youboraConfigUiConf.getAds().getAdGivenBreaks()); } @@ -1160,4 +1202,4 @@ public void merge(YouboraConfig youboraConfigUiConf) { customDimensions = youboraConfigUiConf.getCustomDimensions(); } } -} \ No newline at end of file +} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java index 98c5024..7e7c531 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java @@ -20,6 +20,9 @@ static JsonObject getYouboraConfigJsonObject(JsonPrimitive accountCode, JsonPrimitive appName, JsonPrimitive appReleaseVersion, JsonPrimitive houseHoldId, + JsonPrimitive transportFormat, + JsonPrimitive urlToParse, + JsonPrimitive linkedViewId, JsonPrimitive isUserObfuscateIp, JsonPrimitive httpSecure, JsonPrimitive isAutoStart, @@ -44,6 +47,9 @@ static JsonObject getYouboraConfigJsonObject(JsonPrimitive accountCode, youboraConfig.add("userType", userType); youboraConfig.add("appName", appName); youboraConfig.add("appReleaseVersion", appReleaseVersion); + youboraConfig.add("transportFormat", transportFormat); + youboraConfig.add("urlToParse", urlToParse); + youboraConfig.add("linkedViewId", linkedViewId); youboraConfig.add("houseHoldId", houseHoldId); youboraConfig.add("userObfuscateIp", isUserObfuscateIp); youboraConfig.add("httpSecure", httpSecure); From ee8e9d1a22cef56e1ee25c3c4a478a5fad224d09 Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Mon, 3 May 2021 10:20:13 +0530 Subject: [PATCH 083/143] - Kotlin plugin level support (#61) --- build.gradle | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/build.gradle b/build.gradle index 9939c3f..db5c733 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - + ext.kotlin_version = '1.4.32' repositories { jcenter() google() @@ -10,9 +10,7 @@ buildscript { } dependencies { classpath 'com.android.tools.build:gradle:3.6.2' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } From 9129e11f906f35eae187e3922e12e7bc0bb0f6ce Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Mon, 3 May 2021 15:15:05 +0530 Subject: [PATCH 084/143] FEC-10913 Passing ErrorCode and ErrorMessage on correct place (#60) --- .../playkit/plugins/youbora/PKYouboraAdsAdapter.java | 2 +- .../plugins/youbora/PKYouboraPlayerAdapter.java | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java index 961bc38..29247fb 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java @@ -424,7 +424,7 @@ private void handleAdError(PKError error) { if (error.exception instanceof Exception) { adException = (Exception) error.exception; } - fireFatalError(error.message, adErrorType.name(), null, adException); + fireFatalError(String.valueOf(adErrorType.errorCode), error.message, adErrorType.name(), adException); } sendReportEvent(adErrorType); } diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index cfc6074..c0be994 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -27,6 +27,7 @@ import com.kaltura.playkit.PlayerEvent; import com.kaltura.playkit.ads.AdController; import com.kaltura.playkit.ads.PKAdPluginType; +import com.kaltura.playkit.player.PKPlayerErrorType; import com.kaltura.playkit.plugins.ads.AdCuePoints; import com.kaltura.playkit.plugins.ads.AdEvent; import com.kaltura.playkit.utils.Consts; @@ -133,15 +134,20 @@ private void sendErrorHandler(PKEvent event) { LinkedHashSet causeMessages = getExceptionMessageChain(playerErrorException); StringBuilder exceptionCauseBuilder = new StringBuilder(); if (playerErrorException != null && causeMessages.isEmpty()) { - exceptionCauseBuilder.append(playerErrorException.toString()); + exceptionCauseBuilder.append(playerErrorException.toString()).append("\n"); } else { for (String cause : causeMessages) { exceptionCauseBuilder.append(cause).append("\n"); } } - String errorCode = (errorEvent.error.errorType != null) ? errorEvent.error.errorType + " - " : ""; - fireFatalError(exceptionCauseBuilder.toString(), errorCode + exceptionClass, errorMetadata); + if ((error.errorType) instanceof PKPlayerErrorType) { + PKPlayerErrorType errorType = (PKPlayerErrorType)error.errorType; + String errorCode = String.valueOf(errorType.errorCode); + fireFatalError(errorCode, exceptionCauseBuilder.toString() + " - " + exceptionClass, errorMetadata, playerErrorException); + } else { + fireFatalError(event.eventType().name(), exceptionCauseBuilder.toString() + " - " + exceptionClass , errorMetadata, playerErrorException); + } } public static LinkedHashSet getExceptionMessageChain(Throwable throwable) { From ee93fd9d64e6a2a84b2554cea90c793da10865e8 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 5 May 2021 15:49:59 +0300 Subject: [PATCH 085/143] FEC-11127 cont rename to adGivenAds (#62) * rename to adGivenAds move transportFormat to contentTransportFormat * add missing parse prefix --- .../plugins/youbora/pluginconfig/Ads.java | 10 ++--- .../plugins/youbora/pluginconfig/Content.java | 10 +++++ .../plugins/youbora/pluginconfig/Parse.java | 20 ++++----- .../youbora/pluginconfig/YouboraConfig.java | 43 ++++++++----------- .../YouboraConfigJsonBuilder.java | 22 ++++++---- 5 files changed, 56 insertions(+), 49 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Ads.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Ads.java index e703612..0e57146 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Ads.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Ads.java @@ -12,7 +12,7 @@ public class Ads { private String adCreativeId; private Integer adExpectedBreaks; //private Bundle adExpectedPattern; - private Integer givenAds; + private Integer adGivenAds; private Integer adGivenBreaks; //private Bundle adMetadata; private String adProvider; @@ -54,12 +54,12 @@ public void setAdExpectedBreaks(Integer adExpectedBreaks) { this.adExpectedBreaks = adExpectedBreaks; } - public Integer getGivenAds() { - return givenAds; + public Integer getAdGivenAds() { + return adGivenAds; } - public void setGivenAds(Integer givenAds) { - this.givenAds = givenAds; + public void setAdGivenAds(Integer adGivenAds) { + this.adGivenAds = adGivenAds; } public Integer getAdGivenBreaks() { diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Content.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Content.java index fe061dc..c1ab059 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Content.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Content.java @@ -59,6 +59,8 @@ public class Content { @SerializedName(value="contentTransactionCode", alternate={"transactionType"}) private String contentTransactionCode; private Long contentTotalBytes; + private String contentTransportFormat; + private boolean contentSendTotalBytes; private String contentTvShow; private String contentType; @@ -359,6 +361,14 @@ public void setContentTotalBytes(Long contentTotalBytes) { this.contentTotalBytes = contentTotalBytes; } + public String getContentTransportFormat() { + return contentTransportFormat; + } + + public void setContentTransportFormat(String contentTransportFormat) { + this.contentTransportFormat = contentTransportFormat; + } + public boolean getContentSendTotalBytes() { return contentSendTotalBytes; } diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Parse.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Parse.java index 3e7d58f..6e65eea 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Parse.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Parse.java @@ -7,8 +7,8 @@ public class Parse { private Boolean parseManifest; private Boolean parseCdnNode; private Boolean parseCdnSwitchHeader; - private ArrayList cdnNodeList; - private String cdnNameHeaders; + private ArrayList parseCdnNodeList; + private String parseCdnNameHeader; private Integer parseCdnTTL; public Boolean getParseManifest() { @@ -35,20 +35,20 @@ public void setParseCdnSwitchHeader(Boolean parseCdnSwitchHeader) { this.parseCdnSwitchHeader = parseCdnSwitchHeader; } - public ArrayList getCdnNodeList() { - return cdnNodeList; + public ArrayList getParseCdnNodeList() { + return parseCdnNodeList; } - public void setCdnNodeList(ArrayList cdnNodeList) { - this.cdnNodeList = cdnNodeList; + public void setParseCdnNodeList(ArrayList parseCdnNodeList) { + this.parseCdnNodeList = parseCdnNodeList; } - public String getCdnNameHeaders() { - return cdnNameHeaders; + public String getParseCdnNameHeader() { + return parseCdnNameHeader; } - public void setCdnNameHeaders(String cdnNameHeaders) { - this.cdnNameHeaders = cdnNameHeaders; + public void setParseCdnNameHeader(String parseCdnNameHeader) { + this.parseCdnNameHeader = parseCdnNameHeader; } public Integer getParseCdnTTL() { diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index cdae422..e78b94a 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -49,8 +49,6 @@ public class YouboraConfig { private String appReleaseVersion = ""; - private String transportFormat; - private String urlToParse; private String linkedViewId; @@ -151,14 +149,6 @@ public void setAppReleaseVersion(String appReleaseVersion) { this.appReleaseVersion = appReleaseVersion; } - public String getTransportFormat() { - return transportFormat; - } - - public void setTransportFormat(String transportFormat) { - this.transportFormat = transportFormat; - } - public String getUrlToParse() { return urlToParse; } @@ -321,7 +311,6 @@ public Options getYouboraOptions() { youboraOptions.setUserType(userType); youboraOptions.setAppName(appName); youboraOptions.setAppReleaseVersion(appReleaseVersion); - youboraOptions.setTransportFormat(transportFormat); youboraOptions.setUrlToParse(urlToParse); youboraOptions.setLinkedViewId(linkedViewId); youboraOptions.setUserObfuscateIp(userObfuscateIp); @@ -351,11 +340,11 @@ public Options getYouboraOptions() { if (parse.getParseCdnSwitchHeader() != null) { youboraOptions.setParseCdnSwitchHeader(parse.getParseCdnSwitchHeader()); } - if (parse.getCdnNodeList() != null) { - youboraOptions.setParseCdnNodeList(parse.getCdnNodeList()); + if (parse.getParseCdnNodeList() != null) { + youboraOptions.setParseCdnNodeList(parse.getParseCdnNodeList()); } - if (parse.getCdnNameHeaders() != null) { - youboraOptions.setParseCdnNameHeader(parse.getCdnNameHeaders()); + if (parse.getParseCdnNameHeader() != null) { + youboraOptions.setParseCdnNameHeader(parse.getParseCdnNameHeader()); } if (parse.getParseCdnTTL() != null) { youboraOptions.setParseCdnTTL(parse.getParseCdnTTL()); @@ -507,6 +496,9 @@ public Options getYouboraOptions() { if (content.getContentTransactionCode() != null) { youboraOptions.setContentTransactionCode(content.getContentTransactionCode()); } + if (content.getContentTransportFormat() != null) { + youboraOptions.setTransportFormat(content.getContentTransportFormat()); + } if (content.getContentTotalBytes() != null) { youboraOptions.setContentTotalBytes(content.getContentTotalBytes()); } @@ -562,8 +554,8 @@ public Options getYouboraOptions() { if (ads.getAdExpectedBreaks() != null) { youboraOptions.setAdExpectedBreaks(ads.getAdExpectedBreaks()); } - if (ads.getGivenAds() != null) { - youboraOptions.setGivenAds(ads.getGivenAds()); + if (ads.getAdGivenAds() != null) { + youboraOptions.setGivenAds(ads.getAdGivenAds()); } if (ads.getAdGivenBreaks() != null) { youboraOptions.setAdGivenBreaks(ads.getAdGivenBreaks()); @@ -802,7 +794,6 @@ public JsonObject toJson() { JsonPrimitive appName = new JsonPrimitive(getAppName() != null ? getAppName() : ""); JsonPrimitive appReleaseVersion = new JsonPrimitive(getAppReleaseVersion() != null ? getAppReleaseVersion() : ""); JsonPrimitive houseHoldId = new JsonPrimitive(getHouseHoldId() != null ? getHouseHoldId() : ""); - JsonPrimitive transportFormat = new JsonPrimitive(getTransportFormat()); JsonPrimitive urlToParse = new JsonPrimitive(getUrlToParse()); JsonPrimitive linkedViewId = new JsonPrimitive(getLinkedViewId()); JsonPrimitive isUserObfuscateIp = new JsonPrimitive(getUserObfuscateIp()); @@ -830,7 +821,6 @@ public JsonObject toJson() { appName, appReleaseVersion, houseHoldId, - transportFormat, urlToParse, linkedViewId, isUserObfuscateIp, @@ -985,6 +975,9 @@ public void merge(YouboraConfig youboraConfigUiConf) { if (content.getContentTotalBytes() == null) { content.setContentTotalBytes(youboraConfigUiConf.getContent().getContentTotalBytes()); } + if (content.getContentTransportFormat() == null) { + content.setContentTransportFormat(youboraConfigUiConf.getContent().getContentTransportFormat()); + } content.setContentSendTotalBytes(youboraConfigUiConf.getContent().getContentSendTotalBytes()); if (content.getContentTvShow() == null) { content.setContentTvShow(youboraConfigUiConf.getContent().getContentTvShow()); @@ -1018,14 +1011,14 @@ public void merge(YouboraConfig youboraConfigUiConf) { if (parse.getParseCdnNode() == null) { parse.setParseCdnNode(youboraConfigUiConf.getParse().getParseCdnNode()); } - if (parse.getCdnNodeList() == null) { - parse.setCdnNodeList(youboraConfigUiConf.getParse().getCdnNodeList()); + if (parse.getParseCdnNodeList() == null) { + parse.setParseCdnNodeList(youboraConfigUiConf.getParse().getParseCdnNodeList()); } if (parse.getParseCdnTTL() == null) { parse.setParseCdnTTL(youboraConfigUiConf.getParse().getParseCdnTTL()); } - if (parse.getCdnNameHeaders() == null) { - parse.setCdnNameHeaders(youboraConfigUiConf.getParse().getCdnNameHeaders()); + if (parse.getParseCdnNameHeader() == null) { + parse.setParseCdnNameHeader(youboraConfigUiConf.getParse().getParseCdnNameHeader()); } if (parse.getParseCdnSwitchHeader() == null) { parse.setParseCdnSwitchHeader(youboraConfigUiConf.getParse().getParseCdnSwitchHeader()); @@ -1081,8 +1074,8 @@ public void merge(YouboraConfig youboraConfigUiConf) { if (ads.getAdExpectedBreaks() == null) { ads.setAdExpectedBreaks(youboraConfigUiConf.getAds().getAdExpectedBreaks()); } - if (ads.getGivenAds() == null) { - ads.setGivenAds(youboraConfigUiConf.getAds().getGivenAds()); + if (ads.getAdGivenAds() == null) { + ads.setAdGivenAds(youboraConfigUiConf.getAds().getAdGivenAds()); } if (ads.getAdGivenBreaks() == null) { ads.setAdGivenBreaks(youboraConfigUiConf.getAds().getAdGivenBreaks()); diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java index 7e7c531..7df1646 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java @@ -20,7 +20,6 @@ static JsonObject getYouboraConfigJsonObject(JsonPrimitive accountCode, JsonPrimitive appName, JsonPrimitive appReleaseVersion, JsonPrimitive houseHoldId, - JsonPrimitive transportFormat, JsonPrimitive urlToParse, JsonPrimitive linkedViewId, JsonPrimitive isUserObfuscateIp, @@ -47,7 +46,6 @@ static JsonObject getYouboraConfigJsonObject(JsonPrimitive accountCode, youboraConfig.add("userType", userType); youboraConfig.add("appName", appName); youboraConfig.add("appReleaseVersion", appReleaseVersion); - youboraConfig.add("transportFormat", transportFormat); youboraConfig.add("urlToParse", urlToParse); youboraConfig.add("linkedViewId", linkedViewId); youboraConfig.add("houseHoldId", houseHoldId); @@ -110,16 +108,16 @@ static JsonObject getParseJsonObject(Parse parse) { parseJsonObject.addProperty("parseCdnSwitchHeader", parse.getParseCdnSwitchHeader()); } - if (parse.getCdnNodeList() != null) { - JsonArray cdnNodeListJsonArray = new JsonArray(); - for(String cdn : parse.getCdnNodeList()) { - cdnNodeListJsonArray.add(cdn); + if (parse.getParseCdnNodeList() != null) { + JsonArray parseCdnNodeListJsonArray = new JsonArray(); + for(String cdn : parse.getParseCdnNodeList()) { + parseCdnNodeListJsonArray.add(cdn); } - parseJsonObject.add("cdnNodeList", cdnNodeListJsonArray); + parseJsonObject.add("parseCdnNodeList", parseCdnNodeListJsonArray); } - if (parse.getCdnNameHeaders() != null) { - parseJsonObject.addProperty("cdnNameHeaders", parse.getCdnNameHeaders() ); + if (parse.getParseCdnNameHeader() != null) { + parseJsonObject.addProperty("parseCdnNameHeader", parse.getParseCdnNameHeader() ); } if (parse.getParseCdnTTL() != null) { @@ -282,6 +280,9 @@ static JsonObject getContentJsonObject(Content content) { if (content.getContentTotalBytes() != null) { contentEntry.addProperty("contentTotalBytes", content.getContentTotalBytes()); } + if (content.getContentTransportFormat() != null) { + contentEntry.addProperty("contentTransportFormat", content.getContentTransportFormat()); + } contentEntry.addProperty("contentSendTotalBytes", content.getContentSendTotalBytes()); if (content.getContentTvShow() != null) { contentEntry.addProperty("contentTvShow", content.getContentTvShow()); @@ -377,6 +378,9 @@ static JsonObject getAdsJsonObject(Ads ads) { if (ads.getAdExpectedBreaks() != null) { adsEntry.addProperty("adExpectedBreaks", ads.getAdExpectedBreaks()); } + if (ads.getAdGivenAds() != null) { + adsEntry.addProperty("adGivenAds", ads.getAdGivenAds()); + } if (ads.getAdGivenBreaks() != null) { adsEntry.addProperty("adGivenBreaks", ads.getAdGivenBreaks()); } From f4c9ff151c482939cfd581c68b384c03d9470208 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 5 May 2021 16:59:30 +0300 Subject: [PATCH 086/143] FEC-11212 - protect null assignment to new JsonPrimitive (#63) * protect null assignment to new JsonPromitive * compact the code --- .../youbora/pluginconfig/YouboraConfig.java | 58 ++++++++----------- .../YouboraConfigJsonBuilder.java | 57 +++++------------- 2 files changed, 39 insertions(+), 76 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index e78b94a..69500db 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -9,6 +9,9 @@ import com.npaw.youbora.lib6.comm.transform.ViewTransform; import com.npaw.youbora.lib6.plugin.Options; +import java.util.HashMap; +import java.util.Map; + public class YouboraConfig { // Kaltura Youbora Keys for Bundle @@ -786,23 +789,26 @@ private Bundle getAdExpectedPatternBundle() { public JsonObject toJson() { - JsonPrimitive accountCode = new JsonPrimitive(getAccountCode() != null ? getAccountCode() : ""); - JsonPrimitive username = new JsonPrimitive(getUsername() != null ? getUsername() : ""); - JsonPrimitive userEmail = new JsonPrimitive(getUserEmail() != null ? getUserEmail() : ""); - JsonPrimitive userAnonymousId = new JsonPrimitive(getUserAnonymousId() != null ? getUserAnonymousId() : ""); - JsonPrimitive userType = new JsonPrimitive(getUserType() != null ? getUserType() : ""); - JsonPrimitive appName = new JsonPrimitive(getAppName() != null ? getAppName() : ""); - JsonPrimitive appReleaseVersion = new JsonPrimitive(getAppReleaseVersion() != null ? getAppReleaseVersion() : ""); - JsonPrimitive houseHoldId = new JsonPrimitive(getHouseHoldId() != null ? getHouseHoldId() : ""); - JsonPrimitive urlToParse = new JsonPrimitive(getUrlToParse()); - JsonPrimitive linkedViewId = new JsonPrimitive(getLinkedViewId()); - JsonPrimitive isUserObfuscateIp = new JsonPrimitive(getUserObfuscateIp()); - JsonPrimitive httpSecure = new JsonPrimitive(getHttpSecure()); - JsonPrimitive isAutoStart = new JsonPrimitive(getIsAutoStart()); - JsonPrimitive isAutoDetectBackground = new JsonPrimitive(getIsAutoDetectBackground()); - JsonPrimitive isEnabled = new JsonPrimitive(getIsEnabled()); - JsonPrimitive isForceInit = new JsonPrimitive(getIsForceInit()); - JsonPrimitive isOffline = new JsonPrimitive(getIsOffline()); + + Map rootLevelParams = new HashMap<>(); + rootLevelParams.put("accountCode", new JsonPrimitive(getAccountCode() != null ? getAccountCode() : "")); + rootLevelParams.put("username", (getUsername() != null) ? new JsonPrimitive(getUsername()) : null); + rootLevelParams.put("userEmail", (getUserEmail() != null) ? new JsonPrimitive(getUserEmail()) : null); + rootLevelParams.put("userAnonymousId", (getUserAnonymousId() != null) ? new JsonPrimitive(getUserAnonymousId()) : null); + rootLevelParams.put("userType", (getUserType() != null) ? new JsonPrimitive(getUserType()) : null); + rootLevelParams.put("appName", (getAppName() != null) ? new JsonPrimitive(getAppName()) : null); + rootLevelParams.put("appReleaseVersion", (getAppReleaseVersion() != null) ? new JsonPrimitive(getAppReleaseVersion()) : null); + rootLevelParams.put("houseHoldId", (getHouseHoldId() != null) ? new JsonPrimitive(getHouseHoldId()) : null); + rootLevelParams.put("urlToParse", (getUrlToParse() != null) ? new JsonPrimitive(getUrlToParse()) : null); + rootLevelParams.put("linkedViewId", (getLinkedViewId() != null) ? new JsonPrimitive(getLinkedViewId()) : null); + + rootLevelParams.put("isUserObfuscateIp", new JsonPrimitive(getUserObfuscateIp())); + rootLevelParams.put("httpSecure", new JsonPrimitive(getHttpSecure())); + rootLevelParams.put("isAutoStart", new JsonPrimitive(getIsAutoStart())); + rootLevelParams.put("isAutoDetectBackground", new JsonPrimitive(getIsAutoDetectBackground())); + rootLevelParams.put("isEnabled", new JsonPrimitive(getIsEnabled())); + rootLevelParams.put("isForceInit", new JsonPrimitive(getIsForceInit())); + rootLevelParams.put("isOffline", new JsonPrimitive(getIsOffline())); JsonObject app = YouboraConfigJsonBuilder.getAppJsonObject(getApp()); JsonObject parse = YouboraConfigJsonBuilder.getParseJsonObject(getParse()); @@ -813,23 +819,7 @@ public JsonObject toJson() { JsonObject adsEntry = YouboraConfigJsonBuilder.getAdsJsonObject(getAds()); JsonObject propertiesEntry = YouboraConfigJsonBuilder.getPropertiesJsonObject(getProperties()); JsonObject customDimentionsEntry = YouboraConfigJsonBuilder.getCustomDimentionsJsonObject(getCustomDimensions()); - return YouboraConfigJsonBuilder.getYouboraConfigJsonObject(accountCode, - username, - userEmail, - userAnonymousId, - userType, - appName, - appReleaseVersion, - houseHoldId, - urlToParse, - linkedViewId, - isUserObfuscateIp, - httpSecure, - isAutoStart, - isAutoDetectBackground, - isEnabled, - isForceInit, - isOffline, + return YouboraConfigJsonBuilder.getYouboraConfigJsonObject(rootLevelParams, app, parse, device, diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java index 7df1646..30969cd 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java @@ -1,62 +1,35 @@ package com.kaltura.playkit.plugins.youbora.pluginconfig; +import android.text.TextUtils; + import androidx.annotation.NonNull; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; - +import java.util.Map; public class YouboraConfigJsonBuilder { @NonNull - static JsonObject getYouboraConfigJsonObject(JsonPrimitive accountCode, - JsonPrimitive username, - JsonPrimitive userEmail, - JsonPrimitive userAnonymousId, - JsonPrimitive userType, - JsonPrimitive appName, - JsonPrimitive appReleaseVersion, - JsonPrimitive houseHoldId, - JsonPrimitive urlToParse, - JsonPrimitive linkedViewId, - JsonPrimitive isUserObfuscateIp, - JsonPrimitive httpSecure, - JsonPrimitive isAutoStart, - JsonPrimitive isAutoDetectBackground, - JsonPrimitive isEnabled, - JsonPrimitive isForceInit, - JsonPrimitive isOffline, + static JsonObject getYouboraConfigJsonObject( Map rootLevelParams, JsonObject app, JsonObject parse, JsonObject device, JsonObject content, JsonObject network, JsonObject errors, - JsonObject adsEntry, - JsonObject propertiesEntry, - JsonObject customDimentionsEntry) { + JsonObject ads, + JsonObject properties, + JsonObject customDimentions) { JsonObject youboraConfig = new JsonObject(); - youboraConfig.add("accountCode", accountCode); - youboraConfig.add("username", username); - youboraConfig.add("userEmail", userEmail); - youboraConfig.add("userAnonymousId", userAnonymousId); - youboraConfig.add("userType", userType); - youboraConfig.add("appName", appName); - youboraConfig.add("appReleaseVersion", appReleaseVersion); - youboraConfig.add("urlToParse", urlToParse); - youboraConfig.add("linkedViewId", linkedViewId); - youboraConfig.add("houseHoldId", houseHoldId); - youboraConfig.add("userObfuscateIp", isUserObfuscateIp); - youboraConfig.add("httpSecure", httpSecure); - - youboraConfig.add("isAutoStart", isAutoStart); - youboraConfig.add("isAutoDetectBackground", isAutoDetectBackground); - youboraConfig.add("isEnabled", isEnabled); - youboraConfig.add("isForceInit", isForceInit); - youboraConfig.add("isOffline", isOffline); + for (Map.Entry entry :rootLevelParams.entrySet()) { + if (!TextUtils.isEmpty(entry.getKey()) && entry.getValue() != null) { + youboraConfig.add(entry.getKey(), entry.getValue()); + } + } youboraConfig.add("app", app); youboraConfig.add("parse", parse); @@ -64,9 +37,9 @@ static JsonObject getYouboraConfigJsonObject(JsonPrimitive accountCode, youboraConfig.add("content", content); youboraConfig.add("network", network); youboraConfig.add("errors", errors); - youboraConfig.add("ads", adsEntry); - youboraConfig.add("properties", propertiesEntry); - youboraConfig.add("customDimentions", customDimentionsEntry); + youboraConfig.add("ads", ads); + youboraConfig.add("properties", properties); + youboraConfig.add("customDimentions", customDimentions); return youboraConfig; } From 184bc3ede255375604413143e75e7b02f8ef84f5 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 5 May 2021 20:56:58 +0300 Subject: [PATCH 087/143] rename CustomDimension class to ContentCustomDimension (#64) use property contentCustomDimension instead of customDimension update internal members to have content prefix --- .../pluginconfig/ContentCustomDimensions.java | 206 ++++++++++++++++++ .../pluginconfig/CustomDimensions.java | 206 ------------------ .../youbora/pluginconfig/YouboraConfig.java | 150 ++++++------- .../YouboraConfigJsonBuilder.java | 88 ++++---- 4 files changed, 325 insertions(+), 325 deletions(-) create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/ContentCustomDimensions.java delete mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/CustomDimensions.java diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/ContentCustomDimensions.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/ContentCustomDimensions.java new file mode 100644 index 0000000..54ffb51 --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/ContentCustomDimensions.java @@ -0,0 +1,206 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig; + +import com.google.gson.annotations.SerializedName; + +public class ContentCustomDimensions { + @SerializedName(value="contentCustomDimension1", alternate={"param1"}) + private String contentCustomDimension1; + @SerializedName(value="contentCustomDimension2", alternate={"param2"}) + private String contentCustomDimension2; + @SerializedName(value="contentCustomDimension3", alternate={"param3"}) + private String contentCustomDimension3; + @SerializedName(value="contentCustomDimension4", alternate={"param4"}) + private String contentCustomDimension4; + @SerializedName(value="contentCustomDimension5", alternate={"param5"}) + private String contentCustomDimension5; + @SerializedName(value="contentCustomDimension6", alternate={"param6"}) + private String contentCustomDimension6; + @SerializedName(value="contentCustomDimension7", alternate={"param7"}) + private String contentCustomDimension7; + @SerializedName(value="contentCustomDimension8", alternate={"param8"}) + private String contentCustomDimension8; + @SerializedName(value="contentCustomDimension9", alternate={"param9"}) + private String contentCustomDimension9; + @SerializedName(value="contentCustomDimension10", alternate={"param10"}) + private String contentCustomDimension10; + @SerializedName(value="contentCustomDimension11", alternate={"param11"}) + private String contentCustomDimension11; + @SerializedName(value="contentCustomDimension12", alternate={"param12"}) + private String contentCustomDimension12; + @SerializedName(value="contentCustomDimension13", alternate={"param13"}) + private String contentCustomDimension13; + @SerializedName(value="contentCustomDimension14", alternate={"param14"}) + private String contentCustomDimension14; + @SerializedName(value="contentCustomDimension15", alternate={"param15"}) + private String contentCustomDimension15; + @SerializedName(value="contentCustomDimension16", alternate={"param16"}) + private String contentCustomDimension16; + @SerializedName(value="contentCustomDimension17", alternate={"param17"}) + private String contentCustomDimension17; + @SerializedName(value="contentCustomDimension18", alternate={"param18"}) + private String contentCustomDimension18; + @SerializedName(value="contentCustomDimension19", alternate={"param19"}) + private String contentCustomDimension19; + @SerializedName(value="contentCustomDimension20", alternate={"param20"}) + private String contentCustomDimension20; + + public String getContentCustomDimension1() { + return contentCustomDimension1; + } + + public void setContentCustomDimension1(String contentCustomDimension1) { + this.contentCustomDimension1 = contentCustomDimension1; + } + + public String getContentCustomDimension2() { + return contentCustomDimension2; + } + + public void setContentCustomDimension2(String contentCustomDimension2) { + this.contentCustomDimension2 = contentCustomDimension2; + } + + public String getContentCustomDimension3() { + return contentCustomDimension3; + } + + public void setContentCustomDimension3(String contentCustomDimension3) { + this.contentCustomDimension3 = contentCustomDimension3; + } + + public String getContentCustomDimension4() { + return contentCustomDimension4; + } + + public void setContentCustomDimension4(String contentCustomDimension4) { + this.contentCustomDimension4 = contentCustomDimension4; + } + + public String getContentCustomDimension5() { + return contentCustomDimension5; + } + + public void setContentCustomDimension5(String contentCustomDimension5) { + this.contentCustomDimension5 = contentCustomDimension5; + } + + public String getContentCustomDimension6() { + return contentCustomDimension6; + } + + public void setContentCustomDimension6(String contentCustomDimension6) { + this.contentCustomDimension6 = contentCustomDimension6; + } + + public String getContentCustomDimension7() { + return contentCustomDimension7; + } + + public void setContentCustomDimension7(String contentCustomDimension7) { + this.contentCustomDimension7 = contentCustomDimension7; + } + + public String getContentCustomDimension8() { + return contentCustomDimension8; + } + + public void setContentCustomDimension8(String contentCustomDimension8) { + this.contentCustomDimension8 = contentCustomDimension8; + } + + public String getContentCustomDimension9() { + return contentCustomDimension9; + } + + public void setContentCustomDimension9(String contentCustomDimension9) { + this.contentCustomDimension9 = contentCustomDimension9; + } + + public String getContentCustomDimension10() { + return contentCustomDimension10; + } + + public void setContentCustomDimension10(String contentCustomDimension10) { + this.contentCustomDimension10 = contentCustomDimension10; + } + + public String getContentCustomDimension11() { + return contentCustomDimension11; + } + + public void setContentCustomDimension11(String contentCustomDimension11) { + this.contentCustomDimension11 = contentCustomDimension11; + } + + public String getContentCustomDimension12() { + return contentCustomDimension12; + } + + public void setContentCustomDimension12(String contentCustomDimension12) { + this.contentCustomDimension12 = contentCustomDimension12; + } + + public String getContentCustomDimension13() { + return contentCustomDimension13; + } + + public void setContentCustomDimension13(String contentCustomDimension13) { + this.contentCustomDimension13 = contentCustomDimension13; + } + + public String getContentCustomDimension14() { + return contentCustomDimension14; + } + + public void setContentCustomDimension14(String contentCustomDimension14) { + this.contentCustomDimension14 = contentCustomDimension14; + } + + public String getContentCustomDimension15() { + return contentCustomDimension15; + } + + public void setContentCustomDimension15(String contentCustomDimension15) { + this.contentCustomDimension15 = contentCustomDimension15; + } + + public String getContentCustomDimension16() { + return contentCustomDimension16; + } + + public void setContentCustomDimension16(String contentCustomDimension16) { + this.contentCustomDimension16 = contentCustomDimension16; + } + + public String getContentCustomDimension17() { + return contentCustomDimension17; + } + + public void setContentCustomDimension17(String contentCustomDimension17) { + this.contentCustomDimension17 = contentCustomDimension17; + } + + public String getContentCustomDimension18() { + return contentCustomDimension18; + } + + public void setContentCustomDimension18(String contentCustomDimension18) { + this.contentCustomDimension18 = contentCustomDimension18; + } + + public String getContentCustomDimension19() { + return contentCustomDimension19; + } + + public void setContentCustomDimension19(String contentCustomDimension19) { + this.contentCustomDimension19 = contentCustomDimension19; + } + + public String getContentCustomDimension20() { + return contentCustomDimension20; + } + + public void setContentCustomDimension20(String contentCustomDimension20) { + this.contentCustomDimension20 = contentCustomDimension20; + } +} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/CustomDimensions.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/CustomDimensions.java deleted file mode 100644 index b54c5ba..0000000 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/CustomDimensions.java +++ /dev/null @@ -1,206 +0,0 @@ -package com.kaltura.playkit.plugins.youbora.pluginconfig; - -import com.google.gson.annotations.SerializedName; - -public class CustomDimensions { - @SerializedName(value="customDimension1", alternate={"param1"}) - private String customDimension1; - @SerializedName(value="customDimension2", alternate={"param2"}) - private String customDimension2; - @SerializedName(value="customDimension3", alternate={"param3"}) - private String customDimension3; - @SerializedName(value="customDimension4", alternate={"param4"}) - private String customDimension4; - @SerializedName(value="customDimension5", alternate={"param5"}) - private String customDimension5; - @SerializedName(value="customDimension6", alternate={"param6"}) - private String customDimension6; - @SerializedName(value="customDimension7", alternate={"param7"}) - private String customDimension7; - @SerializedName(value="customDimension8", alternate={"param8"}) - private String customDimension8; - @SerializedName(value="customDimension9", alternate={"param9"}) - private String customDimension9; - @SerializedName(value="customDimension10", alternate={"param10"}) - private String customDimension10; - @SerializedName(value="customDimension11", alternate={"param11"}) - private String customDimension11; - @SerializedName(value="customDimension12", alternate={"param12"}) - private String customDimension12; - @SerializedName(value="customDimension13", alternate={"param13"}) - private String customDimension13; - @SerializedName(value="customDimension14", alternate={"param14"}) - private String customDimension14; - @SerializedName(value="customDimension15", alternate={"param15"}) - private String customDimension15; - @SerializedName(value="customDimension16", alternate={"param16"}) - private String customDimension16; - @SerializedName(value="customDimension17", alternate={"param17"}) - private String customDimension17; - @SerializedName(value="customDimension18", alternate={"param18"}) - private String customDimension18; - @SerializedName(value="customDimension19", alternate={"param19"}) - private String customDimension19; - @SerializedName(value="customDimension20", alternate={"param20"}) - private String customDimension20; - - public String getCustomDimension1() { - return customDimension1; - } - - public void setCustomDimension1(String customDimension1) { - this.customDimension1 = customDimension1; - } - - public String getCustomDimension2() { - return customDimension2; - } - - public void setCustomDimension2(String customDimension2) { - this.customDimension2 = customDimension2; - } - - public String getCustomDimension3() { - return customDimension3; - } - - public void setCustomDimension3(String customDimension3) { - this.customDimension3 = customDimension3; - } - - public String getCustomDimension4() { - return customDimension4; - } - - public void setCustomDimension4(String customDimension4) { - this.customDimension4 = customDimension4; - } - - public String getCustomDimension5() { - return customDimension5; - } - - public void setCustomDimension5(String customDimension5) { - this.customDimension5 = customDimension5; - } - - public String getCustomDimension6() { - return customDimension6; - } - - public void setCustomDimension6(String customDimension6) { - this.customDimension6 = customDimension6; - } - - public String getCustomDimension7() { - return customDimension7; - } - - public void setCustomDimension7(String customDimension7) { - this.customDimension7 = customDimension7; - } - - public String getCustomDimension8() { - return customDimension8; - } - - public void setCustomDimension8(String customDimension8) { - this.customDimension8 = customDimension8; - } - - public String getCustomDimension9() { - return customDimension9; - } - - public void setCustomDimension9(String customDimension9) { - this.customDimension9 = customDimension9; - } - - public String getCustomDimension10() { - return customDimension10; - } - - public void setCustomDimension10(String customDimension10) { - this.customDimension10 = customDimension10; - } - - public String getCustomDimension11() { - return customDimension11; - } - - public void setCustomDimension11(String customDimension11) { - this.customDimension11 = customDimension11; - } - - public String getCustomDimension12() { - return customDimension12; - } - - public void setCustomDimension12(String customDimension12) { - this.customDimension12 = customDimension12; - } - - public String getCustomDimension13() { - return customDimension13; - } - - public void setCustomDimension13(String customDimension13) { - this.customDimension13 = customDimension13; - } - - public String getCustomDimension14() { - return customDimension14; - } - - public void setCustomDimension14(String customDimension14) { - this.customDimension14 = customDimension14; - } - - public String getCustomDimension15() { - return customDimension15; - } - - public void setCustomDimension15(String customDimension15) { - this.customDimension15 = customDimension15; - } - - public String getCustomDimension16() { - return customDimension16; - } - - public void setCustomDimension16(String customDimension16) { - this.customDimension16 = customDimension16; - } - - public String getCustomDimension17() { - return customDimension17; - } - - public void setCustomDimension17(String customDimension17) { - this.customDimension17 = customDimension17; - } - - public String getCustomDimension18() { - return customDimension18; - } - - public void setCustomDimension18(String customDimension18) { - this.customDimension18 = customDimension18; - } - - public String getCustomDimension19() { - return customDimension19; - } - - public void setCustomDimension19(String customDimension19) { - this.customDimension19 = customDimension19; - } - - public String getCustomDimension20() { - return customDimension20; - } - - public void setCustomDimension20(String customDimension20) { - this.customDimension20 = customDimension20; - } -} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index 69500db..1ef9d0d 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -83,8 +83,8 @@ public class YouboraConfig { private Properties properties; - @SerializedName(value="customDimensions", alternate={"extraParams"}) - private CustomDimensions customDimensions; + @SerializedName(value="contentCustomDimensions", alternate={"extraParams"}) + private ContentCustomDimensions contentCustomDimensions; private ViewTransform.FastDataConfig fastDataConfig; @@ -288,12 +288,12 @@ public void setProperties(Properties properties) { this.properties = properties; } - public CustomDimensions getCustomDimensions() { - return customDimensions; + public ContentCustomDimensions getContentCustomDimensions() { + return contentCustomDimensions; } - public void setCustomDimensions(CustomDimensions customDimensions) { - this.customDimensions = customDimensions; + public void setContentCustomDimensions(ContentCustomDimensions contentCustomDimensions) { + this.contentCustomDimensions = contentCustomDimensions; } public ViewTransform.FastDataConfig getFastDataConfig() { @@ -586,27 +586,27 @@ public Options getYouboraOptions() { //youboraOptions.setAdExpectedPattern(getAdExpectedPatternBundle()); } - if (customDimensions != null) { - youboraOptions.setContentCustomDimension1(customDimensions.getCustomDimension1()); - youboraOptions.setContentCustomDimension2(customDimensions.getCustomDimension2()); - youboraOptions.setContentCustomDimension3(customDimensions.getCustomDimension3()); - youboraOptions.setContentCustomDimension4(customDimensions.getCustomDimension4()); - youboraOptions.setContentCustomDimension5(customDimensions.getCustomDimension5()); - youboraOptions.setContentCustomDimension6(customDimensions.getCustomDimension6()); - youboraOptions.setContentCustomDimension7(customDimensions.getCustomDimension7()); - youboraOptions.setContentCustomDimension8(customDimensions.getCustomDimension8()); - youboraOptions.setContentCustomDimension9(customDimensions.getCustomDimension9()); - youboraOptions.setContentCustomDimension10(customDimensions.getCustomDimension10()); - youboraOptions.setContentCustomDimension11(customDimensions.getCustomDimension11()); - youboraOptions.setContentCustomDimension12(customDimensions.getCustomDimension12()); - youboraOptions.setContentCustomDimension13(customDimensions.getCustomDimension13()); - youboraOptions.setContentCustomDimension14(customDimensions.getCustomDimension14()); - youboraOptions.setContentCustomDimension15(customDimensions.getCustomDimension15()); - youboraOptions.setContentCustomDimension16(customDimensions.getCustomDimension16()); - youboraOptions.setContentCustomDimension17(customDimensions.getCustomDimension17()); - youboraOptions.setContentCustomDimension18(customDimensions.getCustomDimension18()); - youboraOptions.setContentCustomDimension19(customDimensions.getCustomDimension19()); - youboraOptions.setContentCustomDimension20(customDimensions.getCustomDimension20()); + if (contentCustomDimensions != null) { + youboraOptions.setContentCustomDimension1(contentCustomDimensions.getContentCustomDimension1()); + youboraOptions.setContentCustomDimension2(contentCustomDimensions.getContentCustomDimension2()); + youboraOptions.setContentCustomDimension3(contentCustomDimensions.getContentCustomDimension3()); + youboraOptions.setContentCustomDimension4(contentCustomDimensions.getContentCustomDimension4()); + youboraOptions.setContentCustomDimension5(contentCustomDimensions.getContentCustomDimension5()); + youboraOptions.setContentCustomDimension6(contentCustomDimensions.getContentCustomDimension6()); + youboraOptions.setContentCustomDimension7(contentCustomDimensions.getContentCustomDimension7()); + youboraOptions.setContentCustomDimension8(contentCustomDimensions.getContentCustomDimension8()); + youboraOptions.setContentCustomDimension9(contentCustomDimensions.getContentCustomDimension9()); + youboraOptions.setContentCustomDimension10(contentCustomDimensions.getContentCustomDimension10()); + youboraOptions.setContentCustomDimension11(contentCustomDimensions.getContentCustomDimension11()); + youboraOptions.setContentCustomDimension12(contentCustomDimensions.getContentCustomDimension12()); + youboraOptions.setContentCustomDimension13(contentCustomDimensions.getContentCustomDimension13()); + youboraOptions.setContentCustomDimension14(contentCustomDimensions.getContentCustomDimension14()); + youboraOptions.setContentCustomDimension15(contentCustomDimensions.getContentCustomDimension15()); + youboraOptions.setContentCustomDimension16(contentCustomDimensions.getContentCustomDimension16()); + youboraOptions.setContentCustomDimension17(contentCustomDimensions.getContentCustomDimension17()); + youboraOptions.setContentCustomDimension18(contentCustomDimensions.getContentCustomDimension18()); + youboraOptions.setContentCustomDimension19(contentCustomDimensions.getContentCustomDimension19()); + youboraOptions.setContentCustomDimension20(contentCustomDimensions.getContentCustomDimension20()); } return youboraOptions; } @@ -817,8 +817,8 @@ public JsonObject toJson() { JsonObject network = YouboraConfigJsonBuilder.getNetworkJsonObject(getNetwork()); JsonObject errors = YouboraConfigJsonBuilder.getErrorsJsonObject(getErrors()); JsonObject adsEntry = YouboraConfigJsonBuilder.getAdsJsonObject(getAds()); - JsonObject propertiesEntry = YouboraConfigJsonBuilder.getPropertiesJsonObject(getProperties()); - JsonObject customDimentionsEntry = YouboraConfigJsonBuilder.getCustomDimentionsJsonObject(getCustomDimensions()); + JsonObject properties = YouboraConfigJsonBuilder.getPropertiesJsonObject(getProperties()); + JsonObject contentCustomDimentions = YouboraConfigJsonBuilder.getContnentCustomDimentionsJsonObject(getContentCustomDimensions()); return YouboraConfigJsonBuilder.getYouboraConfigJsonObject(rootLevelParams, app, parse, @@ -827,8 +827,8 @@ public JsonObject toJson() { network, errors, adsEntry, - propertiesEntry, - customDimentionsEntry); + properties, + contentCustomDimentions); } public void merge(YouboraConfig youboraConfigUiConf) { @@ -1117,72 +1117,72 @@ public void merge(YouboraConfig youboraConfigUiConf) { properties = youboraConfigUiConf.getProperties(); } - if (customDimensions != null) { - if (youboraConfigUiConf.getCustomDimensions() != null) { - CustomDimensions customDimensionsUiConf = youboraConfigUiConf.getCustomDimensions(); - if (TextUtils.isEmpty((customDimensions.getCustomDimension1()))) { - customDimensions.setCustomDimension1(customDimensionsUiConf.getCustomDimension1()); + if (contentCustomDimensions != null) { + if (youboraConfigUiConf.getContentCustomDimensions() != null) { + ContentCustomDimensions contentCustomDimensionsUiConf = youboraConfigUiConf.getContentCustomDimensions(); + if (TextUtils.isEmpty((contentCustomDimensions.getContentCustomDimension1()))) { + contentCustomDimensions.setContentCustomDimension1(contentCustomDimensionsUiConf.getContentCustomDimension1()); } - if (TextUtils.isEmpty((customDimensions.getCustomDimension2()))) { - customDimensions.setCustomDimension2(customDimensionsUiConf.getCustomDimension2()); + if (TextUtils.isEmpty((contentCustomDimensions.getContentCustomDimension2()))) { + contentCustomDimensions.setContentCustomDimension2(contentCustomDimensionsUiConf.getContentCustomDimension2()); } - if (TextUtils.isEmpty((customDimensions.getCustomDimension3()))) { - customDimensions.setCustomDimension3(customDimensionsUiConf.getCustomDimension3()); + if (TextUtils.isEmpty((contentCustomDimensions.getContentCustomDimension3()))) { + contentCustomDimensions.setContentCustomDimension3(contentCustomDimensionsUiConf.getContentCustomDimension3()); } - if (TextUtils.isEmpty((customDimensions.getCustomDimension4()))) { - customDimensions.setCustomDimension4(customDimensionsUiConf.getCustomDimension4()); + if (TextUtils.isEmpty((contentCustomDimensions.getContentCustomDimension4()))) { + contentCustomDimensions.setContentCustomDimension4(contentCustomDimensionsUiConf.getContentCustomDimension4()); } - if (TextUtils.isEmpty((customDimensions.getCustomDimension5()))) { - customDimensions.setCustomDimension5(customDimensionsUiConf.getCustomDimension5()); + if (TextUtils.isEmpty((contentCustomDimensions.getContentCustomDimension5()))) { + contentCustomDimensions.setContentCustomDimension5(contentCustomDimensionsUiConf.getContentCustomDimension5()); } - if (TextUtils.isEmpty((customDimensions.getCustomDimension6()))) { - customDimensions.setCustomDimension6(customDimensionsUiConf.getCustomDimension6()); + if (TextUtils.isEmpty((contentCustomDimensions.getContentCustomDimension6()))) { + contentCustomDimensions.setContentCustomDimension6(contentCustomDimensionsUiConf.getContentCustomDimension6()); } - if (TextUtils.isEmpty((customDimensions.getCustomDimension7()))) { - customDimensions.setCustomDimension7(customDimensionsUiConf.getCustomDimension7()); + if (TextUtils.isEmpty((contentCustomDimensions.getContentCustomDimension7()))) { + contentCustomDimensions.setContentCustomDimension7(contentCustomDimensionsUiConf.getContentCustomDimension7()); } - if (TextUtils.isEmpty((customDimensions.getCustomDimension8()))) { - customDimensions.setCustomDimension8(customDimensionsUiConf.getCustomDimension8()); + if (TextUtils.isEmpty((contentCustomDimensions.getContentCustomDimension8()))) { + contentCustomDimensions.setContentCustomDimension8(contentCustomDimensionsUiConf.getContentCustomDimension8()); } - if (TextUtils.isEmpty((customDimensions.getCustomDimension9()))) { - customDimensions.setCustomDimension9(customDimensionsUiConf.getCustomDimension9()); + if (TextUtils.isEmpty((contentCustomDimensions.getContentCustomDimension9()))) { + contentCustomDimensions.setContentCustomDimension9(contentCustomDimensionsUiConf.getContentCustomDimension9()); } - if (TextUtils.isEmpty((customDimensions.getCustomDimension10()))) { - customDimensions.setCustomDimension10(customDimensionsUiConf.getCustomDimension10()); + if (TextUtils.isEmpty((contentCustomDimensions.getContentCustomDimension10()))) { + contentCustomDimensions.setContentCustomDimension10(contentCustomDimensionsUiConf.getContentCustomDimension10()); } - if (TextUtils.isEmpty((customDimensions.getCustomDimension11()))) { - customDimensions.setCustomDimension11(customDimensionsUiConf.getCustomDimension11()); + if (TextUtils.isEmpty((contentCustomDimensions.getContentCustomDimension11()))) { + contentCustomDimensions.setContentCustomDimension11(contentCustomDimensionsUiConf.getContentCustomDimension11()); } - if (TextUtils.isEmpty((customDimensions.getCustomDimension12()))) { - customDimensions.setCustomDimension12(customDimensionsUiConf.getCustomDimension12()); + if (TextUtils.isEmpty((contentCustomDimensions.getContentCustomDimension12()))) { + contentCustomDimensions.setContentCustomDimension12(contentCustomDimensionsUiConf.getContentCustomDimension12()); } - if (TextUtils.isEmpty((customDimensions.getCustomDimension13()))) { - customDimensions.setCustomDimension13(customDimensionsUiConf.getCustomDimension13()); + if (TextUtils.isEmpty((contentCustomDimensions.getContentCustomDimension13()))) { + contentCustomDimensions.setContentCustomDimension13(contentCustomDimensionsUiConf.getContentCustomDimension13()); } - if (TextUtils.isEmpty((customDimensions.getCustomDimension14()))) { - customDimensions.setCustomDimension14(customDimensionsUiConf.getCustomDimension14()); + if (TextUtils.isEmpty((contentCustomDimensions.getContentCustomDimension14()))) { + contentCustomDimensions.setContentCustomDimension14(contentCustomDimensionsUiConf.getContentCustomDimension14()); } - if (TextUtils.isEmpty((customDimensions.getCustomDimension15()))) { - customDimensions.setCustomDimension15(customDimensionsUiConf.getCustomDimension15()); + if (TextUtils.isEmpty((contentCustomDimensions.getContentCustomDimension15()))) { + contentCustomDimensions.setContentCustomDimension15(contentCustomDimensionsUiConf.getContentCustomDimension15()); } - if (TextUtils.isEmpty((customDimensions.getCustomDimension16()))) { - customDimensions.setCustomDimension16(customDimensionsUiConf.getCustomDimension16()); + if (TextUtils.isEmpty((contentCustomDimensions.getContentCustomDimension16()))) { + contentCustomDimensions.setContentCustomDimension16(contentCustomDimensionsUiConf.getContentCustomDimension16()); } - if (TextUtils.isEmpty((customDimensions.getCustomDimension17()))) { - customDimensions.setCustomDimension17(customDimensionsUiConf.getCustomDimension17()); + if (TextUtils.isEmpty((contentCustomDimensions.getContentCustomDimension17()))) { + contentCustomDimensions.setContentCustomDimension17(contentCustomDimensionsUiConf.getContentCustomDimension17()); } - if (TextUtils.isEmpty((customDimensions.getCustomDimension18()))) { - customDimensions.setCustomDimension18(customDimensionsUiConf.getCustomDimension18()); + if (TextUtils.isEmpty((contentCustomDimensions.getContentCustomDimension18()))) { + contentCustomDimensions.setContentCustomDimension18(contentCustomDimensionsUiConf.getContentCustomDimension18()); } - if (TextUtils.isEmpty((customDimensions.getCustomDimension19()))) { - customDimensions.setCustomDimension19(customDimensionsUiConf.getCustomDimension19()); + if (TextUtils.isEmpty((contentCustomDimensions.getContentCustomDimension19()))) { + contentCustomDimensions.setContentCustomDimension19(contentCustomDimensionsUiConf.getContentCustomDimension19()); } - if (TextUtils.isEmpty((customDimensions.getCustomDimension20()))) { - customDimensions.setCustomDimension20(customDimensionsUiConf.getCustomDimension20()); + if (TextUtils.isEmpty((contentCustomDimensions.getContentCustomDimension20()))) { + contentCustomDimensions.setContentCustomDimension20(contentCustomDimensionsUiConf.getContentCustomDimension20()); } } } else { - customDimensions = youboraConfigUiConf.getCustomDimensions(); + contentCustomDimensions = youboraConfigUiConf.getContentCustomDimensions(); } } } diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java index 30969cd..1f3654c 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java @@ -23,7 +23,7 @@ static JsonObject getYouboraConfigJsonObject( Map rootLev JsonObject errors, JsonObject ads, JsonObject properties, - JsonObject customDimentions) { + JsonObject contentCustomDimentions) { JsonObject youboraConfig = new JsonObject(); for (Map.Entry entry :rootLevelParams.entrySet()) { if (!TextUtils.isEmpty(entry.getKey()) && entry.getValue() != null) { @@ -39,7 +39,7 @@ static JsonObject getYouboraConfigJsonObject( Map rootLev youboraConfig.add("errors", errors); youboraConfig.add("ads", ads); youboraConfig.add("properties", properties); - youboraConfig.add("customDimentions", customDimentions); + youboraConfig.add("contentCustomDimentions", contentCustomDimentions); return youboraConfig; } @@ -480,71 +480,71 @@ static JsonObject getPropertiesJsonObject(Properties prop) { } @NonNull - static JsonObject getCustomDimentionsJsonObject(CustomDimensions customDimensions) { + static JsonObject getContnentCustomDimentionsJsonObject(ContentCustomDimensions contentCustomDimensions) { JsonObject customDimensionsEntry = new JsonObject(); - if (customDimensions== null) { + if (contentCustomDimensions == null) { return customDimensionsEntry; } - if (customDimensions.getCustomDimension1() != null) { - customDimensionsEntry.addProperty("customDimension1", customDimensions.getCustomDimension1()); + if (contentCustomDimensions.getContentCustomDimension1() != null) { + customDimensionsEntry.addProperty("contentCustomDimension1", contentCustomDimensions.getContentCustomDimension1()); } - if (customDimensions.getCustomDimension2() != null) { - customDimensionsEntry.addProperty("customDimension2", customDimensions.getCustomDimension2()); + if (contentCustomDimensions.getContentCustomDimension2() != null) { + customDimensionsEntry.addProperty("contentCustomDimension2", contentCustomDimensions.getContentCustomDimension2()); } - if (customDimensions.getCustomDimension3() != null) { - customDimensionsEntry.addProperty("customDimension3", customDimensions.getCustomDimension3()); + if (contentCustomDimensions.getContentCustomDimension3() != null) { + customDimensionsEntry.addProperty("contentCustomDimension3", contentCustomDimensions.getContentCustomDimension3()); } - if (customDimensions.getCustomDimension4() != null) { - customDimensionsEntry.addProperty("customDimension4", customDimensions.getCustomDimension4()); + if (contentCustomDimensions.getContentCustomDimension4() != null) { + customDimensionsEntry.addProperty("contentCustomDimension4", contentCustomDimensions.getContentCustomDimension4()); } - if (customDimensions.getCustomDimension5() != null) { - customDimensionsEntry.addProperty("customDimension5", customDimensions.getCustomDimension5()); + if (contentCustomDimensions.getContentCustomDimension5() != null) { + customDimensionsEntry.addProperty("contentCustomDimension5", contentCustomDimensions.getContentCustomDimension5()); } - if (customDimensions.getCustomDimension6() != null) { - customDimensionsEntry.addProperty("customDimension6", customDimensions.getCustomDimension6()); + if (contentCustomDimensions.getContentCustomDimension6() != null) { + customDimensionsEntry.addProperty("contentCustomDimension6", contentCustomDimensions.getContentCustomDimension6()); } - if (customDimensions.getCustomDimension7() != null) { - customDimensionsEntry.addProperty("customDimension7", customDimensions.getCustomDimension7()); + if (contentCustomDimensions.getContentCustomDimension7() != null) { + customDimensionsEntry.addProperty("contentCustomDimension7", contentCustomDimensions.getContentCustomDimension7()); } - if (customDimensions.getCustomDimension8() != null) { - customDimensionsEntry.addProperty("customDimension8", customDimensions.getCustomDimension8()); + if (contentCustomDimensions.getContentCustomDimension8() != null) { + customDimensionsEntry.addProperty("contentCustomDimension8", contentCustomDimensions.getContentCustomDimension8()); } - if (customDimensions.getCustomDimension9() != null) { - customDimensionsEntry.addProperty("customDimension9", customDimensions.getCustomDimension9()); + if (contentCustomDimensions.getContentCustomDimension9() != null) { + customDimensionsEntry.addProperty("contentCustomDimension9", contentCustomDimensions.getContentCustomDimension9()); } - if (customDimensions.getCustomDimension10() != null) { - customDimensionsEntry.addProperty("customDimension10", customDimensions.getCustomDimension10()); + if (contentCustomDimensions.getContentCustomDimension10() != null) { + customDimensionsEntry.addProperty("contentCustomDimension10", contentCustomDimensions.getContentCustomDimension10()); } - if (customDimensions.getCustomDimension11() != null) { - customDimensionsEntry.addProperty("customDimension11", customDimensions.getCustomDimension11()); + if (contentCustomDimensions.getContentCustomDimension11() != null) { + customDimensionsEntry.addProperty("contentCustomDimension11", contentCustomDimensions.getContentCustomDimension11()); } - if (customDimensions.getCustomDimension12() != null) { - customDimensionsEntry.addProperty("customDimension12", customDimensions.getCustomDimension12()); + if (contentCustomDimensions.getContentCustomDimension12() != null) { + customDimensionsEntry.addProperty("contentCustomDimension12", contentCustomDimensions.getContentCustomDimension12()); } - if (customDimensions.getCustomDimension13() != null) { - customDimensionsEntry.addProperty("customDimension13", customDimensions.getCustomDimension13()); + if (contentCustomDimensions.getContentCustomDimension13() != null) { + customDimensionsEntry.addProperty("contentCustomDimension13", contentCustomDimensions.getContentCustomDimension13()); } - if (customDimensions.getCustomDimension14() != null) { - customDimensionsEntry.addProperty("customDimension14", customDimensions.getCustomDimension14()); + if (contentCustomDimensions.getContentCustomDimension14() != null) { + customDimensionsEntry.addProperty("contentCustomDimension14", contentCustomDimensions.getContentCustomDimension14()); } - if (customDimensions.getCustomDimension15() != null) { - customDimensionsEntry.addProperty("customDimension15", customDimensions.getCustomDimension15()); + if (contentCustomDimensions.getContentCustomDimension15() != null) { + customDimensionsEntry.addProperty("contentCustomDimension15", contentCustomDimensions.getContentCustomDimension15()); } - if (customDimensions.getCustomDimension16() != null) { - customDimensionsEntry.addProperty("customDimension16", customDimensions.getCustomDimension16()); + if (contentCustomDimensions.getContentCustomDimension16() != null) { + customDimensionsEntry.addProperty("contentCustomDimension16", contentCustomDimensions.getContentCustomDimension16()); } - if (customDimensions.getCustomDimension17() != null) { - customDimensionsEntry.addProperty("customDimension17", customDimensions.getCustomDimension17()); + if (contentCustomDimensions.getContentCustomDimension17() != null) { + customDimensionsEntry.addProperty("contentCustomDimension17", contentCustomDimensions.getContentCustomDimension17()); } - if (customDimensions.getCustomDimension18() != null) { - customDimensionsEntry.addProperty("customDimension18", customDimensions.getCustomDimension18()); + if (contentCustomDimensions.getContentCustomDimension18() != null) { + customDimensionsEntry.addProperty("contentCustomDimension18", contentCustomDimensions.getContentCustomDimension18()); } - if (customDimensions.getCustomDimension19() != null) { - customDimensionsEntry.addProperty("customDimension19", customDimensions.getCustomDimension19()); + if (contentCustomDimensions.getContentCustomDimension19() != null) { + customDimensionsEntry.addProperty("contentCustomDimension19", contentCustomDimensions.getContentCustomDimension19()); } - if (customDimensions.getCustomDimension20() != null) { - customDimensionsEntry.addProperty("customDimension20", customDimensions.getCustomDimension20()); + if (contentCustomDimensions.getContentCustomDimension20() != null) { + customDimensionsEntry.addProperty("contentCustomDimension20", contentCustomDimensions.getContentCustomDimension20()); } return customDimensionsEntry; } From 5f26c5dbf83dc86c468162be0fb5378eea98097e Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Mon, 10 May 2021 19:48:07 +0300 Subject: [PATCH 088/143] rename contentCustomDimentions to contentCustomDimensions (#67) --- .../playkit/plugins/youbora/pluginconfig/YouboraConfig.java | 4 ++-- .../youbora/pluginconfig/YouboraConfigJsonBuilder.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index 1ef9d0d..974881b 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -818,7 +818,7 @@ public JsonObject toJson() { JsonObject errors = YouboraConfigJsonBuilder.getErrorsJsonObject(getErrors()); JsonObject adsEntry = YouboraConfigJsonBuilder.getAdsJsonObject(getAds()); JsonObject properties = YouboraConfigJsonBuilder.getPropertiesJsonObject(getProperties()); - JsonObject contentCustomDimentions = YouboraConfigJsonBuilder.getContnentCustomDimentionsJsonObject(getContentCustomDimensions()); + JsonObject contentCustomDimensions = YouboraConfigJsonBuilder.getContnentCustomDimentionsJsonObject(getContentCustomDimensions()); return YouboraConfigJsonBuilder.getYouboraConfigJsonObject(rootLevelParams, app, parse, @@ -828,7 +828,7 @@ public JsonObject toJson() { errors, adsEntry, properties, - contentCustomDimentions); + contentCustomDimensions); } public void merge(YouboraConfig youboraConfigUiConf) { diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java index 1f3654c..0c7a1a7 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java @@ -23,7 +23,7 @@ static JsonObject getYouboraConfigJsonObject( Map rootLev JsonObject errors, JsonObject ads, JsonObject properties, - JsonObject contentCustomDimentions) { + JsonObject contentCustomDimensions) { JsonObject youboraConfig = new JsonObject(); for (Map.Entry entry :rootLevelParams.entrySet()) { if (!TextUtils.isEmpty(entry.getKey()) && entry.getValue() != null) { @@ -39,7 +39,7 @@ static JsonObject getYouboraConfigJsonObject( Map rootLev youboraConfig.add("errors", errors); youboraConfig.add("ads", ads); youboraConfig.add("properties", properties); - youboraConfig.add("contentCustomDimentions", contentCustomDimentions); + youboraConfig.add("contentCustomDimensions", contentCustomDimensions); return youboraConfig; } From 09948d2ea5e550de088f626663804900c3a70028 Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Tue, 8 Jun 2021 16:27:41 +0530 Subject: [PATCH 089/143] FEC-11237 Added check if the lib version is release version (#66) --- youboraplugin/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 34ec830..05c8784 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -46,6 +46,6 @@ repositories { maven { url "https://jitpack.io" } } -if (hasProperty('VERSION_NAME')) { +if (!ext.libVersion.contains('dev')) { apply from: './gradle-mvn-push.gradle' } From 57719dc632f7f0c2c2f014a9228f1b955acb0ff6 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Tue, 6 Jul 2021 16:27:05 +0300 Subject: [PATCH 090/143] upgrade youbora lib 6.7.40 (#69) --- youboraplugin/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 05c8784..92cd1ca 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -30,7 +30,7 @@ dependencies { implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' //implementation project(":playkit") - api 'com.nicepeopleatwork:youboralib:6.7.32' + api 'com.nicepeopleatwork:youboralib:6.7.40' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test:runner:1.3.0' From 25b460eb1944cdbf286c3bf66807eb44ffb179c5 Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Thu, 9 Sep 2021 13:50:35 +0530 Subject: [PATCH 091/143] FEC-11495 Added interceptor event from SmartSwitch (#70) --- .../playkit/plugins/youbora/YouboraPlugin.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index 9670e81..530af55 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -2,9 +2,11 @@ import android.content.Context; import android.os.Bundle; +import android.text.TextUtils; import com.google.gson.Gson; import com.google.gson.JsonObject; +import com.kaltura.playkit.InterceptorEvent; import com.kaltura.playkit.MessageBus; import com.kaltura.playkit.PKLog; import com.kaltura.playkit.PKMediaConfig; @@ -47,6 +49,7 @@ public class YouboraPlugin extends PKPlugin { private boolean isMonitoring = false; private boolean isAdsMonitoring = false; + private String interceptedCdnCode; public static final Factory factory = new Factory() { @Override @@ -119,6 +122,13 @@ private void loadPlugin() { messageBus.addListener(this, PlayerEvent.stopped, event -> { log.d("YouboraPlugin STOPPED"); }); + + messageBus.addListener(this, InterceptorEvent.cdnCode, event -> { + if (npawPlugin != null && npawPlugin.getOptions() != null) { + log.d("InterceptorEvent.cdnCode " + event.getCdnCode()); + interceptedCdnCode = event.getCdnCode(); + } + }); } @Override @@ -187,9 +197,15 @@ protected void onUpdateConfig(Object config) { this.pluginConfig = parseConfig(config); // Refresh options with updated media if (npawPlugin != null && pluginConfig != null) { + if (!TextUtils.isEmpty(interceptedCdnCode)) { + // If intercepted cdn code is there from smart switch then update it + this.pluginConfig.setContentCdn(interceptedCdnCode); + } npawPlugin.setOptions(pluginConfig); } + interceptedCdnCode = null; + if (pluginManager == null) { return; } From 8e0c7269de7faa946ba99b1d667df225e095a803 Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Mon, 13 Sep 2021 20:37:36 +0530 Subject: [PATCH 092/143] FEC-11495 Interceptor variable name refactor (#71) --- .../com/kaltura/playkit/plugins/youbora/YouboraPlugin.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index 530af55..e7bca6d 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -123,9 +123,9 @@ private void loadPlugin() { log.d("YouboraPlugin STOPPED"); }); - messageBus.addListener(this, InterceptorEvent.cdnCode, event -> { + messageBus.addListener(this, InterceptorEvent.cdnSwitched, event -> { if (npawPlugin != null && npawPlugin.getOptions() != null) { - log.d("InterceptorEvent.cdnCode " + event.getCdnCode()); + log.d("InterceptorEvent.cdnSwitched " + event.getCdnCode()); interceptedCdnCode = event.getCdnCode(); } }); From 90484f4e89ef32470eded718dfd28e70b022464b Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Mon, 4 Oct 2021 18:00:22 +0530 Subject: [PATCH 093/143] - Removed redundant imports (#72) --- .../kaltura/playkit/plugins/youbora/pluginconfig/Errors.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Errors.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Errors.java index d1f73e0..3bf59a9 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Errors.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Errors.java @@ -1,8 +1,5 @@ package com.kaltura.playkit.plugins.youbora.pluginconfig; -import java.util.ArrayList; -import java.util.List; - public class Errors { private String[] errorsIgnore; From bb1bf1fff5e46453150444ea3307587d71ff2dd7 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Fri, 22 Oct 2021 10:29:32 +0300 Subject: [PATCH 094/143] FEC-11642 - Rendition is not sent on youbora start event (#73) * replace fire start with init trigger start before join for both youbora adapters --- .../playkit/plugins/youbora/PKYouboraAdsAdapter.java | 6 ++++-- .../playkit/plugins/youbora/PKYouboraPlayerAdapter.java | 9 ++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java index 29247fb..252058a 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java @@ -197,6 +197,7 @@ private void addListeners() { return; } if (event.isAutoPlay) { + getPlugin().fireInit(); getPlugin().getAdapter().fireStart(); } sendReportEvent(event.eventType()); @@ -221,16 +222,16 @@ private void addListeners() { if (isFirstPlay) { isFirstPlay = false; if (PKAdPluginType.server.equals(getLastReportedAdPluginType())) { + getPlugin().fireInit(); getPlugin().getAdapter().fireStart(); getPlugin().getAdapter().fireJoin(); - fireStart(); } } currentAdInfo = event.adInfo; populateAdValues(); if (PKAdPluginType.server.equals(getLastReportedAdPluginType())) { + getPlugin().fireInit(); getPlugin().getAdapter().fireStart(); - fireStart(); } sendReportEvent(event.eventType()); }); @@ -244,6 +245,7 @@ private void addListeners() { lastReportedAdPlayhead = Long.valueOf(currentAdInfo.getAdPlayHead() / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); lastReportedAdBitrate = currentAdInfo.getMediaBitrate(); log.d("lastReportedAdPlayhead: " + lastReportedAdPlayhead); + fireStart(); fireJoin(); sendReportEvent(event.eventType()); }); diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index c0be994..c11e432 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -175,6 +175,7 @@ private void addListeners() { lastReportedBitrate = currentPlaybackInfo.getVideoBitrate(); lastReportedThroughput = currentPlaybackInfo.getVideoThroughput(); lastReportedRendition = generateRendition(lastReportedBitrate, (int) currentPlaybackInfo.getVideoWidth(), (int) currentPlaybackInfo.getVideoHeight()); + //log.d("lastReportedRendition = " + lastReportedRendition + " lastReportedBitrate = " + lastReportedBitrate); sendReportEvent(event); }); @@ -247,7 +248,7 @@ private void addListeners() { fireResume(); } else { isFirstPlay = false; - fireStart(); + getPlugin().fireInit(); } sendReportEvent(event); }); @@ -256,8 +257,10 @@ private void addListeners() { printReceivedPlayerEvent(event); if (isFirstPlay) { isFirstPlay = false; - fireStart(); + getPlugin().fireInit(); } + + fireStart(); fireJoin(); sendReportEvent(event); }); @@ -349,7 +352,7 @@ public Long getThroughput() { @Override public String getRendition() { - return lastReportedRendition; + return (lastReportedRendition != null) ? lastReportedRendition : super.getRendition(); } public String getKalturaPlayerVersion() { From 1c7942faed85d3d23b573d3258a1c1dc68f8969c Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Mon, 8 Nov 2021 09:00:52 +0200 Subject: [PATCH 095/143] if entry id is empty use media given id (#76) --- .../com/kaltura/playkit/plugins/youbora/YouboraPlugin.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index e7bca6d..08c27f1 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -181,7 +181,11 @@ private void addKalturaInfoProperty(PKMediaConfig mediaConfig) { mediaConfig.getMediaEntry().getMetadata() != null ) { Bundle kalturaInfoBundle = new Bundle(); - kalturaInfoBundle.putString("entryId", mediaConfig.getMediaEntry().getMetadata().get("entryId")); + String entryId = mediaConfig.getMediaEntry().getMetadata().get("entryId"); + if (TextUtils.isEmpty(entryId)) { + entryId = mediaConfig.getMediaEntry().getId(); + } + kalturaInfoBundle.putString("entryId", entryId); kalturaInfoBundle.putString("sessionId", player.getSessionId()); npawPlugin.getOptions().getContentMetadata().putBundle("kalturaInfo", kalturaInfoBundle); } From 1a3aa9cb4f2acc64f96c8e633e7f30980c4d62fb Mon Sep 17 00:00:00 2001 From: jesuslc91 Date: Mon, 8 Nov 2021 13:07:52 +0100 Subject: [PATCH 096/143] sessions documentation (#74) --- docs/YouboraSessions.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 docs/YouboraSessions.md diff --git a/docs/YouboraSessions.md b/docs/YouboraSessions.md new file mode 100644 index 0000000..7008d12 --- /dev/null +++ b/docs/YouboraSessions.md @@ -0,0 +1,16 @@ +# Youbora sessions integration + +## To integrate youbora sessions follow this documentation: +https://documentation.npaw.com/npaw-integration/docs/application-analytics-custom-events-data-collection +This means: create a plugin instance that can be accessed globally, and call fireEvent() and fireNav() to report what you want. + +## Mix session analytics and video analytics +After, to communicate youbora plugin for sessions and kaltura player: + +### Before instantiating the player: + +ViewTransform.FastDataConfig fastDataConfig = plugin.getFastDataConfig(); + +### When instantiating the player, and before starting any video view set the object obtained previously in youboraconfig object used in player's constructor: + +youboraConfig.setFastDataConfig(fastDataConfig) From 46b79548aec5cde245e0222dc9833a4a557a901d Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Tue, 9 Nov 2021 15:37:20 +0200 Subject: [PATCH 097/143] if entry id is empty use media given id (#77) From 25a12494677df792c8cf8692fc9fc0f0d552bd8a Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 10 Nov 2021 12:59:04 +0200 Subject: [PATCH 098/143] move remove listeners code to onUpdate media if needed (#75) --- .../playkit/plugins/youbora/YouboraPlugin.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index 08c27f1..8b7c056 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -133,6 +133,13 @@ private void loadPlugin() { @Override protected void onUpdateMedia(PKMediaConfig mediaConfig) { + if (pluginManager != null) { + pluginManager.onUpdateConfig(); + if (adsManager != null) { + adsManager.onUpdateConfig(); + } + } + stopMonitoring(); log.d("youbora - onUpdateMedia"); @@ -209,15 +216,6 @@ protected void onUpdateConfig(Object config) { } interceptedCdnCode = null; - - if (pluginManager == null) { - return; - } - pluginManager.onUpdateConfig(); - if (adsManager != null) { - adsManager.onUpdateConfig(); - } - } @Override From 5df0abbad5098fac21e9ee7ca21e506a70165837 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Thu, 25 Nov 2021 16:33:12 +0200 Subject: [PATCH 099/143] FEC-11715 - gradle v7 (#78) * gradle v7 * maven publish --- .travis.yml | 8 +-- build.gradle | 6 +-- gradle/wrapper/gradle-wrapper.properties | 2 +- youboraplugin/build.gradle | 8 +-- youboraplugin/gradle-mvn-push.gradle | 68 ++++++++++++------------ 5 files changed, 46 insertions(+), 46 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6c80043..ee39e8c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,12 +2,12 @@ language: android dist: trusty sudo: required jdk: - - oraclejdk8 + - oraclejdk11 android: components: - tools - - build-tools-27.0.3 - - android-28 + - build-tools-31.0.3 + - android-31 before_script: - curl https://kaltura.github.io/fe-tools/android/license.sh | sh script: @@ -19,6 +19,6 @@ notifications: recipients: - noam.tamim@kaltura.com - gilad.nadav@kaltura.com - - Anton.Afanasiev@kaltura.com + - gourav.saxena@kaltura.com on_success: always on_failure: always diff --git a/build.gradle b/build.gradle index db5c733..cb203ae 100644 --- a/build.gradle +++ b/build.gradle @@ -1,15 +1,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.4.32' + ext.kotlin_version = '1.5.20' repositories { - jcenter() google() mavenCentral() maven { url "https://jitpack.io" } } dependencies { - classpath 'com.android.tools.build:gradle:3.6.2' + classpath 'com.android.tools.build:gradle:7.0.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } @@ -17,7 +16,6 @@ buildscript { allprojects { repositories { google() - jcenter() mavenCentral() maven { url "https://jitpack.io" } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 79027c5..0ee0265 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 92cd1ca..beaa02f 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' apply from: 'version.gradle' android { - compileSdkVersion 30 + compileSdkVersion 31 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 @@ -11,8 +11,8 @@ android { minSdkVersion 16 targetSdkVersion 30 versionName libVersion - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + buildConfigField("String","VERSION_NAME","\"${libVersion}\"") } buildTypes { @@ -33,8 +33,8 @@ dependencies { api 'com.nicepeopleatwork:youboralib:6.7.40' testImplementation 'junit:junit:4.13.2' - androidTestImplementation 'androidx.test:runner:1.3.0' - implementation 'androidx.annotation:annotation:1.2.0' + androidTestImplementation 'androidx.test:runner:1.4.0' + implementation 'androidx.annotation:annotation:1.3.0' } diff --git a/youboraplugin/gradle-mvn-push.gradle b/youboraplugin/gradle-mvn-push.gradle index 31d090a..7ec7819 100644 --- a/youboraplugin/gradle-mvn-push.gradle +++ b/youboraplugin/gradle-mvn-push.gradle @@ -1,4 +1,4 @@ -apply plugin: 'maven' +apply plugin: 'maven-publish' apply plugin: 'signing' def isReleaseBuild() { @@ -24,49 +24,51 @@ def getRepositoryPassword() { } afterEvaluate { project -> - uploadArchives { - repositories { - mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + publishing { + publications { + mavenJava(MavenPublication) { - pom.groupId = GROUP - pom.artifactId = POM_ARTIFACT_ID - VERSION_NAME = libVersion - pom.version = VERSION_NAME - - repository(url: getReleaseRepositoryUrl()) { - authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) - } - snapshotRepository(url: getSnapshotRepositoryUrl()) { - authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) - } - - pom.project { - name POM_NAME - packaging POM_PACKAGING - description POM_DESCRIPTION - url POM_URL + groupId = GROUP + artifactId = POM_ARTIFACT_ID - scm { - url POM_SCM_URL - connection POM_SCM_CONNECTION - developerConnection POM_SCM_DEV_CONNECTION + VERSION_NAME = libVersion + version = VERSION_NAME + + repositories { + maven { + def releasesRepoUrl = getReleaseRepositoryUrl() + def snapshotsRepoUrl = getSnapshotRepositoryUrl() + url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl + credentials { + username getRepositoryUsername() + password getRepositoryPassword() + } } + } + pom { + name = POM_NAME + packaging = POM_PACKAGING + description = POM_DESCRIPTION + url = POM_URL licenses { license { - name POM_LICENCE_NAME - url POM_LICENCE_URL - distribution POM_LICENCE_DIST + name = POM_LICENCE_NAME + url = POM_LICENCE_URL + distribution = POM_LICENCE_DIST } } - developers { developer { - id POM_DEVELOPER_ID - name POM_DEVELOPER_NAME + id = POM_DEVELOPER_ID + name = POM_DEVELOPER_NAME } } + scm { + url = POM_SCM_URL + connection = POM_SCM_CONNECTION + developerConnection = POM_SCM_DEV_CONNECTION + } } } } @@ -104,6 +106,6 @@ afterEvaluate { project -> artifacts { archives androidSourcesJar - archives androidJavadocsJar + //archives androidJavadocsJar } } From b5ef0061f570be0fdf35bb63720a934564448b41 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 1 Dec 2021 21:49:07 +0200 Subject: [PATCH 100/143] FEC-11727 - upgrade 6.7.53 (#79) * upgrade api 'com.nicepeopleatwork:youboralib:6.7.53' * add support in deviceEDID --- youboraplugin/build.gradle | 2 +- .../playkit/plugins/youbora/pluginconfig/Device.java | 10 ++++++++++ .../plugins/youbora/pluginconfig/YouboraConfig.java | 4 ++++ .../youbora/pluginconfig/YouboraConfigJsonBuilder.java | 4 ++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index beaa02f..ba6fcf8 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -30,7 +30,7 @@ dependencies { implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' //implementation project(":playkit") - api 'com.nicepeopleatwork:youboralib:6.7.40' + api 'com.nicepeopleatwork:youboralib:6.7.53' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test:runner:1.4.0' diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.java index 5b9e86e..9aa1471 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.java @@ -24,6 +24,8 @@ public class Device { private String deviceCode; @SerializedName(value="deviceId", alternate={"id"}) private String deviceId; + @SerializedName(value="deviceEdId", alternate={"edid"}) + private String deviceEdId; @SerializedName(value="deviceModel", alternate={"model"}) private String deviceModel; @SerializedName(value="deviceOsName", alternate={"osName"}) @@ -58,6 +60,14 @@ public void setDeviceId(String deviceId) { this.deviceId = deviceId; } + public String getDeviceEdId() { + return deviceEdId; + } + + public void setDeviceEdId(String deviceEdId) { + this.deviceEdId = deviceEdId; + } + public String getDeviceModel() { return deviceModel; } diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index 974881b..9e07082 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -368,6 +368,10 @@ public Options getYouboraOptions() { youboraOptions.setDeviceId(device.getDeviceId()); } + if (device.getDeviceEdId() != null) { + youboraOptions.setDeviceEDID(device.getDeviceEdId()); + } + if (device.getDeviceBrand() != null) { youboraOptions.setDeviceBrand(device.getDeviceBrand()); } diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java index 0c7a1a7..174269c 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java @@ -118,6 +118,10 @@ static JsonObject getDeviceJsonObject(Device device) { deviceJsonObject.addProperty("deviceId", device.getDeviceId()); } + if (device.getDeviceEdId() != null) { + deviceJsonObject.addProperty("deviceEdId", device.getDeviceEdId()); + } + if (device.getDeviceBrand() != null) { deviceJsonObject.addProperty("deviceBrand", device.getDeviceBrand()); } From 4f399689f128d40d12afaf55662b702248ca270f Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 22 Dec 2021 09:47:16 +0200 Subject: [PATCH 101/143] add NPE protection (#80) --- .../youbora/PKYouboraPlayerAdapter.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index c11e432..24d7afa 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -169,6 +169,11 @@ public void registerListeners() { } private void addListeners() { + if (messageBus == null) { + log.e("youbora plugin addListeners ignored, messageBus == null"); + return; + } + messageBus.addListener(this, PlayerEvent.playbackInfoUpdated, event -> { printReceivedPlayerEvent(event); PlaybackInfo currentPlaybackInfo = event.playbackInfo; @@ -248,7 +253,10 @@ private void addListeners() { fireResume(); } else { isFirstPlay = false; - getPlugin().fireInit(); + if (getPlugin() != null) { + log.d("play event fireInit"); + getPlugin().fireInit(); + } } sendReportEvent(event); }); @@ -257,7 +265,10 @@ private void addListeners() { printReceivedPlayerEvent(event); if (isFirstPlay) { isFirstPlay = false; - getPlugin().fireInit(); + if (getPlugin() != null) { + log.d("playing event fireInit"); + getPlugin().fireInit(); + } } fireStart(); @@ -431,7 +442,9 @@ public Boolean getIsLive() { private void sendReportEvent(PKEvent event) { if (event.eventType() != PLAYHEAD_UPDATED) { String reportedEventName = event.eventType().name(); - messageBus.post(new YouboraEvent.YouboraReport(reportedEventName)); + if (messageBus != null) { + messageBus.post(new YouboraEvent.YouboraReport(reportedEventName)); + } } } From b43fa9e2ac1919efbb712e74561cbc75c1a081d4 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 22 Dec 2021 14:39:17 +0200 Subject: [PATCH 102/143] FEC-11783 - report drm scheme to youbora if not provided by app (#81) * if App did not set drm scheme we will use player knowledge regarding drm scheme rename to sourceSelectedEvent --- .../plugins/youbora/YouboraPlugin.java | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index 8b7c056..4c8c6ac 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -8,6 +8,7 @@ import com.google.gson.JsonObject; import com.kaltura.playkit.InterceptorEvent; import com.kaltura.playkit.MessageBus; +import com.kaltura.playkit.PKDrmParams; import com.kaltura.playkit.PKLog; import com.kaltura.playkit.PKMediaConfig; import com.kaltura.playkit.PKPlugin; @@ -88,11 +89,12 @@ protected void onLoad(final Player player, Object config, final MessageBus messa private void loadPlugin() { messageBus.addListener(this, PlayerEvent.sourceSelected, event -> { - PlayerEvent.SourceSelected sourceSelected = event; - if (sourceSelected != null && sourceSelected.source != null) { - log.d("YouboraPlugin SOURCE_SELECTED = " + sourceSelected.source.getUrl()); + PlayerEvent.SourceSelected sourceSelectedEvent = event; + if (sourceSelectedEvent != null && sourceSelectedEvent.source != null) { + log.d("YouboraPlugin SOURCE_SELECTED = " + sourceSelectedEvent.source.getUrl()); if (pluginManager != null) { - pluginManager.setLastReportedResource(sourceSelected.source.getUrl()); + pluginManager.setLastReportedResource(sourceSelectedEvent.source.getUrl()); + updateContentDRMScheme(sourceSelectedEvent); } } }); @@ -131,6 +133,28 @@ private void loadPlugin() { }); } + private void updateContentDRMScheme(PlayerEvent.SourceSelected sourceSelectedEvent) { + + String drmSchema = PKDrmParams.Scheme.Unknown.name(); + if (sourceSelectedEvent != null && sourceSelectedEvent.source != null && sourceSelectedEvent.source.hasDrmParams()) { + List drmParams = sourceSelectedEvent.source.getDrmData(); + if (drmParams != null) { + for (PKDrmParams params : drmParams) { + if (params.isSchemeSupported()) { + drmSchema = params.getScheme().name(); + break; + } + } + } + } else { + drmSchema = "Clear"; + } + if (npawPlugin != null && npawPlugin.getOptions() != null && npawPlugin.getOptions().getContentDrm() == null) { + log.d("YouboraPlugin ContentDrm = " + drmSchema); + npawPlugin.getOptions().setContentDrm(drmSchema); + } + } + @Override protected void onUpdateMedia(PKMediaConfig mediaConfig) { if (pluginManager != null) { From a46b6f59020e0b06236e2e48822e75714c976a78 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Tue, 28 Dec 2021 08:23:42 +0200 Subject: [PATCH 103/143] FEC-11805 - implement missing override getPlayrate method (#83) * implement missing override getPlayrate method --- .../plugins/youbora/PKYouboraPlayerAdapter.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index 24d7afa..03b146f 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -415,10 +415,13 @@ public Integer getDroppedFrames() { return droppedFrames.intValue(); } - // public Double getPlayrate() { -// return lastPlayrate -// } - + @Override + public double getPlayrate() { + double currentPlaybackRate = (getPlayer() != null) ? getPlayer().getPlaybackRate() : 1.0; + log.d("getPlayrate currentPlaybackRate = " + currentPlaybackRate); + return currentPlaybackRate; + } + @Override public String getTitle() { if (mediaConfig == null || mediaConfig.getMediaEntry() == null) { From d90d325c603df7b1bbd6bee71abfeba8089f4497 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 29 Dec 2021 17:34:18 +0200 Subject: [PATCH 104/143] do not reset mediaConfig (#82) it will be updated once change media is done --- .../playkit/plugins/youbora/PKYouboraPlayerAdapter.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index 03b146f..68d6712 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -421,7 +421,7 @@ public double getPlayrate() { log.d("getPlayrate currentPlaybackRate = " + currentPlaybackRate); return currentPlaybackRate; } - + @Override public String getTitle() { if (mediaConfig == null || mediaConfig.getMediaEntry() == null) { @@ -495,8 +495,6 @@ public void resetValues() { lastReportedRendition = super.getRendition(); lastReportedThroughput = super.getThroughput(); lastReportedAdPluginType = null; - mediaConfig = null; - houseHoldId = null; isFirstPlay = true; isFatalErrorSent = false; } From c885ec4a1fbae80ab8253a47c75922e1babde53d Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 29 Dec 2021 20:59:03 +0200 Subject: [PATCH 105/143] FEC-11805 - assign player to youbora after stop monitoring (#84) --- .../kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java | 3 +-- .../playkit/plugins/youbora/PKYouboraPlayerAdapter.java | 2 +- .../com/kaltura/playkit/plugins/youbora/YouboraPlugin.java | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java index 252058a..295d197 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java @@ -398,9 +398,8 @@ private void addListeners() { private PKAdPluginType getLastReportedAdPluginType() { if (lastReportedAdPluginType != null) { - return lastReportedAdPluginType; + return lastReportedAdPluginType; } - if (getPlayer() != null) { AdController adController = getPlayer().getController(AdController.class); if (adController != null && !adController.isAdError()) { diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index 68d6712..7bcb2d4 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -418,7 +418,7 @@ public Integer getDroppedFrames() { @Override public double getPlayrate() { double currentPlaybackRate = (getPlayer() != null) ? getPlayer().getPlaybackRate() : 1.0; - log.d("getPlayrate currentPlaybackRate = " + currentPlaybackRate); + log.d("getPlayrate currentPlaybackRate = " + currentPlaybackRate + " isNullPlayer = " + (getPlayer() == null)); return currentPlaybackRate; } diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index 4c8c6ac..976c8f8 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -174,6 +174,7 @@ protected void onUpdateMedia(PKMediaConfig mediaConfig) { if (pluginManager == null) { pluginManager = new PKYouboraPlayerAdapter(player, messageBus, mediaConfig, houseHoldId); } else { + pluginManager.setPlayer(player); pluginManager.resetPlaybackValues(); pluginManager.registerListeners(); } @@ -189,6 +190,7 @@ protected void onUpdateMedia(PKMediaConfig mediaConfig) { if (adsManager == null) { adsManager = new PKYouboraAdsAdapter(player, messageBus); } else { + adsManager.setPlayer(player); adsManager.resetAdValues(); adsManager.registerListeners(); } From dc43de17f31d3541cb2b78f0eb9fc5d37aec0d41 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Thu, 30 Dec 2021 11:27:39 +0200 Subject: [PATCH 106/143] mavenCentral --- youboraplugin/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index ba6fcf8..628e6f9 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -40,7 +40,6 @@ dependencies { repositories { google() - jcenter() mavenCentral() maven { url "https://npaw.jfrog.io/artifactory/youbora/" } maven { url "https://jitpack.io" } From 6f6e255b51a7fc8a51d7d36750e05824784ad66f Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Mon, 3 Jan 2022 23:58:33 +0200 Subject: [PATCH 107/143] FEC-11715_2 openjdk11 (#85) * openjdk11 * fix jitpack --- jitpack.yml | 2 +- youboraplugin/build.gradle | 2 ++ youboraplugin/gradle-mvn-local.gradle | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 youboraplugin/gradle-mvn-local.gradle diff --git a/jitpack.yml b/jitpack.yml index 24e44f0..dd7fa11 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -1,4 +1,4 @@ jdk: - - oraclejdk8 + - openjdk11 before_install: - curl https://kaltura.github.io/fe-tools/android/license.sh | sh diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 628e6f9..ffe7479 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -47,4 +47,6 @@ repositories { if (!ext.libVersion.contains('dev')) { apply from: './gradle-mvn-push.gradle' +} else { + apply from: './gradle-mvn-local.gradle' } diff --git a/youboraplugin/gradle-mvn-local.gradle b/youboraplugin/gradle-mvn-local.gradle new file mode 100644 index 0000000..6d0d890 --- /dev/null +++ b/youboraplugin/gradle-mvn-local.gradle @@ -0,0 +1,19 @@ +apply plugin: 'maven-publish' + +task androidSourcesJar(type: Jar) { + classifier 'sources' + from android.sourceSets.main.java.sourceFiles +} + +project.afterEvaluate { + publishing { + publications { + mavenJava(MavenPublication) { + from components.release + } + } + repositories { + mavenLocal() + } + } +} From 0522984f7c0322d07761a85997b47f05d6b29a89 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Tue, 4 Jan 2022 19:48:06 +0200 Subject: [PATCH 108/143] fix maven publish (#86) --- youboraplugin/gradle-mvn-push.gradle | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/youboraplugin/gradle-mvn-push.gradle b/youboraplugin/gradle-mvn-push.gradle index 7ec7819..ac8d5f4 100644 --- a/youboraplugin/gradle-mvn-push.gradle +++ b/youboraplugin/gradle-mvn-push.gradle @@ -27,7 +27,7 @@ afterEvaluate { project -> publishing { publications { mavenJava(MavenPublication) { - + from components.release groupId = GROUP artifactId = POM_ARTIFACT_ID @@ -79,8 +79,8 @@ afterEvaluate { project -> allprojects { ext."signing.password" = System.getenv("MAVEN_PASSWORD") } allprojects { ext."signing.secretKeyRingFile" = System.getenv("MAVEN_SECRING_PATH") } - required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") } - sign configurations.archives + required { isReleaseBuild() && gradle.taskGraph.hasTask("publish") } + sign publishing.publications.mavenJava } task androidJavadocs(type: Javadoc) { From cc294cd112f3c1b9fd3bfec11028462d70fca8da Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Sun, 30 Jan 2022 10:20:32 +0200 Subject: [PATCH 109/143] FEC-11847 add audio/video codes report to youbora + streaming protocol (#87) * report youbora regarding usage audio codes and video codecs * report correct drm system in youbora * get the streaming protocol from PKMediaFormat --- .idea/runConfigurations.xml | 12 ---- .../youbora/PKYouboraPlayerAdapter.java | 57 ++++++++++++++++++- .../plugins/youbora/YouboraPlugin.java | 12 +++- 3 files changed, 67 insertions(+), 14 deletions(-) delete mode 100644 .idea/runConfigurations.xml diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 7f68460..0000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index 7bcb2d4..5a922c3 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -16,6 +16,7 @@ import com.kaltura.playkit.BuildConfig; import com.kaltura.playkit.MessageBus; +import com.kaltura.playkit.PKAudioCodec; import com.kaltura.playkit.PKError; import com.kaltura.playkit.PKEvent; import com.kaltura.playkit.PKLog; @@ -27,14 +28,19 @@ import com.kaltura.playkit.PlayerEvent; import com.kaltura.playkit.ads.AdController; import com.kaltura.playkit.ads.PKAdPluginType; +import com.kaltura.playkit.player.AudioTrack; import com.kaltura.playkit.player.PKPlayerErrorType; +import com.kaltura.playkit.player.VideoTrack; import com.kaltura.playkit.plugins.ads.AdCuePoints; import com.kaltura.playkit.plugins.ads.AdEvent; import com.kaltura.playkit.utils.Consts; import com.npaw.youbora.lib6.YouboraUtil; import com.npaw.youbora.lib6.adapter.PlayerAdapter; +import java.util.Collections; import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; import static com.kaltura.playkit.PlayerEvent.Type.PLAYHEAD_UPDATED; @@ -61,6 +67,8 @@ class PKYouboraPlayerAdapter extends PlayerAdapter { private Double lastReportedMediaPosition; private Double lastReportedMediaDuration; private PKAdPluginType lastReportedAdPluginType; + private String lastReportedVideoCodecs; + private String lastReportedAudioCodecs; private Long droppedFrames = 0L; private String houseHoldId; private boolean isAdPlaying; @@ -228,6 +236,19 @@ private void addListeners() { sendReportEvent(event); }); + messageBus.addListener(this, PlayerEvent.tracksAvailable, event -> { + lastReportedVideoCodecs = getVideoCodecs(event.tracksInfo.getVideoTracks()); + lastReportedAudioCodecs = getAudioCodecs(event.tracksInfo.getAudioTracks()); + }); + + messageBus.addListener(this, PlayerEvent.audioTrackChanged, event -> { + lastReportedAudioCodecs = getAudioCodecs(Collections.singletonList(event.newTrack)); + }); + + messageBus.addListener(this, PlayerEvent.videoTrackChanged, event -> { + lastReportedVideoCodecs = getVideoCodecs(Collections.singletonList(event.newTrack)); + }); + messageBus.addListener(this, PlayerEvent.error, event -> { printReceivedPlayerEvent(event); PKError error = event.error; @@ -334,6 +355,29 @@ private void addListeners() { }); } + private String getVideoCodecs(List tracks) { + Set codecs = new LinkedHashSet<>(); + for (VideoTrack track : tracks) { + if (track.getCodecType() != null) { + codecs.add(track.getCodecName()); + } + } + return codecs.toString(); + } + + private String getAudioCodecs(List tracks) { + Set codecs = new LinkedHashSet<>(); + for (AudioTrack track : tracks) { + if (track.getCodecType() != null) { + codecs.add(track.getCodecName()); + } + } + if (codecs.size() == 0) { + codecs.add(PKAudioCodec.AAC.name()); + } + return codecs.toString(); + } + private void printReceivedPlayerEvent(PKEvent event) { log.d("Player Event = " + event.eventType().name()); } @@ -376,6 +420,16 @@ public String getVersion() { return com.npaw.youbora.lib6.BuildConfig.VERSION_NAME + "-" + BuildConfig.VERSION_NAME + "-" + getPlayerVersion(); } + @Override + public String getVideoCodec() { + return (lastReportedVideoCodecs != null) ? lastReportedVideoCodecs : super.getVideoCodec(); + } + + @Override + public String getAudioCodec() { + return (lastReportedAudioCodecs != null) ? lastReportedAudioCodecs : super.getAudioCodec(); + } + @Override public String getPlayerVersion() { return Consts.KALTURA + "-" + PlayKitManager.CLIENT_TAG; @@ -494,6 +548,8 @@ public void resetValues() { lastReportedBitrate = super.getBitrate(); lastReportedRendition = super.getRendition(); lastReportedThroughput = super.getThroughput(); + lastReportedAudioCodecs = super.getAudioCodec(); + lastReportedVideoCodecs = super.getVideoCodec(); lastReportedAdPluginType = null; isFirstPlay = true; isFatalErrorSent = false; @@ -511,7 +567,6 @@ public void resetPlaybackValues() { public void setMediaConfig(PKMediaConfig mediaConfig) { this.mediaConfig = mediaConfig; updateDurationFromMediaConfig(mediaConfig); - } public void setHouseHoldId(String houseHoldId) { diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index 976c8f8..89007a0 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -16,6 +16,7 @@ import com.kaltura.playkit.PlayerEvent; import com.kaltura.playkit.player.AudioTrack; import com.kaltura.playkit.player.PKTracks; +import com.kaltura.playkit.player.PlayerSettings; import com.kaltura.playkit.player.TextTrack; import com.kaltura.playkit.plugin.youbora.BuildConfig; import com.kaltura.playkit.plugins.youbora.pluginconfig.YouboraAdAdapterConfig; @@ -95,6 +96,7 @@ private void loadPlugin() { if (pluginManager != null) { pluginManager.setLastReportedResource(sourceSelectedEvent.source.getUrl()); updateContentDRMScheme(sourceSelectedEvent); + updateStreamingProtocol(sourceSelectedEvent); } } }); @@ -133,6 +135,14 @@ private void loadPlugin() { }); } + private void updateStreamingProtocol(PlayerEvent.SourceSelected sourceSelectedEvent) { + if (sourceSelectedEvent != null && sourceSelectedEvent.source != null && sourceSelectedEvent.source.getMediaFormat() != null) { + if (npawPlugin.getOptions().getContentStreamingProtocol() == null) { + npawPlugin.getOptions().setContentStreamingProtocol(sourceSelectedEvent.source.getMediaFormat().name().toUpperCase()); + } + } + } + private void updateContentDRMScheme(PlayerEvent.SourceSelected sourceSelectedEvent) { String drmSchema = PKDrmParams.Scheme.Unknown.name(); @@ -140,7 +150,7 @@ private void updateContentDRMScheme(PlayerEvent.SourceSelected sourceSelectedEve List drmParams = sourceSelectedEvent.source.getDrmData(); if (drmParams != null) { for (PKDrmParams params : drmParams) { - if (params.isSchemeSupported()) { + if (params.isSchemeSupported() && player != null && player.getSettings() != null && ((PlayerSettings) player.getSettings()).getDRMSettings().getDrmScheme() == params.getScheme()) { drmSchema = params.getScheme().name(); break; } From 9f99d971d602237e68669d619be25ad7909ae276 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Mon, 31 Jan 2022 14:44:03 +0200 Subject: [PATCH 110/143] fix null Video codec report (#88) --- .../playkit/plugins/youbora/PKYouboraPlayerAdapter.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index 5a922c3..06d11d0 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -22,6 +22,7 @@ import com.kaltura.playkit.PKLog; import com.kaltura.playkit.PKMediaConfig; import com.kaltura.playkit.PKMediaEntry; +import com.kaltura.playkit.PKVideoCodec; import com.kaltura.playkit.PlayKitManager; import com.kaltura.playkit.PlaybackInfo; import com.kaltura.playkit.Player; @@ -358,17 +359,20 @@ private void addListeners() { private String getVideoCodecs(List tracks) { Set codecs = new LinkedHashSet<>(); for (VideoTrack track : tracks) { - if (track.getCodecType() != null) { + if (track.getCodecType() != null && !TextUtils.isEmpty(track.getCodecName())) { codecs.add(track.getCodecName()); } } + if (codecs.size() == 0) { + codecs.add(PKVideoCodec.AVC.name()); + } return codecs.toString(); } private String getAudioCodecs(List tracks) { Set codecs = new LinkedHashSet<>(); for (AudioTrack track : tracks) { - if (track.getCodecType() != null) { + if (track.getCodecType() != null && !TextUtils.isEmpty(track.getCodecName())) { codecs.add(track.getCodecName()); } } From 91602c122372942fab0a7a969b1fc89022b16663 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Tue, 15 Feb 2022 08:48:33 +0200 Subject: [PATCH 111/143] FEC-11963 - if player is paused playbackrate should be reported 0 to youbora (#89) * if player is paused playbackrate should be reported 0 to youbora * simplify logic * - Extra space removed Co-authored-by: Gourav Saxena --- .../playkit/plugins/youbora/PKYouboraPlayerAdapter.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index 06d11d0..5009545 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -475,7 +475,10 @@ public Integer getDroppedFrames() { @Override public double getPlayrate() { - double currentPlaybackRate = (getPlayer() != null) ? getPlayer().getPlaybackRate() : 1.0; + double currentPlaybackRate = 0; + if (getPlayer() != null && getPlayer().isPlaying()) { + currentPlaybackRate = getPlayer().getPlaybackRate(); + } log.d("getPlayrate currentPlaybackRate = " + currentPlaybackRate + " isNullPlayer = " + (getPlayer() == null)); return currentPlaybackRate; } From 280f880c91c1725fb768e5f740c754a405133c02 Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Thu, 17 Feb 2022 23:05:21 +0530 Subject: [PATCH 112/143] - Removed addition start event firing (#91) --- .../com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java | 1 - 1 file changed, 1 deletion(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java index 295d197..486b8c8 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java @@ -370,7 +370,6 @@ private void addListeners() { } getPlugin().getAdapter().fireStart(); - fireStart(); printLastReportedAdPlayhead(); fireBufferBegin(); sendReportEvent(event.eventType()); From 1a9f42f20f3ac61cdb1019b19b9fbd4a8d66a07b Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Thu, 17 Feb 2022 23:16:40 +0530 Subject: [PATCH 113/143] - Update `lastReportedAdPlayhead` value in AdProgress event (#90) --- .../plugins/youbora/PKYouboraAdsAdapter.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java index 486b8c8..c845f1d 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java @@ -164,7 +164,7 @@ private void populateAdValues() { log.d("lastReportedAdResource: " + lastReportedAdResource); log.d("lastReportedAdDuration: " + lastReportedAdDuration); log.d("lastReportedAdTitle: " + lastReportedAdTitle); - log.d("lastReportedAdPlayhead: " + lastReportedAdPlayhead); + printLastReportedAdPlayhead(); log.d("lastReportedAdBitrate: " + lastReportedAdBitrate); } @@ -244,7 +244,7 @@ private void addListeners() { currentAdInfo = event.adInfo; lastReportedAdPlayhead = Long.valueOf(currentAdInfo.getAdPlayHead() / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); lastReportedAdBitrate = currentAdInfo.getMediaBitrate(); - log.d("lastReportedAdPlayhead: " + lastReportedAdPlayhead); + printLastReportedAdPlayhead(); fireStart(); fireJoin(); sendReportEvent(event.eventType()); @@ -259,7 +259,7 @@ private void addListeners() { currentAdInfo = event.adInfo; lastReportedAdPlayhead = Long.valueOf(currentAdInfo.getAdPlayHead() / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); lastReportedAdBitrate = currentAdInfo.getMediaBitrate(); - log.d("lastReportedAdPlayhead: " + lastReportedAdPlayhead); + printLastReportedAdPlayhead(); firePause(); sendReportEvent(event.eventType()); }); @@ -272,7 +272,7 @@ private void addListeners() { currentAdInfo = event.adInfo; lastReportedAdPlayhead = Long.valueOf(currentAdInfo.getAdPlayHead() / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); lastReportedAdBitrate = currentAdInfo.getMediaBitrate(); - log.d("lastReportedAdPlayhead: " + lastReportedAdPlayhead); + printLastReportedAdPlayhead(); fireResume(); sendReportEvent(event.eventType()); }); @@ -283,7 +283,7 @@ private void addListeners() { return; } lastReportedAdPlayhead = lastReportedAdDuration; - log.d("lastReportedAdPlayhead: " + lastReportedAdPlayhead); + printLastReportedAdPlayhead(); fireStop(); sendReportEvent(event.eventType()); }); @@ -353,12 +353,13 @@ private void addListeners() { }); messageBus.addListener(this, AdEvent.playHeadChanged, event -> { - lastReportedAdPlayhead = Long.valueOf(event.adPlayHead).doubleValue(); //We are not sending this event to youbora, //so prevent it from dispatching through YouboraEvent.YouboraReport. }); messageBus.addListener(this, AdEvent.adProgress, event -> { + lastReportedAdPlayhead = Long.valueOf(event.currentAdPosition / Consts.MILLISECONDS_MULTIPLIER).doubleValue(); + printLastReportedAdPlayhead(); //We are not sending this event to youbora, //so prevent it from dispatching through YouboraEvent.YouboraReport. }); From f1dbb0e9f8c9359c164bd32aea909927d099d087 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Thu, 10 Mar 2022 11:56:15 +0200 Subject: [PATCH 114/143] FEC-12017 - javadoc enable (#93) --- .travis.yml | 2 +- youboraplugin/gradle-mvn-push.gradle | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index ee39e8c..523b809 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: android dist: trusty sudo: required jdk: - - oraclejdk11 + - openjdk11 android: components: - tools diff --git a/youboraplugin/gradle-mvn-push.gradle b/youboraplugin/gradle-mvn-push.gradle index ac8d5f4..a42cf6c 100644 --- a/youboraplugin/gradle-mvn-push.gradle +++ b/youboraplugin/gradle-mvn-push.gradle @@ -86,6 +86,8 @@ afterEvaluate { project -> task androidJavadocs(type: Javadoc) { source = android.sourceSets.main.java.srcDirs classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) + exclude '**/*.kt' + include '**/BuildConfig.java' } afterEvaluate { @@ -95,17 +97,17 @@ afterEvaluate { project -> } task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) { - classifier = 'javadoc' + classifier 'javadoc' from androidJavadocs.destinationDir } task androidSourcesJar(type: Jar) { - classifier = 'sources' + classifier 'sources' from android.sourceSets.main.java.sourceFiles } artifacts { archives androidSourcesJar - //archives androidJavadocsJar + archives androidJavadocsJar } } From e8cc6f412377252576d81ba5d8474043ae088907 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Tue, 15 Mar 2022 21:50:04 +0200 Subject: [PATCH 115/143] Update README.md update readme --- README.md | 151 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) diff --git a/README.md b/README.md index 5087e93..c96cd1b 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,154 @@ # playkit-android-youbora + + + + +* Once you have a player instance you may want to be able to track playback behaviour and playback trends. +* Using Youbora plugin you can achive this easily. + + + +#### Setup +Add Youbra maven to your project build.gradle in repositories section + +`maven { url "https://npaw.jfrog.io/artifactory/youbora/" }` + + +Add the youbora plugin depenancy to your build.gradle file: +In android we keep all plugins aligned with same verison. + +`implementation 'com.kaltura.playkit:youboraplugin:4.x.x'` + +##### You can find latest version here: + +[Releases](https://github.com/kaltura/playkit-android-youbora/releases) + +##### You can fins the youbora lib version we currently use here + +[Youbora lib version](https://github.com/kaltura/playkit-android-youbora/blob/f1dbb0e9f8c9359c164bd32aea909927d099d087/youboraplugin/build.gradle#L33) + + +#### Create plugin config: + +``` +val playerInitOptions = PlayerInitOptions(PARTNER_ID) +playerInitOptions.setAutoPlay(true) +... +... + +val pkPluginConfigs = PKPluginConfigs() +pkPluginConfigs.setPluginConfig(YouboraPlugin.factory.name, getYouboraBundle()) + +playerInitOptions.setPluginConfigs(pkPluginConfigs) + +player = KalturaOttPlayer.create(this@MainActivity, playerInitOptions) + +``` + +#### Build your youbora config Bundle +###### Example for some of the properites you can send youbora plugin the only must property is your account code in csae value isnot sent if plufing have it internally plugin will set it automatically i.e media title, media resource and more. + +[Youbora Bundle Keys referance](https://bitbucket.org/npaw/lib-plugin-android/src/047a982e74b452ce2e5aeda426830f3a83da5e29/youboralib/src/main/java/com/npaw/youbora/lib6/plugin/Options.kt#lines-628) + +``` + /** + * Bundle Youbora Configuration + * @return YouboraConfigBundle + */ + private fun getYouboraBundle(): Bundle { + + val optBundle = Bundle() + + //Youbora config bundle. Main config goes here. + optBundle.putString(KEY_ACCOUNT_CODE, ACCOUNT_CODE) + optBundle.putString(KEY_USERNAME, UNIQUE_USER_NAME) + optBundle.putString(KEY_USER_EMAIL, USER_EMAIL) + + optBundle.putBoolean(KEY_ENABLED, true) + optBundle.putString(KEY_APP_NAME, "TestApp"); + optBundle.putString(KEY_APP_RELEASE_VERSION, "v1.0"); + + //Media entry bundle. + optBundle.putString(KEY_CONTENT_TITLE, MEDIA_TITLE) + + optBundle.putBoolean(KEY_PARSE_MANIFEST, PARSE_MANIFEST) + optBundle.putBoolean(KEY_PARSE_CDN_NODE, PARSE_CDN_NODE) + optBundle.putBoolean(KEY_PARSE_CDN_SWITCH_HEADER, PARSE_CDN_SWITCH_HEADER) + optBundle.putStringArrayList(KEY_PARSE_CDN_NODE_LIST, PARSE_CDN_NODE_LIST) + optBundle.putString(KEY_PARSE_CDN_NAME_HEADER, PARSE_CDN_NAME_HEADERS) + optBundle.putInt(KEY_PARSE_CDN_TTL, PARSE_CDN_TTL) + + + //Optional - Device bundle o/w youbora will decide by its own. + optBundle.putString(KEY_DEVICE_CODE, DEVICE_CODE) + optBundle.putString(KEY_DEVICE_BRAND, "Xiaomi") + optBundle.putString(KEY_DEVICE_MODEL, "Mii3") + optBundle.putString(KEY_DEVICE_TYPE, "TvBox") + optBundle.putString(KEY_DEVICE_OS_NAME, "Android/Oreo") + optBundle.putString(KEY_DEVICE_OS_VERSION, "8.1") + + //Youbora ads configuration bundle. + optBundle.putString(KEY_AD_CAMPAIGN, CAMPAIGN) + + //Configure custom properties here: + optBundle.putString(KEY_CONTENT_GENRE, GENRE) + optBundle.putString(KEY_CONTENT_TYPE, TYPE) + optBundle.putString(KEY_CONTENT_TRANSACTION_CODE, TRANSACTION_TYPE) + optBundle.putString(KEY_CONTENT_CDN, CONTENT_CDN_CODE) + + optBundle.putString(KEY_CONTENT_PRICE, PRICE) + optBundle.putString(KEY_CONTENT_ENCODING_AUDIO_CODEC, AUDIO_TYPE) + optBundle.putString(KEY_CONTENT_CHANNEL, AUDIO_CHANNELS) + + val contentMetadataBundle = Bundle() + + contentMetadataBundle.putString(KEY_CONTENT_METADATA_YEAR, YEAR) + contentMetadataBundle.putString(KEY_CONTENT_METADATA_CAST, CAST) + contentMetadataBundle.putString(KEY_CONTENT_METADATA_DIRECTOR, DIRECTOR) + contentMetadataBundle.putString(KEY_CONTENT_METADATA_OWNER, OWNER) + contentMetadataBundle.putString(KEY_CONTENT_METADATA_PARENTAL, PARENTAL) + contentMetadataBundle.putString(KEY_CONTENT_METADATA_RATING, RATING) + contentMetadataBundle.putString(KEY_CONTENT_METADATA_QUALITY, QUALITY) + + optBundle.putBundle(KEY_CONTENT_METADATA, contentMetadataBundle) + + //You can add some extra params here: + optBundle.putString(KEY_CUSTOM_DIMENSION_1, EXTRA_PARAM_1) + optBundle.putString(KEY_CUSTOM_DIMENSION_2, EXTRA_PARAM_2) + + return optBundle + } +``` + +From this point the plugin will be funciional (make sure your account code was set properly) + + +The plugin will send data for a single media playback. + +Once you want to change media you first have to update the plugin with new bundle data using `player?.updatePluginConfig` +then load the new media. + +``` +youboraPluginConfig?.let { + if (setPlugin) { + pkPluginConfigs.setPluginConfig(YouboraPlugin.factory.name, youboraPluginBundle) + } else { + player?.updatePluginConfig(YouboraPlugin.factory.name, youboraPluginBundle) + } +} +``` + +### Ads + +Once player is loaded also with IMA Plugin the Youbora PLugin will also report Ads playback analytics + + +### Plugin Life Cycle + +The youbora plugin is tied to the player life cycle and listens to player onAplication pause/resume calls and player destruction. + +Samples: + +[Kaltura Player Youbora Sample](https://github.com/kaltura/kaltura-player-android-samples/blob/4da67739589a46f49f41c5a94297b363ce00cc37/AdvancedSamples/Youbora/app/src/main/java/com/kaltura/playkit/samples/youbora/MainActivity.kt#L231) From 4b66ffd4855dcfc887a13678bc20f00c1e1e711e Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Tue, 15 Mar 2022 21:50:51 +0200 Subject: [PATCH 116/143] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c96cd1b..40a0b11 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ * Once you have a player instance you may want to be able to track playback behaviour and playback trends. -* Using Youbora plugin you can achive this easily. +* Using Youbora plugin you can acheive this easily. From fa0e15463f55e7cda59cd5d9de8a447777964593 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 16 Mar 2022 07:52:03 +0200 Subject: [PATCH 117/143] Update README.md --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 40a0b11..603895d 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,9 @@ # playkit-android-youbora +Youbora provides a business intelligence solution for broadcasters, OTTs, telcos and media to support your business decisions and drive performance. The ability to harness data across various integrated capabilities and services has become increasingly important to support multiple organizations across a video business, including marketing, and to drive consumer engagement and loyalty. +The Youbora player plugin is integrated with the Kaltura player. The plugin listens and reports all the different player states in the current video session to Youbora Analytics. By taking all the data from inside the player, Youbora Analytics is capable of measuring the quality of the video experience from its source, the end user, and in turn analyzing the delivery process end to end. * Once you have a player instance you may want to be able to track playback behaviour and playback trends. @@ -52,7 +54,7 @@ player = KalturaOttPlayer.create(this@MainActivity, playerInitOptions) ``` #### Build your youbora config Bundle -###### Example for some of the properites you can send youbora plugin the only must property is your account code in csae value isnot sent if plufing have it internally plugin will set it automatically i.e media title, media resource and more. +###### Example for some of the properites you can send youbora plugin the only must property is your account code in case value is not sent, if plugin have it internally plugin will set it automatically i.e media title, media resource and more. [Youbora Bundle Keys referance](https://bitbucket.org/npaw/lib-plugin-android/src/047a982e74b452ce2e5aeda426830f3a83da5e29/youboralib/src/main/java/com/npaw/youbora/lib6/plugin/Options.kt#lines-628) @@ -146,13 +148,14 @@ youboraPluginConfig?.let { ### Ads -Once player is loaded also with IMA Plugin the Youbora PLugin will also report Ads playback analytics +Once the player is configured with IMA Plugin the Youbora Plugin will also report Ads playback analytics ### Plugin Life Cycle -The youbora plugin is tied to the player life cycle and listens to player onAplication pause/resume calls and player destruction. +The youbora plugin is tied to the player life cycle and listens to player onPause/onResume calls and player destruction event. +[Example](https://github.com/kaltura/playkit-android-youbora/blob/4b66ffd4855dcfc887a13678bc20f00c1e1e711e/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java#L258) -Samples: +#### Samples: [Kaltura Player Youbora Sample](https://github.com/kaltura/kaltura-player-android-samples/blob/4da67739589a46f49f41c5a94297b363ce00cc37/AdvancedSamples/Youbora/app/src/main/java/com/kaltura/playkit/samples/youbora/MainActivity.kt#L231) From e4a8b2033b5a1205f6f99ab7b9e2d4cce6b69e0a Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 16 Mar 2022 07:52:34 +0200 Subject: [PATCH 118/143] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 603895d..44c924c 100644 --- a/README.md +++ b/README.md @@ -154,6 +154,7 @@ Once the player is configured with IMA Plugin the Youbora Plugin will also repor ### Plugin Life Cycle The youbora plugin is tied to the player life cycle and listens to player onPause/onResume calls and player destruction event. + [Example](https://github.com/kaltura/playkit-android-youbora/blob/4b66ffd4855dcfc887a13678bc20f00c1e1e711e/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java#L258) #### Samples: From 37dd2acfb886e83583702ce4d1de604cecd528c1 Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Wed, 23 Mar 2022 13:45:26 +0530 Subject: [PATCH 119/143] Update README.md (#95) --- README.md | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 44c924c..3c684a5 100644 --- a/README.md +++ b/README.md @@ -12,31 +12,32 @@ The Youbora player plugin is integrated with the Kaltura player. The plugin list * Once you have a player instance you may want to be able to track playback behaviour and playback trends. -* Using Youbora plugin you can acheive this easily. +* Using Youbora plugin you can achieve this easily. #### Setup -Add Youbra maven to your project build.gradle in repositories section + +Add Youbora maven to your project build.gradle in repositories section `maven { url "https://npaw.jfrog.io/artifactory/youbora/" }` -Add the youbora plugin depenancy to your build.gradle file: -In android we keep all plugins aligned with same verison. +Add the Youbora plugin dependency to your `build.gradle` file: +In android, we keep all plugins aligned with same verison. `implementation 'com.kaltura.playkit:youboraplugin:4.x.x'` -##### You can find latest version here: +##### You can find the latest version here: [Releases](https://github.com/kaltura/playkit-android-youbora/releases) -##### You can fins the youbora lib version we currently use here +##### You can find the Youbora lib version which we currently use here [Youbora lib version](https://github.com/kaltura/playkit-android-youbora/blob/f1dbb0e9f8c9359c164bd32aea909927d099d087/youboraplugin/build.gradle#L33) -#### Create plugin config: +#### Create Plugin Config: ``` val playerInitOptions = PlayerInitOptions(PARTNER_ID) @@ -53,15 +54,16 @@ player = KalturaOttPlayer.create(this@MainActivity, playerInitOptions) ``` -#### Build your youbora config Bundle -###### Example for some of the properites you can send youbora plugin the only must property is your account code in case value is not sent, if plugin have it internally plugin will set it automatically i.e media title, media resource and more. +#### Build your Youbora config Bundle +##### Example for some of the properties the App can send to Youbora plugin. The only must property to send is _your account code_. +In case if properties are not sent and if plugin have it internally plugin will set it automatically i.e media title, media resource and more. [Youbora Bundle Keys referance](https://bitbucket.org/npaw/lib-plugin-android/src/047a982e74b452ce2e5aeda426830f3a83da5e29/youboralib/src/main/java/com/npaw/youbora/lib6/plugin/Options.kt#lines-628) ``` /** * Bundle Youbora Configuration - * @return YouboraConfigBundle + * @return Youbora ConfigBundle */ private fun getYouboraBundle(): Bundle { @@ -128,8 +130,7 @@ player = KalturaOttPlayer.create(this@MainActivity, playerInitOptions) } ``` -From this point the plugin will be funciional (make sure your account code was set properly) - +From this point, the plugin will be functional (make sure your account code was set properly). The plugin will send data for a single media playback. @@ -148,12 +149,12 @@ youboraPluginConfig?.let { ### Ads -Once the player is configured with IMA Plugin the Youbora Plugin will also report Ads playback analytics +Once the player is configured with IMA Plugin, Youbora Plugin will also report Ads playback analytics. -### Plugin Life Cycle +### Plugin LifeCycle -The youbora plugin is tied to the player life cycle and listens to player onPause/onResume calls and player destruction event. +The Youbora plugin is tied to the player's life cycle and listens to player onPause/onResume calls and player destruction event. [Example](https://github.com/kaltura/playkit-android-youbora/blob/4b66ffd4855dcfc887a13678bc20f00c1e1e711e/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java#L258) From b46b3f3264e8a098c81ac13beb3c3124367d196e Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Mon, 28 Mar 2022 17:29:47 +0530 Subject: [PATCH 120/143] FEC-12012 Fixed float to double conversion (#92) --- .../plugins/youbora/PKYouboraPlayerAdapter.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index 5009545..e837761 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -475,10 +475,18 @@ public Integer getDroppedFrames() { @Override public double getPlayrate() { - double currentPlaybackRate = 0; + double currentPlaybackRate = Consts.PLAYBACK_SPEED_RATE_UNKNOWN; if (getPlayer() != null && getPlayer().isPlaying()) { - currentPlaybackRate = getPlayer().getPlaybackRate(); + float playbackRate = getPlayer().getPlaybackRate(); + try { + currentPlaybackRate = Double.parseDouble(String.valueOf(playbackRate)); + } catch (NullPointerException exception) { + log.e("getPlayrate NullPointerException playbackRate = " + playbackRate); + } catch (NumberFormatException exception) { + log.e("getPlayrate NumberFormatException playbackRate = " + playbackRate); + } } + log.d("getPlayrate currentPlaybackRate = " + currentPlaybackRate + " isNullPlayer = " + (getPlayer() == null)); return currentPlaybackRate; } From 23354f6e7343bec78223886a62132f5cee093ec5 Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Mon, 28 Mar 2022 18:06:35 +0530 Subject: [PATCH 121/143] - If calculated rendition is `null` then use the previously calculated rendition (#94) --- .../playkit/plugins/youbora/PKYouboraPlayerAdapter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index e837761..c089bcd 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -545,11 +545,11 @@ private boolean isNullAdapter() { } public String generateRendition(double bitrate, int width, int height) { - if ((width <= 0 || height <= 0) && bitrate <= 0) { return super.getRendition(); } else { - return YouboraUtil.buildRenditionString(width, height, bitrate); + String rendition = YouboraUtil.buildRenditionString(width, height, bitrate); + return TextUtils.isEmpty(rendition) ? lastReportedRendition : rendition; } } From 186b3fd33d9654356430c60bf16e250bff56839f Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Mon, 25 Apr 2022 22:56:28 +0530 Subject: [PATCH 122/143] - Null protection for plugin instance (#96) --- .../com/kaltura/playkit/plugins/youbora/YouboraPlugin.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index 89007a0..db25fb4 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -137,7 +137,9 @@ private void loadPlugin() { private void updateStreamingProtocol(PlayerEvent.SourceSelected sourceSelectedEvent) { if (sourceSelectedEvent != null && sourceSelectedEvent.source != null && sourceSelectedEvent.source.getMediaFormat() != null) { - if (npawPlugin.getOptions().getContentStreamingProtocol() == null) { + if (npawPlugin != null && + npawPlugin.getOptions() != null && + npawPlugin.getOptions().getContentStreamingProtocol() == null) { npawPlugin.getOptions().setContentStreamingProtocol(sourceSelectedEvent.source.getMediaFormat().name().toUpperCase()); } } From a4aaddc54ba3a87eafe7551ab529fffe0c39b120 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Fri, 13 May 2022 00:12:28 +0300 Subject: [PATCH 123/143] Update YouboraSessions.md --- docs/YouboraSessions.md | 71 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 4 deletions(-) diff --git a/docs/YouboraSessions.md b/docs/YouboraSessions.md index 7008d12..89a9e8c 100644 --- a/docs/YouboraSessions.md +++ b/docs/YouboraSessions.md @@ -3,14 +3,77 @@ ## To integrate youbora sessions follow this documentation: https://documentation.npaw.com/npaw-integration/docs/application-analytics-custom-events-data-collection This means: create a plugin instance that can be accessed globally, and call fireEvent() and fireNav() to report what you want. +with the Plugin Options you want + +#### Init Example: +Init has to be created some timwe before creating the player youbora plugin config, +since it is async call and player should use the fastDataConfig that is creatred internally. +``` +Bundle optBundle = new Bundle(); +optBundle.putString(KEY_ACCOUNT_CODE, ACCOUNT_CODE); +optBundle.putString(KEY_USERNAME, UNIQUE_USER_NAME); +optBundle.putString(KEY_USER_EMAIL, UNIQUE_USER_EMAIL); +optBundle.putString(KEY_APP_NAME, "APP TestApp"); +optBundle.putString(KEY_APP_RELEASE_VERSION, "v1.0"); + +Options options = new Options(optBundle); + +appNpawPlugin = new com.npaw.youbora.lib6.plugin.Plugin(options, getApplicationContext()); + +Map dimentions = new HashMap<>(); +dimentions.put(KEY_CUSTOM_DIMENSION_1, "my value 1"); +dimentions.put(KEY_CUSTOM_DIMENSION_2, "my value 2"); +appNpawPlugin.getInfinity().begin("Screen1", dimentions); +``` ## Mix session analytics and video analytics -After, to communicate youbora plugin for sessions and kaltura player: +After init, to communicate youbora plugin for sessions and kaltura player youbora plugin: ### Before instantiating the player: +``` +ViewTransform.FastDataConfig fastDataConfig = appNpawPlugin.getFastDataConfig(); +``` +### When instantiating the player, and before starting any video view set the object obtained previously in youboraconfig object used in player's constructor: -ViewTransform.FastDataConfig fastDataConfig = plugin.getFastDataConfig(); +``` +#### YouboraConfig initiliazation of fastDataConfig params using appNpawPlugin fastDataConfig -### When instantiating the player, and before starting any video view set the object obtained previously in youboraconfig object used in player's constructor: +``` +if (fastDataConfig != null) { + if (appNpawPlugin.getFastDataConfig().host != null) { + optBundle.putString(FastDataConfigFields.FASTDATA_CONFIG_HOST, fastDataConfig.host); + } + if (appNpawPlugin.getFastDataConfig().code != null) { + optBundle.putString(FastDataConfigFields.FASTDATA_CONFIG_CODE, fastDataConfig.code); + } + if (appNpawPlugin.getFastDataConfig().pingTime != null) { + optBundle.putInt(FastDataConfigFields.FASTDATA_CONFIG_PINGTIME, fastDataConfig.pingTime); + } + if (appNpawPlugin.getFastDataConfig().beatTime != null) { + optBundle.putInt(FastDataConfigFields.FASTDATA_CONFIG_BEATTIME, fastDataConfig.beatTime); + } + if (appNpawPlugin.getFastDataConfig().expirationTime != null) { + optBundle.putInt(FastDataConfigFields.FASTDATA_CONFIG_EXPIRATIONTIME, fastDataConfig.expirationTime); + } +} +``` + +### Sending app events to youbora: + +#### Example: + +``` +appNpawPlugin.getInfinity().fireNav("Activity1"); + +Map map = new HashMap<>(); +map.put("a", "b"); +appNpawPlugin.getInfinity().fireEvent("event1", map); + +appNpawPlugin.getInfinity().fireEvent("event2"); + +Map errorMap = new HashMap<>(); +errorMap.put("code", "5"); +appNpawPlugin.getInfinity().fireEvent("error", errorMap); -youboraConfig.setFastDataConfig(fastDataConfig) +appNpawPlugin.getInfinity().end(); // on ended or error +``` From 1b8de03135cc7b1308a9309064b896bc4e2cb5be Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Fri, 13 May 2022 00:13:30 +0300 Subject: [PATCH 124/143] Update YouboraSessions.md --- docs/YouboraSessions.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/YouboraSessions.md b/docs/YouboraSessions.md index 89a9e8c..76a1c2b 100644 --- a/docs/YouboraSessions.md +++ b/docs/YouboraSessions.md @@ -35,7 +35,6 @@ ViewTransform.FastDataConfig fastDataConfig = appNpawPlugin.getFastDataConfig(); ``` ### When instantiating the player, and before starting any video view set the object obtained previously in youboraconfig object used in player's constructor: -``` #### YouboraConfig initiliazation of fastDataConfig params using appNpawPlugin fastDataConfig ``` From cc1b772fea4730806da673c935fa87934b15e114 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Fri, 13 May 2022 00:15:36 +0300 Subject: [PATCH 125/143] Update YouboraSessions.md --- docs/YouboraSessions.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docs/YouboraSessions.md b/docs/YouboraSessions.md index 76a1c2b..2bd39da 100644 --- a/docs/YouboraSessions.md +++ b/docs/YouboraSessions.md @@ -33,9 +33,8 @@ After init, to communicate youbora plugin for sessions and kaltura player youbor ``` ViewTransform.FastDataConfig fastDataConfig = appNpawPlugin.getFastDataConfig(); ``` -### When instantiating the player, and before starting any video view set the object obtained previously in youboraconfig object used in player's constructor: - -#### YouboraConfig initiliazation of fastDataConfig params using appNpawPlugin fastDataConfig +### Instantiating the playre youbora plugin +#### YouboraConfig initiliazation with fastDataConfig params crfeated in appNpawPlugin's fastDataConfig ``` if (fastDataConfig != null) { From 065e0c9441d97a9b98a4b3742f8cacfa4a614cdd Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Fri, 13 May 2022 00:17:14 +0300 Subject: [PATCH 126/143] Update YouboraSessions.md --- docs/YouboraSessions.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/YouboraSessions.md b/docs/YouboraSessions.md index 2bd39da..59dcde1 100644 --- a/docs/YouboraSessions.md +++ b/docs/YouboraSessions.md @@ -1,6 +1,7 @@ # Youbora sessions integration ## To integrate youbora sessions follow this documentation: +### This Session Feature will allow Apps to send App events to Youbora BE in same context as the Players one. https://documentation.npaw.com/npaw-integration/docs/application-analytics-custom-events-data-collection This means: create a plugin instance that can be accessed globally, and call fireEvent() and fireNav() to report what you want. with the Plugin Options you want From 7fe0243f9f0903bb2229955604d763551e7418c7 Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Thu, 19 May 2022 14:17:27 +0530 Subject: [PATCH 127/143] - Fixed decimal place to be with 1 digit (#97) - Added exceptions --- .../plugins/youbora/PKYouboraPlayerAdapter.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index c089bcd..5ba31db 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -39,8 +39,10 @@ import com.npaw.youbora.lib6.adapter.PlayerAdapter; import java.util.Collections; +import java.util.IllegalFormatException; import java.util.LinkedHashSet; import java.util.List; +import java.util.Locale; import java.util.Set; import static com.kaltura.playkit.PlayerEvent.Type.PLAYHEAD_UPDATED; @@ -479,11 +481,14 @@ public double getPlayrate() { if (getPlayer() != null && getPlayer().isPlaying()) { float playbackRate = getPlayer().getPlaybackRate(); try { - currentPlaybackRate = Double.parseDouble(String.valueOf(playbackRate)); - } catch (NullPointerException exception) { - log.e("getPlayrate NullPointerException playbackRate = " + playbackRate); + String rate = String.format(Locale.US, "%.1f", playbackRate); + currentPlaybackRate = Double.parseDouble(rate); } catch (NumberFormatException exception) { log.e("getPlayrate NumberFormatException playbackRate = " + playbackRate); + } catch (IllegalFormatException exception) { + log.e("getPlayrate IllegalFormatException playbackRate = " + playbackRate); + } catch (NullPointerException exception) { + log.e("getPlayrate NullPointerException playbackRate = " + playbackRate); } } From 198f79653b80362df8a125a77532b682fc1f1cc2 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Mon, 6 Jun 2022 09:10:51 +0300 Subject: [PATCH 128/143] Update YouboraSessions.md --- docs/YouboraSessions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/YouboraSessions.md b/docs/YouboraSessions.md index 59dcde1..5a0e15a 100644 --- a/docs/YouboraSessions.md +++ b/docs/YouboraSessions.md @@ -7,7 +7,7 @@ This means: create a plugin instance that can be accessed globally, and call fir with the Plugin Options you want #### Init Example: -Init has to be created some timwe before creating the player youbora plugin config, +Init has to be created some time before creating the player youbora plugin config, since it is async call and player should use the fastDataConfig that is creatred internally. ``` Bundle optBundle = new Bundle(); @@ -34,7 +34,7 @@ After init, to communicate youbora plugin for sessions and kaltura player youbor ``` ViewTransform.FastDataConfig fastDataConfig = appNpawPlugin.getFastDataConfig(); ``` -### Instantiating the playre youbora plugin +### Instantiating the player youbora plugin #### YouboraConfig initiliazation with fastDataConfig params crfeated in appNpawPlugin's fastDataConfig ``` From 2084066c463d09fcaf39e196a70e09885cda898b Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Mon, 22 Aug 2022 12:28:45 +0530 Subject: [PATCH 129/143] FEC-12085 Upgrade Youbora SDK to v6.7.68 (#98) Co-authored-by: Gilad Nadav --- README.md | 200 +++- youboraplugin/build.gradle | 11 +- .../plugins/youbora/PKYouboraAdsAdapter.java | 40 +- .../pluginconfig/AdCustomDimensions.java | 20 +- .../youbora/pluginconfig/AdExpectedPattern.kt | 5 + .../plugins/youbora/pluginconfig/Ads.java | 104 -- .../plugins/youbora/pluginconfig/Ads.kt | 49 + .../plugins/youbora/pluginconfig/App.java | 5 + .../plugins/youbora/pluginconfig/CdnNode.kt | 11 + .../plugins/youbora/pluginconfig/Content.java | 395 -------- .../plugins/youbora/pluginconfig/Content.kt | 146 +++ .../pluginconfig/ContentCustomDimensions.java | 206 ---- .../pluginconfig/ContentCustomDimensions.kt | 65 ++ .../pluginconfig/CustomDeserializer.kt | 81 ++ .../pluginconfig/{Device.java => Device.kt} | 143 +-- .../plugins/youbora/pluginconfig/Encoding.kt | 14 + .../plugins/youbora/pluginconfig/Errors.java | 7 + .../plugins/youbora/pluginconfig/IsLive.kt | 6 + .../plugins/youbora/pluginconfig/Manifest.kt | 25 + .../plugins/youbora/pluginconfig/Network.java | 44 - .../plugins/youbora/pluginconfig/Network.kt | 21 + .../plugins/youbora/pluginconfig/Parse.java | 61 -- .../plugins/youbora/pluginconfig/Parse.kt | 31 + .../plugins/youbora/pluginconfig/Session.kt | 7 + .../plugins/youbora/pluginconfig/User.kt | 9 + .../youbora/pluginconfig/YouboraConfig.java | 921 +++++++++++++----- .../YouboraConfigJsonBuilder.java | 304 +++++- 27 files changed, 1738 insertions(+), 1193 deletions(-) create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/AdExpectedPattern.kt delete mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Ads.java create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Ads.kt create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/CdnNode.kt delete mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Content.java create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Content.kt delete mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/ContentCustomDimensions.java create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/ContentCustomDimensions.kt create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/CustomDeserializer.kt rename youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/{Device.java => Device.kt} (75%) create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Encoding.kt create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/IsLive.kt create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Manifest.kt delete mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Network.java create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Network.kt delete mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Parse.java create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Parse.kt create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Session.kt create mode 100644 youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/User.kt diff --git a/README.md b/README.md index 3c684a5..fd33f77 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,7 @@ player = KalturaOttPlayer.create(this@MainActivity, playerInitOptions) ``` -#### Build your Youbora config Bundle +#### Build your Youbora config using Bundle ##### Example for some of the properties the App can send to Youbora plugin. The only must property to send is _your account code_. In case if properties are not sent and if plugin have it internally plugin will set it automatically i.e media title, media resource and more. @@ -147,6 +147,204 @@ youboraPluginConfig?.let { } ``` +#### Build YouboraConfig using JSON object (Legacy approach) + +Application can create a JSON object to the Plugin config. It is not recommended approach but if you App's legacy code has in this way then you can use it, +```kotlin + +private fun getYouboraConfig(): JsonObject { + + // Youbora config json. Main config goes here. + val youboraConfigJson = JsonObject() + youboraConfigJson.addProperty("accountCode", ACCOUNT_CODE) + youboraConfigJson.addProperty("username", UNIQUE_USER_NAME) + youboraConfigJson.addProperty("userObfuscateIp", true) + youboraConfigJson.addProperty("httpSecure", true) + +// // Backward compatibility, Use user Json instead +// youboraConfigJson.addProperty("userEmail", USER_EMAIL) +// youboraConfigJson.addProperty("userAnonymousId", "my anonymousId") +// youboraConfigJson.addProperty("userType", "my user type") +// youboraConfigJson.addProperty("userObfuscateIp", false) + + val userJson = JsonObject() + userJson.addProperty("email", USER_EMAIL) + userJson.addProperty("anonymousId", "my anonymousId") + userJson.addProperty("type", "my user type") + userJson.addProperty("obfuscateIp", "My ObfuscateIp") + + // Youbora ads configuration json. + val adsJson = JsonObject() + adsJson.addProperty("blockerDetected", false) + adsJson.addProperty("campaign", "zzz") + // Create AdMetaData + val adMetaData = JsonObject() + adMetaData.addProperty("year", "2022") + adMetaData.addProperty("cast", "cast 2022") + adMetaData.addProperty("director", "director 2022") + adMetaData.addProperty("owner", "owner 2022") + adMetaData.addProperty("parental", "parental 2022") + adMetaData.addProperty("rating", "rating 2022") + adMetaData.addProperty("device", "device 2022") + adMetaData.addProperty("audioChannels", "audioChannels 2022") + adsJson.add("metadata", adMetaData) + adsJson.addProperty("campaign", CAMPAIGN) + adsJson.addProperty("title", "ad title 2022") + adsJson.addProperty("resource", "resource 2022") + adsJson.addProperty("givenBreaks", 5) + adsJson.addProperty("expectedBreaks", 4) + // Create expectedPattern for Ads + val expectedPatternJson = JsonObject() + val preRoll = JsonArray() + preRoll.add(2) + val midRoll = JsonArray() + midRoll.add(1) + midRoll.add(4) + val postRoll = JsonArray() + postRoll.add(3) + expectedPatternJson.add("pre", preRoll) + expectedPatternJson.add("mid", midRoll) + expectedPatternJson.add("post", postRoll) + adsJson.add("expectedPattern", expectedPatternJson) + // create adBreaksTime + val adBreaksTimeArray = JsonArray() + adBreaksTimeArray.add(0) + adBreaksTimeArray.add(25) + adBreaksTimeArray.add(60) + adBreaksTimeArray.add(75) + adsJson.add("adBreaksTime", adBreaksTimeArray) + adsJson.addProperty("adGivenAds", 7) + adsJson.addProperty("adCreativeId", "ad creativeId") + adsJson.addProperty("adProvider", "ad provider") + // Create Ad Custom Dimensions + val adCustomDimensions = JsonObject() + adCustomDimensions.addProperty("param1", "my adCustomDimension1") + adCustomDimensions.addProperty("10", "my adCustomDimension10") + adsJson.add("customDimension", adCustomDimensions) + + // Media entry json. [Content JSON] + val mediaEntryJson = JsonObject() + mediaEntryJson.addProperty("title", MEDIA_TITLE) + mediaEntryJson.addProperty("contentIsLiveNoSeek", true) + mediaEntryJson.addProperty("contentCdnCode", CONTENT_CDN_CODE) + mediaEntryJson.addProperty("contentGenre", GENRE) + mediaEntryJson.addProperty("contentEpisodeTitle", "xxxxxxx") + mediaEntryJson.addProperty("contentPrice", PRICE) + mediaEntryJson.addProperty("contentTransactionCode", TRANSACTION_TYPE) + mediaEntryJson.addProperty("contentProgram", PROGRAM) + mediaEntryJson.addProperty("isLive", IS_LIVE_MEDIA) + mediaEntryJson.addProperty("contentBitrate", 480000) + // Encoding JSON + val encodingJson = JsonObject() + encodingJson.addProperty("videoCodec", "video codec name") + mediaEntryJson.add("contentEncodingCodecSettings", encodingJson) + // Create Content MetaData + val contentMetaData = JsonObject() + contentMetaData.addProperty("year", "2022") + contentMetaData.addProperty("cast", "cast 2022") + contentMetaData.addProperty("director", "director 2022") + contentMetaData.addProperty("owner", "owner 2022") + contentMetaData.addProperty("parental", "parental 2022") + contentMetaData.addProperty("rating", "rating 2022") + contentMetaData.addProperty("device", "device 2022") + contentMetaData.addProperty("audioChannels", "audioChannels 2022") + mediaEntryJson.add("metadata", contentMetaData) + // Create Content Custom Dimensions + val contentCustomDimensions = JsonObject() + contentCustomDimensions.addProperty("param1", "param1") + contentCustomDimensions.addProperty("param2", "param2") + mediaEntryJson.add("customDimensions", contentCustomDimensions) + + // Optional - Create Parse JSON object + val parseJson = JsonObject() + parseJson.addProperty("parseManifest", PARSE_MANIFEST) + parseJson.addProperty("parseCdnNode", PARSE_CDN_NODE) + parseJson.addProperty("parseCdnSwitchHeader", PARSE_CDN_SWITCH_HEADER) + val parseCdnNodeListJsonArray = JsonArray() + for(cdn in PARSE_CDN_NODE_LIST) { + parseCdnNodeListJsonArray.add(cdn) + } + parseJson.add("cdnNodeList", parseCdnNodeListJsonArray) + parseJson.addProperty("cdnNameHeaders", PARSE_CDN_NAME_HEADERS) + parseJson.addProperty("parseNodeHeader", PARSE_CDN_NODE_HEADERS) + parseJson.addProperty("parseCdnTTL", PARSE_CDN_TTL) + + // Optional - Device json o/w youbora will decide by its own. + val deviceJson = JsonObject() + deviceJson.addProperty("deviceCode", DEVICE_CODE) + deviceJson.addProperty("deviceBrand", "Brand Xiaomi") + deviceJson.addProperty("deviceCode", "Code Xiaomi") + deviceJson.addProperty("deviceId", "Device ID Xiaomi") + deviceJson.addProperty("deviceEdId", "EdId Xiaomi") + deviceJson.addProperty("deviceModel", "Model MI3") + deviceJson.addProperty("deviceOsName", "Android/Oreo") + deviceJson.addProperty("deviceOsVersion", "8.1") + deviceJson.addProperty("deviceType", "TvBox TYPE") + deviceJson.addProperty("deviceName", "TvBox") + deviceJson.addProperty("deviceIsAnonymous", "TvBox") + + // Optional: Create Network JSON object + val networkJson = JsonObject() + networkJson.addProperty("networkConnectionType", "Wireless") + networkJson.addProperty("networkIP", "1.1.1.1") + networkJson.addProperty("networkIsp", "Country ISP") + + // App JSON + val appJson = JsonObject() + appJson.addProperty("appName", "MyTestApp") + appJson.addProperty("appReleaseVersion", "1.0.1") + + // Errors JSON + val errorsJson = JsonObject() + val errorJsonArray = JsonArray() + errorJsonArray.add("exception1") + errorJsonArray.add("exception2") + errorsJson.add("errorsIgnore", errorJsonArray) + + // SessionMetrics JSON + val sessionJson = JsonObject() + sessionJson.addProperty("metricsKey", "metricsValue") + +// // Configure custom properties here, Backward Compatible +// // Properties are actually metadata which are moved to Ad and Content respectively +// val propertiesJson = JsonObject() +// propertiesJson.addProperty("year", YEAR) +// propertiesJson.addProperty("cast", CAST) +// propertiesJson.addProperty("director", DIRECTOR) +// propertiesJson.addProperty("owner", OWNER) +// propertiesJson.addProperty("parental", PARENTAL) +// +// propertiesJson.addProperty("rating", RATING) +// propertiesJson.addProperty("audioType", AUDIO_TYPE) +// propertiesJson.addProperty("audioChannels", AUDIO_CHANNELS) +// propertiesJson.addProperty("device", DEVICE) +// propertiesJson.addProperty("quality", QUALITY) +// +// +// // Backward Compatible. +// // These are custom dimensions which are moved to Ads and Content respectively +// val extraParamJson = JsonObject() +// extraParamJson.addProperty("param1", EXTRA_PARAM_1) +// extraParamJson.addProperty("param2", EXTRA_PARAM_2) + + // Add all the json objects created before to the pluginEntry json. + youboraConfigJson.add("media", mediaEntryJson) + youboraConfigJson.add("app", appJson) + youboraConfigJson.add("parse", parseJson) + youboraConfigJson.add("network", networkJson) + youboraConfigJson.add("device", deviceJson) + youboraConfigJson.add("errors", errorsJson) + youboraConfigJson.add("ads", adsJson) + youboraConfigJson.add("sessionMetrics", sessionJson) +// youboraConfigJson.add("properties", propertiesJson) +// youboraConfigJson.add("extraParams", extraParamJson) + + return youboraConfigJson + } + + +``` + ### Ads Once the player is configured with IMA Plugin, Youbora Plugin will also report Ads playback analytics. diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index ffe7479..52c639d 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -1,4 +1,5 @@ apply plugin: 'com.android.library' +apply plugin: 'kotlin-android' apply from: 'version.gradle' android { @@ -22,6 +23,10 @@ android { } } + kotlinOptions { + jvmTarget = '1.8' + } + } dependencies { @@ -30,7 +35,11 @@ dependencies { implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' //implementation project(":playkit") - api 'com.nicepeopleatwork:youboralib:6.7.53' + api 'com.nicepeopleatwork:youboralib:6.7.72' + + // Kotlin Config + implementation 'androidx.core:core-ktx:1.3.2' + implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test:runner:1.4.0' diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java index c845f1d..317dafb 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraAdsAdapter.java @@ -12,6 +12,10 @@ package com.kaltura.playkit.plugins.youbora; +import android.text.TextUtils; + +import androidx.annotation.Nullable; + import com.kaltura.playkit.BuildConfig; import com.kaltura.playkit.MessageBus; import com.kaltura.playkit.PKError; @@ -28,6 +32,10 @@ import com.kaltura.playkit.utils.Consts; import com.npaw.youbora.lib6.adapter.AdAdapter; +import java.util.HashMap; +import java.util.Map; + + /** * @hide */ @@ -203,12 +211,14 @@ private void addListeners() { sendReportEvent(event.eventType()); }); + //DAI messageBus.addListener(this, AdEvent.adBreakStarted, event -> { if(currentAdInfo != null && currentAdInfo.getAdPositionType() != AdPositionType.PRE_ROLL) { fireAdBreakStart(); } }); + //DAI messageBus.addListener(this, AdEvent.adBreakEnded, event -> { fireAdBreakStop(); }); @@ -233,6 +243,11 @@ private void addListeners() { getPlugin().fireInit(); getPlugin().getAdapter().fireStart(); } + + Map adIdMap = getAdIdMap(currentAdInfo); + if (adIdMap != null) { + fireManifest(adIdMap); + } sendReportEvent(event.eventType()); }); @@ -246,7 +261,10 @@ private void addListeners() { lastReportedAdBitrate = currentAdInfo.getMediaBitrate(); printLastReportedAdPlayhead(); fireStart(); - fireJoin(); + Map adIdMap = getAdIdMap(currentAdInfo); + if (adIdMap != null) { + fireManifest(adIdMap); + } sendReportEvent(event.eventType()); }); @@ -297,12 +315,17 @@ private void addListeners() { sendReportEvent(event.eventType()); }); + messageBus.addListener(this, AdEvent.contentPauseRequested, event -> { + fireAdBreakStart(); + }); + messageBus.addListener(this, AdEvent.contentResumeRequested, event -> { printEventName(event); if (isNullAdapter()) { return; } fireStop(); + fireAdBreakStop(); sendReportEvent(event.eventType()); }); @@ -353,6 +376,8 @@ private void addListeners() { }); messageBus.addListener(this, AdEvent.playHeadChanged, event -> { + // This fireJoin() call will not add another join in the call stack. It will be discarded if already done. + fireJoin(); //We are not sending this event to youbora, //so prevent it from dispatching through YouboraEvent.YouboraReport. }); @@ -369,7 +394,7 @@ private void addListeners() { if (isNullAdapter()) { return; } - + getPlugin().getAdapter().fireStart(); printLastReportedAdPlayhead(); fireBufferBegin(); @@ -396,6 +421,17 @@ private void addListeners() { }); } + @Nullable + private Map getAdIdMap(AdInfo adInfo) { + if (adInfo == null || TextUtils.isEmpty(adInfo.getAdId())) { + return null; + } + + Map adIdMap = new HashMap<>(); + adIdMap.put("adId", adInfo.getAdId()); + return adIdMap; + } + private PKAdPluginType getLastReportedAdPluginType() { if (lastReportedAdPluginType != null) { return lastReportedAdPluginType; diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/AdCustomDimensions.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/AdCustomDimensions.java index 74f3850..edaf0c6 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/AdCustomDimensions.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/AdCustomDimensions.java @@ -3,25 +3,25 @@ import com.google.gson.annotations.SerializedName; public class AdCustomDimensions { - @SerializedName(value="adCustomDimension1", alternate={"param1"}) + @SerializedName(value="adCustomDimension1", alternate={"param1", "1"}) private String adCustomDimension1; - @SerializedName(value="adCustomDimension2", alternate={"param2"}) + @SerializedName(value="adCustomDimension2", alternate={"param2", "2"}) private String adCustomDimension2; - @SerializedName(value="adCustomDimension3", alternate={"param3"}) + @SerializedName(value="adCustomDimension3", alternate={"param3", "3"}) private String adCustomDimension3; - @SerializedName(value="adCustomDimension4", alternate={"param4"}) + @SerializedName(value="adCustomDimension4", alternate={"param4", "4"}) private String adCustomDimension4; - @SerializedName(value="adCustomDimension5", alternate={"param5"}) + @SerializedName(value="adCustomDimension5", alternate={"param5", "5"}) private String adCustomDimension5; - @SerializedName(value="adCustomDimension6", alternate={"param6"}) + @SerializedName(value="adCustomDimension6", alternate={"param6", "6"}) private String adCustomDimension6; - @SerializedName(value="adCustomDimension7", alternate={"param7"}) + @SerializedName(value="adCustomDimension7", alternate={"param7", "7"}) private String adCustomDimension7; - @SerializedName(value="adCustomDimension8", alternate={"param8"}) + @SerializedName(value="adCustomDimension8", alternate={"param8", "8"}) private String adCustomDimension8; - @SerializedName(value="adCustomDimension9", alternate={"param9"}) + @SerializedName(value="adCustomDimension9", alternate={"param9", "9"}) private String adCustomDimension9; - @SerializedName(value="adCustomDimension10", alternate={"param10"}) + @SerializedName(value="adCustomDimension10", alternate={"param10", "10"}) private String adCustomDimension10; public String getAdCustomDimension1() { diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/AdExpectedPattern.kt b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/AdExpectedPattern.kt new file mode 100644 index 0000000..bd1e621 --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/AdExpectedPattern.kt @@ -0,0 +1,5 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig + +data class AdExpectedPattern(var pre: ArrayList? = null, + var mid: ArrayList? = null, + var post: ArrayList? = null) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Ads.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Ads.java deleted file mode 100644 index 0e57146..0000000 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Ads.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.kaltura.playkit.plugins.youbora.pluginconfig; - -import com.google.gson.annotations.SerializedName; - -import java.util.ArrayList; - -public class Ads { - - private ArrayList adBreaksTime; - @SerializedName(value="adCampaign", alternate={"campaign"}) - private String adCampaign; - private String adCreativeId; - private Integer adExpectedBreaks; - //private Bundle adExpectedPattern; - private Integer adGivenAds; - private Integer adGivenBreaks; - //private Bundle adMetadata; - private String adProvider; - private String adResource; - private String adTitle; - - @SerializedName(value="adCustomDimensions", alternate={"extraParams"}) - private AdCustomDimensions adCustomDimensions; - - public ArrayList getAdBreaksTime() { - return adBreaksTime; - } - - public void setAdBreaksTime(ArrayList adBreaksTime) { - this.adBreaksTime = adBreaksTime; - } - - public String getAdCampaign() { - return adCampaign; - } - - public void setAdCampaign(String adCampaign) { - this.adCampaign = adCampaign; - } - - public String getAdCreativeId() { - return adCreativeId; - } - - public void setAdCreativeId(String adCreativeId) { - this.adCreativeId = adCreativeId; - } - - public Integer getAdExpectedBreaks() { - return adExpectedBreaks; - } - - public void setAdExpectedBreaks(Integer adExpectedBreaks) { - this.adExpectedBreaks = adExpectedBreaks; - } - - public Integer getAdGivenAds() { - return adGivenAds; - } - - public void setAdGivenAds(Integer adGivenAds) { - this.adGivenAds = adGivenAds; - } - - public Integer getAdGivenBreaks() { - return adGivenBreaks; - } - - public void setAdGivenBreaks(Integer adGivenBreaks) { - this.adGivenBreaks = adGivenBreaks; - } - - public String getAdProvider() { - return adProvider; - } - - public void setAdProvider(String adProvider) { - this.adProvider = adProvider; - } - - public String getAdResource() { - return adResource; - } - - public void setAdResource(String adResource) { - this.adResource = adResource; - } - - public String getAdTitle() { - return adTitle; - } - - public void setAdTitle(String adTitle) { - this.adTitle = adTitle; - } - - public AdCustomDimensions getAdCustomDimensions() { - return adCustomDimensions; - } - - public void setAdCustomDimensions(AdCustomDimensions adCustomDimensions) { - this.adCustomDimensions = adCustomDimensions; - } -} \ No newline at end of file diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Ads.kt b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Ads.kt new file mode 100644 index 0000000..82caf88 --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Ads.kt @@ -0,0 +1,49 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig + +import com.google.gson.annotations.SerializedName + +data class Ads( + /** + * Set to positive integer array indicating the position (playhead in seconds) of the ad breaks, + * provided by the ad server. + */ + @SerializedName(value = "adBreaksTime", alternate = ["breaksTime"]) + var adBreaksTime: ArrayList? = null, + + @SerializedName(value = "adCampaign", alternate = ["campaign"]) + var adCampaign: String? = null, + + @SerializedName(value = "adCreativeId", alternate = ["creativeId"]) + var adCreativeId: String? = null, + + @SerializedName(value = "adExpectedBreaks", alternate = ["expectedBreaks"]) + var adExpectedBreaks: Int? = null, + + @SerializedName(value = "adGivenAds", alternate = ["givenAds"]) + var adGivenAds: Int? = null, + + @SerializedName(value = "adGivenBreaks", alternate = ["givenBreaks"]) + var adGivenBreaks: Int? = null, + + @SerializedName(value = "adProvider", alternate = ["provider"]) + var adProvider: String? = null, + + @SerializedName(value = "adResource", alternate = ["resource"]) + var adResource: String? = null, + + @SerializedName(value = "adTitle", alternate = ["title"]) + var adTitle: String? = null, + + @SerializedName(value = "adCustomDimensions", alternate = ["adCustomDimension", "extraParams"]) + var adCustomDimensions: AdCustomDimensions? = null, + + var metadata: Properties? = null, + var expectedPattern: AdExpectedPattern? = null, + var blockerDetected: Boolean? = null, + + /** + * Set to integer positive value indicating how many ads + * will be shown as post-rolls if they do it after content player triggers stop event. + */ + @kotlin.Deprecated("This option will be removed in future releases") + var afterStop: Int? = null) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/App.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/App.java index 9d88d93..6fa08e0 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/App.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/App.java @@ -1,7 +1,12 @@ package com.kaltura.playkit.plugins.youbora.pluginconfig; +import com.google.gson.annotations.SerializedName; + public class App { + @SerializedName(value="appName", alternate={"name"}) private String appName = ""; + + @SerializedName(value="appReleaseVersion", alternate={"releaseVersion"}) private String appReleaseVersion = ""; public String getAppName() { diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/CdnNode.kt b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/CdnNode.kt new file mode 100644 index 0000000..35c5b80 --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/CdnNode.kt @@ -0,0 +1,11 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig + +import com.google.gson.annotations.SerializedName + +class CdnNode( + @SerializedName(value = "parseCdnNode", alternate = ["requestDebugHeaders"]) + var parseCdnNode: Boolean? = null, + + @SerializedName(value = "parseCdnNodeList", alternate = ["list"]) + var parseCdnNodeList: ArrayList? = null) + diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Content.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Content.java deleted file mode 100644 index c1ab059..0000000 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Content.java +++ /dev/null @@ -1,395 +0,0 @@ -package com.kaltura.playkit.plugins.youbora.pluginconfig; - -import com.google.gson.annotations.SerializedName; - -public class Content { - - private Long contentBitrate; - private String contentCdn; - private String contentCdnNode; - private String contentCdnType; - private String contentChannel; - private String contentContractedResolution; - private String contentCost; - - private String contentDrm; - @SerializedName(value="contentDuration", alternate={"duration"}) - private Double contentDuration; - - private String contentEncodingAudioCodec; - private String contentEncodingCodecProfile; - //private Bundle contentEncodingCodecSettings - private String contentEncodingContainerFormat; - private String contentEncodingVideoCodec; - @SerializedName(value="contentEpisodeTitle", alternate={"title2"}) - private String contentEpisodeTitle; - - private Double contentFps; - - private String contentGenre; - private String contentGracenoteId; - - private String contentId; - private String contentImdbId; - @SerializedName(value="contentIsLive", alternate={"isLive"}) - private Boolean contentIsLive; - private Boolean contentIsLiveNoSeek; - private Boolean isDVR; //LEGACY - the opposite value from contentIsLiveNoSeek - private String contentLanguage; - - //private Bundle contentMetrics; - - private String contentPackage; - private String contentPlaybackType; - private String contentPrice; - private String contentProgram; - - private String contentRendition; - @SerializedName(value="contentResource", alternate={"resource"}) - private String contentResource; - - private String contentSaga; - private String contentSeason; - private String contentStreamingProtocol; - private String contentSubtitles; - - private Long contentThroughput; - @SerializedName(value="contentTitle", alternate={"title"}) - private String contentTitle; - @SerializedName(value="contentTransactionCode", alternate={"transactionType"}) - private String contentTransactionCode; - private Long contentTotalBytes; - private String contentTransportFormat; - - private boolean contentSendTotalBytes; - private String contentTvShow; - private String contentType; - - public Long getContentBitrate() { - return contentBitrate; - } - - public void setContentBitrate(Long contentBitrate) { - this.contentBitrate = contentBitrate; - } - - public String getContentCdn() { - return contentCdn; - } - - public void setContentCdn(String contentCdn) { - this.contentCdn = contentCdn; - } - - public String getContentCdnNode() { - return contentCdnNode; - } - - public void setContentCdnNode(String contentCdnNode) { - this.contentCdnNode = contentCdnNode; - } - - public String getContentCdnType() { - return contentCdnType; - } - - public void setContentCdnType(String contentCdnType) { - this.contentCdnType = contentCdnType; - } - - public String getContentChannel() { - return contentChannel; - } - - public void setContentChannel(String contentChannel) { - this.contentChannel = contentChannel; - } - - public String getContentContractedResolution() { - return contentContractedResolution; - } - - public void setContentContractedResolution(String contentContractedResolution) { - this.contentContractedResolution = contentContractedResolution; - } - - public String getContentCost() { - return contentCost; - } - - public void setContentCost(String contentCost) { - this.contentCost = contentCost; - } - - public String getContentDrm() { - return contentDrm; - } - - public void setContentDrm(String contentDrm) { - this.contentDrm = contentDrm; - } - - public Double getContentDuration() { - return contentDuration; - } - - public void setContentDuration(Double contentDuration) { - this.contentDuration = contentDuration; - } - - public String getContentEncodingAudioCodec() { - return contentEncodingAudioCodec; - } - - public void setContentEncodingAudioCodec(String contentEncodingAudioCodec) { - this.contentEncodingAudioCodec = contentEncodingAudioCodec; - } - - public String getContentEncodingCodecProfile() { - return contentEncodingCodecProfile; - } - - public void setContentEncodingCodecProfile(String contentEncodingCodecProfile) { - this.contentEncodingCodecProfile = contentEncodingCodecProfile; - } - - public String getContentEncodingContainerFormat() { - return contentEncodingContainerFormat; - } - - public void setContentEncodingContainerFormat(String contentEncodingContainerFormat) { - this.contentEncodingContainerFormat = contentEncodingContainerFormat; - } - - public String getContentEncodingVideoCodec() { - return contentEncodingVideoCodec; - } - - public void setContentEncodingVideoCodec(String contentEncodingVideoCodec) { - this.contentEncodingVideoCodec = contentEncodingVideoCodec; - } - - public String getContentEpisodeTitle() { - return contentEpisodeTitle; - } - - public void setContentEpisodeTitle(String contentEpisodeTitle) { - this.contentEpisodeTitle = contentEpisodeTitle; - } - - public Double getContentFps() { - return contentFps; - } - - public void setContentFps(Double contentFps) { - this.contentFps = contentFps; - } - - public String getContentGenre() { - return contentGenre; - } - - public void setContentGenre(String contentGenre) { - this.contentGenre = contentGenre; - } - - public String getContentGracenoteId() { - return contentGracenoteId; - } - - public void setContentGracenoteId(String contentGracenoteId) { - this.contentGracenoteId = contentGracenoteId; - } - - public String getContentId() { - return contentId; - } - - public void setContentId(String contentId) { - this.contentId = contentId; - } - - public String getContentImdbId() { - return contentImdbId; - } - - public void setContentImdbId(String contentImdbId) { - this.contentImdbId = contentImdbId; - } - - public Boolean getContentIsLive() { - return contentIsLive; - } - - public void setContentIsLive(Boolean contentIsLive) { - this.contentIsLive = contentIsLive; - } - - public Boolean getContentIsLiveNoSeek() { - return contentIsLiveNoSeek; - } - - public void setContentIsLiveNoSeek(Boolean contentIsLiveNoSeek) { - this.contentIsLiveNoSeek = contentIsLiveNoSeek; - } - - public Boolean getIsDVR() { - return isDVR; - } - - public void setIsDVR(Boolean isDVR) { - this.isDVR = isDVR; - } - - public String getContentLanguage() { - return contentLanguage; - } - - public void setContentLanguage(String contentLanguage) { - this.contentLanguage = contentLanguage; - } - - public String getContentPackage() { - return contentPackage; - } - - public void setContentPackage(String contentPackage) { - this.contentPackage = contentPackage; - } - - public String getContentPlaybackType() { - return contentPlaybackType; - } - - public void setContentPlaybackType(String contentPlaybackType) { - this.contentPlaybackType = contentPlaybackType; - } - - public String getContentPrice() { - return contentPrice; - } - - public void setContentPrice(String contentPrice) { - this.contentPrice = contentPrice; - } - - public String getContentProgram() { - return contentProgram; - } - - public void setContentProgram(String contentProgram) { - this.contentProgram = contentProgram; - } - - public String getContentRendition() { - return contentRendition; - } - - public void setContentRendition(String contentRendition) { - this.contentRendition = contentRendition; - } - - public String getContentResource() { - return contentResource; - } - - public void setContentResource(String contentResource) { - this.contentResource = contentResource; - } - - public String getContentSaga() { - return contentSaga; - } - - public void setContentSaga(String contentSaga) { - this.contentSaga = contentSaga; - } - - public String getContentSeason() { - return contentSeason; - } - - public void setContentSeason(String contentSeason) { - this.contentSeason = contentSeason; - } - - public String getContentStreamingProtocol() { - return contentStreamingProtocol; - } - - public void setContentStreamingProtocol(String contentStreamingProtocol) { - this.contentStreamingProtocol = contentStreamingProtocol; - } - - public String getContentSubtitles() { - return contentSubtitles; - } - - public void setContentSubtitles(String contentSubtitles) { - this.contentSubtitles = contentSubtitles; - } - - public Long getContentThroughput() { - return contentThroughput; - } - - public void setContentThroughput(Long contentThroughput) { - this.contentThroughput = contentThroughput; - } - - public String getContentTitle() { - return contentTitle; - } - - public void setContentTitle(String contentTitle) { - this.contentTitle = contentTitle; - } - - public String getContentTransactionCode() { - return contentTransactionCode; - } - - public void setContentTransactionCode(String contentTransactionCode) { - this.contentTransactionCode = contentTransactionCode; - } - - public Long getContentTotalBytes() { - return contentTotalBytes; - } - - public void setContentTotalBytes(Long contentTotalBytes) { - this.contentTotalBytes = contentTotalBytes; - } - - public String getContentTransportFormat() { - return contentTransportFormat; - } - - public void setContentTransportFormat(String contentTransportFormat) { - this.contentTransportFormat = contentTransportFormat; - } - - public boolean getContentSendTotalBytes() { - return contentSendTotalBytes; - } - - public void setContentSendTotalBytes(boolean contentSendTotalBytes) { - this.contentSendTotalBytes = contentSendTotalBytes; - } - - public String getContentTvShow() { - return contentTvShow; - } - - public void setContentTvShow(String contentTvShow) { - this.contentTvShow = contentTvShow; - } - - public String getContentType() { - return contentType; - } - - public void setContentType(String contentType) { - this.contentType = contentType; - } -} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Content.kt b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Content.kt new file mode 100644 index 0000000..8045f13 --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Content.kt @@ -0,0 +1,146 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig + +import com.google.gson.annotations.JsonAdapter +import com.google.gson.annotations.SerializedName + +data class Content( + @SerializedName(value = "contentBitrate", alternate = ["bitrate"]) + var contentBitrate: Long? = null, + + /** + * See a list of codes in [ + * http://mapi.youbora.com:8081/cdns](http://mapi.youbora.com:8081/cdns). + */ + @SerializedName(value = "contentCdn", alternate = ["cdn"]) + var contentCdn: String? = null, + + @SerializedName(value = "contentCdnNode", alternate = ["cdnNode"]) + var contentCdnNode: String? = null, + + @SerializedName(value = "contentCdnType", alternate = ["cdnType"]) + var contentCdnType: String? = null, + + @SerializedName(value = "contentChannel", alternate = ["channel"]) + var contentChannel: String? = null, + + @SerializedName(value = "contentContractedResolution", alternate = ["contractedResolution"]) + var contentContractedResolution: String? = null, + + @SerializedName(value = "contentCost", alternate = ["cost"]) + var contentCost: String? = null, + + @SerializedName(value = "contentDrm", alternate = ["drm"]) + var contentDrm: String? = null, + + @SerializedName(value = "contentDuration", alternate = ["duration"]) + var contentDuration: Double? = null, + + @kotlin.Deprecated("This is moved internally to {@link Encoding}") + var contentEncodingAudioCodec: String? = null, + + @kotlin.Deprecated("This is moved internally to {@link Encoding}") + var contentEncodingCodecProfile: String? = null, + + @SerializedName(value = "contentEncoding", alternate = ["encoding"]) + var contentEncoding: Encoding? = null, + + @kotlin.Deprecated("This is moved internally to {@link Encoding}") + var contentEncodingContainerFormat: String? = null, + + @kotlin.Deprecated("This is moved internally to {@link Encoding}") + var contentEncodingVideoCodec: String? = null, + + @SerializedName(value = "contentEpisodeTitle", alternate = ["title2", "episodeTitle"]) + var contentEpisodeTitle: String? = null, + + @SerializedName(value = "contentFps", alternate = ["fps"]) + var contentFps: Double? = null, + + @SerializedName(value = "contentGenre", alternate = ["genre"]) + var contentGenre: String? = null, + + @SerializedName(value = "contentGracenoteId", alternate = ["gracenoteId"]) + var contentGracenoteId: String? = null, + + @SerializedName(value = "contentId", alternate = ["id"]) + var contentId: String? = null, + + @SerializedName(value = "contentImdbId", alternate = ["imdbId"]) + var contentImdbId: String? = null, + + @SerializedName(value="contentIsLive", alternate=["isLive"]) + @JsonAdapter(IsLiveDeserializer::class) + var isLive: IsLive? = null, + + @kotlin.Deprecated("This is moved internally to {@link IsLive}") + var contentIsLiveNoSeek: Boolean? = null, + @kotlin.Deprecated("This is moved internally to {@link IsLive}") + var isDVR: Boolean? = null, //LEGACY - the opposite value from contentIsLiveNoSeek + + @SerializedName(value = "contentLanguage", alternate = ["language"]) + var contentLanguage: String? = null, + + @SerializedName(value = "contentMetaData", alternate = ["metadata"]) + var contentMetaData: Properties? = null, + + @SerializedName(value = "contentMetrics", alternate = ["metrics"]) + var contentMetrics: HashMap? = null, + + @SerializedName(value = "contentPackage", alternate = ["package"]) + var contentPackage: String? = null, + + @SerializedName(value = "contentPlaybackType", alternate = ["playbackType"]) + var contentPlaybackType: String? = null, + + @SerializedName(value = "contentPrice", alternate = ["price"]) + var contentPrice: String? = null, + + @SerializedName(value = "contentProgram", alternate = ["program"]) + var contentProgram: String? = null, + + @SerializedName(value = "contentRendition", alternate = ["rendition"]) + var contentRendition: String? = null, + + @SerializedName(value = "contentResource", alternate = ["resource"]) + var contentResource: String? = null, + + @SerializedName(value = "contentSaga", alternate = ["saga"]) + var contentSaga: String? = null, + + @SerializedName(value = "contentSeason", alternate = ["season"]) + var contentSeason: String? = null, + + @SerializedName(value = "contentStreamingProtocol", alternate = ["streamingProtocol"]) + var contentStreamingProtocol: String? = null, + + @SerializedName(value = "contentSubtitles", alternate = ["subtitles"]) + var contentSubtitles: String? = null, + + @SerializedName(value = "contentThroughput", alternate = ["throughput"]) + var contentThroughput: Long? = null, + + @SerializedName(value = "contentTitle", alternate = ["title"]) + var contentTitle: String? = null, + + @SerializedName(value = "contentTransactionCode", alternate = ["transactionType", "transactionCode"]) + var contentTransactionCode: String? = null, + + @SerializedName(value = "contentTotalBytes", alternate = ["totalBytes"]) + var contentTotalBytes: Long? = null, + + @SerializedName(value = "contentTransportFormat", alternate = ["transportFormat"]) + var contentTransportFormat: String? = null, + + @SerializedName(value = "contentSendTotalBytes", alternate = ["sendTotalBytes"]) + var contentSendTotalBytes: Boolean? = null, + + @SerializedName(value = "contentTvShow", alternate = ["tvShow"]) + var contentTvShow: String? = null, + + @SerializedName(value = "contentType", alternate = ["type"]) + var contentType: String? = null, + + @SerializedName(value = "customDimensions", alternate = ["customDimension"]) + var customDimensions: ContentCustomDimensions? = null + +) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/ContentCustomDimensions.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/ContentCustomDimensions.java deleted file mode 100644 index 54ffb51..0000000 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/ContentCustomDimensions.java +++ /dev/null @@ -1,206 +0,0 @@ -package com.kaltura.playkit.plugins.youbora.pluginconfig; - -import com.google.gson.annotations.SerializedName; - -public class ContentCustomDimensions { - @SerializedName(value="contentCustomDimension1", alternate={"param1"}) - private String contentCustomDimension1; - @SerializedName(value="contentCustomDimension2", alternate={"param2"}) - private String contentCustomDimension2; - @SerializedName(value="contentCustomDimension3", alternate={"param3"}) - private String contentCustomDimension3; - @SerializedName(value="contentCustomDimension4", alternate={"param4"}) - private String contentCustomDimension4; - @SerializedName(value="contentCustomDimension5", alternate={"param5"}) - private String contentCustomDimension5; - @SerializedName(value="contentCustomDimension6", alternate={"param6"}) - private String contentCustomDimension6; - @SerializedName(value="contentCustomDimension7", alternate={"param7"}) - private String contentCustomDimension7; - @SerializedName(value="contentCustomDimension8", alternate={"param8"}) - private String contentCustomDimension8; - @SerializedName(value="contentCustomDimension9", alternate={"param9"}) - private String contentCustomDimension9; - @SerializedName(value="contentCustomDimension10", alternate={"param10"}) - private String contentCustomDimension10; - @SerializedName(value="contentCustomDimension11", alternate={"param11"}) - private String contentCustomDimension11; - @SerializedName(value="contentCustomDimension12", alternate={"param12"}) - private String contentCustomDimension12; - @SerializedName(value="contentCustomDimension13", alternate={"param13"}) - private String contentCustomDimension13; - @SerializedName(value="contentCustomDimension14", alternate={"param14"}) - private String contentCustomDimension14; - @SerializedName(value="contentCustomDimension15", alternate={"param15"}) - private String contentCustomDimension15; - @SerializedName(value="contentCustomDimension16", alternate={"param16"}) - private String contentCustomDimension16; - @SerializedName(value="contentCustomDimension17", alternate={"param17"}) - private String contentCustomDimension17; - @SerializedName(value="contentCustomDimension18", alternate={"param18"}) - private String contentCustomDimension18; - @SerializedName(value="contentCustomDimension19", alternate={"param19"}) - private String contentCustomDimension19; - @SerializedName(value="contentCustomDimension20", alternate={"param20"}) - private String contentCustomDimension20; - - public String getContentCustomDimension1() { - return contentCustomDimension1; - } - - public void setContentCustomDimension1(String contentCustomDimension1) { - this.contentCustomDimension1 = contentCustomDimension1; - } - - public String getContentCustomDimension2() { - return contentCustomDimension2; - } - - public void setContentCustomDimension2(String contentCustomDimension2) { - this.contentCustomDimension2 = contentCustomDimension2; - } - - public String getContentCustomDimension3() { - return contentCustomDimension3; - } - - public void setContentCustomDimension3(String contentCustomDimension3) { - this.contentCustomDimension3 = contentCustomDimension3; - } - - public String getContentCustomDimension4() { - return contentCustomDimension4; - } - - public void setContentCustomDimension4(String contentCustomDimension4) { - this.contentCustomDimension4 = contentCustomDimension4; - } - - public String getContentCustomDimension5() { - return contentCustomDimension5; - } - - public void setContentCustomDimension5(String contentCustomDimension5) { - this.contentCustomDimension5 = contentCustomDimension5; - } - - public String getContentCustomDimension6() { - return contentCustomDimension6; - } - - public void setContentCustomDimension6(String contentCustomDimension6) { - this.contentCustomDimension6 = contentCustomDimension6; - } - - public String getContentCustomDimension7() { - return contentCustomDimension7; - } - - public void setContentCustomDimension7(String contentCustomDimension7) { - this.contentCustomDimension7 = contentCustomDimension7; - } - - public String getContentCustomDimension8() { - return contentCustomDimension8; - } - - public void setContentCustomDimension8(String contentCustomDimension8) { - this.contentCustomDimension8 = contentCustomDimension8; - } - - public String getContentCustomDimension9() { - return contentCustomDimension9; - } - - public void setContentCustomDimension9(String contentCustomDimension9) { - this.contentCustomDimension9 = contentCustomDimension9; - } - - public String getContentCustomDimension10() { - return contentCustomDimension10; - } - - public void setContentCustomDimension10(String contentCustomDimension10) { - this.contentCustomDimension10 = contentCustomDimension10; - } - - public String getContentCustomDimension11() { - return contentCustomDimension11; - } - - public void setContentCustomDimension11(String contentCustomDimension11) { - this.contentCustomDimension11 = contentCustomDimension11; - } - - public String getContentCustomDimension12() { - return contentCustomDimension12; - } - - public void setContentCustomDimension12(String contentCustomDimension12) { - this.contentCustomDimension12 = contentCustomDimension12; - } - - public String getContentCustomDimension13() { - return contentCustomDimension13; - } - - public void setContentCustomDimension13(String contentCustomDimension13) { - this.contentCustomDimension13 = contentCustomDimension13; - } - - public String getContentCustomDimension14() { - return contentCustomDimension14; - } - - public void setContentCustomDimension14(String contentCustomDimension14) { - this.contentCustomDimension14 = contentCustomDimension14; - } - - public String getContentCustomDimension15() { - return contentCustomDimension15; - } - - public void setContentCustomDimension15(String contentCustomDimension15) { - this.contentCustomDimension15 = contentCustomDimension15; - } - - public String getContentCustomDimension16() { - return contentCustomDimension16; - } - - public void setContentCustomDimension16(String contentCustomDimension16) { - this.contentCustomDimension16 = contentCustomDimension16; - } - - public String getContentCustomDimension17() { - return contentCustomDimension17; - } - - public void setContentCustomDimension17(String contentCustomDimension17) { - this.contentCustomDimension17 = contentCustomDimension17; - } - - public String getContentCustomDimension18() { - return contentCustomDimension18; - } - - public void setContentCustomDimension18(String contentCustomDimension18) { - this.contentCustomDimension18 = contentCustomDimension18; - } - - public String getContentCustomDimension19() { - return contentCustomDimension19; - } - - public void setContentCustomDimension19(String contentCustomDimension19) { - this.contentCustomDimension19 = contentCustomDimension19; - } - - public String getContentCustomDimension20() { - return contentCustomDimension20; - } - - public void setContentCustomDimension20(String contentCustomDimension20) { - this.contentCustomDimension20 = contentCustomDimension20; - } -} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/ContentCustomDimensions.kt b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/ContentCustomDimensions.kt new file mode 100644 index 0000000..52a00c1 --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/ContentCustomDimensions.kt @@ -0,0 +1,65 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig + +import com.google.gson.annotations.SerializedName + +data class ContentCustomDimensions ( + @SerializedName(value = "contentCustomDimension1", alternate = ["param1", "1"]) + var contentCustomDimension1: String? = null, + + @SerializedName(value = "contentCustomDimension2", alternate = ["param2", "2"]) + var contentCustomDimension2: String? = null, + + @SerializedName(value = "contentCustomDimension3", alternate = ["param3", "3"]) + var contentCustomDimension3: String? = null, + + @SerializedName(value = "contentCustomDimension4", alternate = ["param4", "4"]) + var contentCustomDimension4: String? = null, + + @SerializedName(value = "contentCustomDimension5", alternate = ["param5", "5"]) + var contentCustomDimension5: String? = null, + + @SerializedName(value = "contentCustomDimension6", alternate = ["param6", "6"]) + var contentCustomDimension6: String? = null, + + @SerializedName(value = "contentCustomDimension7", alternate = ["param7", "7"]) + var contentCustomDimension7: String? = null, + + @SerializedName(value = "contentCustomDimension8", alternate = ["param8", "8"]) + var contentCustomDimension8: String? = null, + + @SerializedName(value = "contentCustomDimension9", alternate = ["param9", "9"]) + var contentCustomDimension9: String? = null, + + @SerializedName(value = "contentCustomDimension10", alternate = ["param10", "10"]) + var contentCustomDimension10: String? = null, + + @SerializedName(value = "contentCustomDimension11", alternate = ["param11", "11"]) + var contentCustomDimension11: String? = null, + + @SerializedName(value = "contentCustomDimension12", alternate = ["param12", "12"]) + var contentCustomDimension12: String? = null, + + @SerializedName(value = "contentCustomDimension13", alternate = ["param13", "13"]) + var contentCustomDimension13: String? = null, + + @SerializedName(value = "contentCustomDimension14", alternate = ["param14", "14"]) + var contentCustomDimension14: String? = null, + + @SerializedName(value = "contentCustomDimension15", alternate = ["param15", "15"]) + var contentCustomDimension15: String? = null, + + @SerializedName(value = "contentCustomDimension16", alternate = ["param16", "16"]) + var contentCustomDimension16: String? = null, + + @SerializedName(value = "contentCustomDimension17", alternate = ["param17", "17"]) + var contentCustomDimension17: String? = null, + + @SerializedName(value = "contentCustomDimension18", alternate = ["param18", "18"]) + var contentCustomDimension18: String? = null, + + @SerializedName(value = "contentCustomDimension19", alternate = ["param19", "19"]) + var contentCustomDimension19: String? = null, + + @SerializedName(value = "contentCustomDimension20", alternate = ["param20", "20"]) + var contentCustomDimension20: String? = null +) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/CustomDeserializer.kt b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/CustomDeserializer.kt new file mode 100644 index 0000000..0e59146 --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/CustomDeserializer.kt @@ -0,0 +1,81 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig + +import com.google.gson.JsonDeserializationContext +import com.google.gson.JsonDeserializer +import com.google.gson.JsonElement +import java.lang.reflect.Type + +class IsLiveDeserializer: JsonDeserializer { + + override fun deserialize( + json: JsonElement?, + typeOfT: Type?, + context: JsonDeserializationContext? + ): IsLive? { + json?.let { + if (it.isJsonPrimitive) { + return try { + val isLive = it.asBoolean + IsLive(isLive, null, null) + } catch (exception: Exception) { + null + } + } + + if (it.isJsonObject) { + return context?.deserialize(it, IsLive::class.java) as IsLive + } + } + return null + } +} + +class CdnNodeDeserializer: JsonDeserializer { + + override fun deserialize( + json: JsonElement?, + typeOfT: Type?, + context: JsonDeserializationContext? + ): CdnNode? { + json?.let { + if (it.isJsonPrimitive) { + return try { + val parseCdnNode = it.asBoolean + CdnNode(parseCdnNode, null) + } catch (exception: Exception) { + null + } + } + + if (it.isJsonObject) { + return context?.deserialize(it, CdnNode::class.java) as CdnNode + } + } + return null + } +} + +class ParseManifestDeserializer: JsonDeserializer { + + override fun deserialize( + json: JsonElement?, + typeOfT: Type?, + context: JsonDeserializationContext? + ): Manifest? { + json?.let { + if (it.isJsonPrimitive) { + return try { + val parseManifest = it.asBoolean + Manifest(parseManifest, null) + } catch (exception: Exception) { + null + } + } + + if (it.isJsonObject) { + return context?.deserialize(it, Manifest::class.java) as Manifest + } + } + return null + } +} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.kt similarity index 75% rename from youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.java rename to youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.kt index 9aa1471..f684fb7 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.kt @@ -1,113 +1,40 @@ -package com.kaltura.playkit.plugins.youbora.pluginconfig; +package com.kaltura.playkit.plugins.youbora.pluginconfig -import com.google.gson.annotations.SerializedName; +import com.google.gson.annotations.SerializedName -public class Device { - -//If device info config is not given Youbora will add this info according to their internal logic so actually this is optional configuration - - -// Youbora's device code. If specified it will rewrite info gotten from user agent. -// See a list of codes in http://mapi.youbora.com:8081/devices -// youboraOptions.setDeviceCode("xbox360"); // Device will be detected as Xbox 360 - -//// Or in case you want full customised information of the device: -// -//youboraOptions.setDeviceModel("s8"); -//youboraOptions.setDeviceBrand("samsung"); -//youboraOptions.setDeviceType("smartphone"); -//youboraOptions.setDeviceOsName("android"); -//youboraOptions.setDeviceOsVersion("8.1"); - - @SerializedName(value="deviceBrand", alternate={"brand"}) - private String deviceBrand; - private String deviceCode; - @SerializedName(value="deviceId", alternate={"id"}) - private String deviceId; - @SerializedName(value="deviceEdId", alternate={"edid"}) - private String deviceEdId; - @SerializedName(value="deviceModel", alternate={"model"}) - private String deviceModel; - @SerializedName(value="deviceOsName", alternate={"osName"}) - private String deviceOsName; - @SerializedName(value="deviceOsVersion", alternate={"osVersion"}) - private String deviceOsVersion; - @SerializedName(value="deviceType", alternate={"type"}) - private String deviceType; - private boolean deviceIsAnonymous; - - public String getDeviceBrand() { - return deviceBrand; - } - - public void setDeviceBrand(String deviceBrand) { - this.deviceBrand = deviceBrand; - } - - public String getDeviceCode() { - return deviceCode; - } - - public void setDeviceCode(String deviceCode) { - this.deviceCode = deviceCode; - } - - public String getDeviceId() { - return deviceId; - } - - public void setDeviceId(String deviceId) { - this.deviceId = deviceId; - } - - public String getDeviceEdId() { - return deviceEdId; - } - - public void setDeviceEdId(String deviceEdId) { - this.deviceEdId = deviceEdId; - } - - public String getDeviceModel() { - return deviceModel; - } - - public void setDeviceModel(String deviceModel) { - this.deviceModel = deviceModel; - } - - public String getDeviceOsName() { - return deviceOsName; - } - - public void setDeviceOsName(String deviceOsName) { - this.deviceOsName = deviceOsName; - } - - public String getDeviceOsVersion() { - return deviceOsVersion; - } - - public void setDeviceOsVersion(String deviceOsVersion) { - this.deviceOsVersion = deviceOsVersion; - } - - public String getDeviceType() { - return deviceType; - } - - public void setDeviceType(String deviceType) { - this.deviceType = deviceType; - } - - public boolean getDeviceIsAnonymous() { - return deviceIsAnonymous; - } - - public void setDeviceIsAnonymous(boolean deviceIsAnonymous) { - this.deviceIsAnonymous = deviceIsAnonymous; - } -} +/** + * If device info config is not given Youbora will add this info according to their internal logic so actually this is optional configuration + * Youbora device code. If specified it will rewrite info gotten from user agent. + * See a list of codes in http://mapi.youbora.com:8081/devices + * + * youboraOptions.setDeviceCode("xbox360"); //Device will be detected as Xbox 360 + * Or in case you want full customised information of the device: + * youboraOptions.setDeviceModel("s8"); + * youboraOptions.setDeviceBrand("samsung"); + * youboraOptions.setDeviceType("smartphone"); + * youboraOptions.setDeviceOsName("android"); + * youboraOptions.setDeviceOsVersion("8.1"); + */ +data class Device( + @SerializedName(value = "deviceBrand", alternate = ["brand"]) + var deviceBrand: String? = null, + @SerializedName(value = "deviceCode", alternate = ["code"]) + var deviceCode: String? = null, + @SerializedName(value = "deviceId", alternate = ["id"]) + var deviceId: String? = null, + @SerializedName(value = "deviceEdId", alternate = ["edid", "EDID"]) + var deviceEdId: String? = null, + @SerializedName(value = "deviceModel", alternate = ["model"]) + var deviceModel: String? = null, + @SerializedName(value = "deviceOsName", alternate = ["osName"]) + var deviceOsName: String? = null, + @SerializedName(value = "deviceOsVersion", alternate = ["osVersion"]) + var deviceOsVersion: String? = null, + @SerializedName(value = "deviceType", alternate = ["type"]) + var deviceType: String? = null, + @SerializedName(value = "deviceIsAnonymous", alternate = ["isAnonymous"]) + var deviceIsAnonymous: Boolean? = false +) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Encoding.kt b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Encoding.kt new file mode 100644 index 0000000..3fd4f19 --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Encoding.kt @@ -0,0 +1,14 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig + +import com.google.gson.annotations.SerializedName + +data class Encoding( + var audioCodec: String? = null, + var codecProfile: String? = null, + + @SerializedName(value = "contentEncodingCodecSettings", alternate = ["codecSettings"]) + var codecSettings: HashMap? = null, + + var containerFormat: String? = null, + var videoCodec: String? = null, +) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Errors.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Errors.java index 3bf59a9..467bd4a 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Errors.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Errors.java @@ -1,9 +1,16 @@ package com.kaltura.playkit.plugins.youbora.pluginconfig; +import com.google.gson.annotations.SerializedName; + public class Errors { + @SerializedName(value="errorsIgnore", alternate={"ignore"}) private String[] errorsIgnore; + + @SerializedName(value="errorsFatal", alternate={"fatal"}) private String[] errorsFatal; + + @SerializedName(value="errorsNonFatal", alternate={"nonFatal"}) private String[] errorsNonFatal; public String[] getErrorsIgnore() { diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/IsLive.kt b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/IsLive.kt new file mode 100644 index 0000000..4ae5ff8 --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/IsLive.kt @@ -0,0 +1,6 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig + +data class IsLive(var isLiveContent: Boolean? = null, + var noSeek: Boolean? = null, + var noMonitor: Boolean? = null +) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Manifest.kt b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Manifest.kt new file mode 100644 index 0000000..4fbb1b8 --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Manifest.kt @@ -0,0 +1,25 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig + +import android.os.Bundle +import com.google.gson.annotations.SerializedName + +data class Manifest( + /** + * If true all "content" parsers will be used, HLS or DASH and location. + * the plugin will parse the resource trying to find out the real given resource + * instead of the API url. + * If parsing HLS the plugin will parse files to use the first .ts file found as resource. + * If parsing DASH parseManifestAuth the plugin will parse files as a resource. + * Default: false. + */ + @SerializedName(value = "parseManifest", alternate = ["manifest"]) + var parseManifest: Boolean? = null, + + /** + * + * If [parseManifest] enabled, it adds extra headers [Bundle] to the request of the content. + * Use this if for example, the player needs to include authentication headers to request the content, + * so the plugin needs it to access to the manifest files too. + */ + @SerializedName(value = "parseManifestAuth", alternate = ["auth"]) + var parseManifestAuth: HashMap? = null) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Network.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Network.java deleted file mode 100644 index 6d8f131..0000000 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Network.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.kaltura.playkit.plugins.youbora.pluginconfig; - -public class Network { - /** - * See a list of codes in - * http://mapi.youbora.com:8081/connectionTypes. - */ - private String networkConnectionType; - - /** - * IP of the viewer/user, e.g. "48.15.16.23". - */ - private String networkIP; - - /** - * Name of the internet service provider of the viewer/user. - */ - private String networkIsp; - - - public String getNetworkConnectionType() { - return networkConnectionType; - } - - public void setNetworkConnectionType(String networkConnectionType) { - this.networkConnectionType = networkConnectionType; - } - - public String getNetworkIP() { - return networkIP; - } - - public void setNetworkIP(String networkIP) { - this.networkIP = networkIP; - } - - public String getNetworkIsp() { - return networkIsp; - } - - public void setNetworkIsp(String networkIsp) { - this.networkIsp = networkIsp; - } -} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Network.kt b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Network.kt new file mode 100644 index 0000000..9546f1a --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Network.kt @@ -0,0 +1,21 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig + +import com.google.gson.annotations.SerializedName + +data class Network(/** + * See a list of codes in + * http://mapi.youbora.com:8081/connectionTypes. + */ + @SerializedName(value = "networkConnectionType", alternate = ["connectionType"]) + var networkConnectionType: String? = null, + /** + * IP of the viewer/user, e.g. "48.15.16.23". + */ + @SerializedName(value = "networkIP", alternate = ["ip"]) + var networkIP: String? = null, + /** + * Name of the internet service provider of the viewer/user. + */ + @SerializedName(value = "networkIsp", alternate = ["isp"]) + var networkIsp: String? = null +) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Parse.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Parse.java deleted file mode 100644 index 6e65eea..0000000 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Parse.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.kaltura.playkit.plugins.youbora.pluginconfig; - -import java.util.ArrayList; - -public class Parse { - - private Boolean parseManifest; - private Boolean parseCdnNode; - private Boolean parseCdnSwitchHeader; - private ArrayList parseCdnNodeList; - private String parseCdnNameHeader; - private Integer parseCdnTTL; - - public Boolean getParseManifest() { - return parseManifest; - } - - public void setParseManifest(Boolean parseManifest) { - this.parseManifest = parseManifest; - } - - public Boolean getParseCdnNode() { - return parseCdnNode; - } - - public void setParseCdnNode(Boolean parseCdnNode) { - this.parseCdnNode = parseCdnNode; - } - - public Boolean getParseCdnSwitchHeader() { - return parseCdnSwitchHeader; - } - - public void setParseCdnSwitchHeader(Boolean parseCdnSwitchHeader) { - this.parseCdnSwitchHeader = parseCdnSwitchHeader; - } - - public ArrayList getParseCdnNodeList() { - return parseCdnNodeList; - } - - public void setParseCdnNodeList(ArrayList parseCdnNodeList) { - this.parseCdnNodeList = parseCdnNodeList; - } - - public String getParseCdnNameHeader() { - return parseCdnNameHeader; - } - - public void setParseCdnNameHeader(String parseCdnNameHeader) { - this.parseCdnNameHeader = parseCdnNameHeader; - } - - public Integer getParseCdnTTL() { - return parseCdnTTL; - } - - public void setParseCdnTTL(Integer parseCdnTTL) { - this.parseCdnTTL = parseCdnTTL; - } -} diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Parse.kt b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Parse.kt new file mode 100644 index 0000000..d9c3583 --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Parse.kt @@ -0,0 +1,31 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig + +import com.google.gson.annotations.JsonAdapter +import com.google.gson.annotations.SerializedName + +data class Parse( + + @SerializedName(value = "parseManifest", alternate = ["manifest"]) + @JsonAdapter(ParseManifestDeserializer::class) + var parseManifest: Manifest? = null, + + @SerializedName(value = "parseCdnSwitchHeader", alternate = ["cdnSwitchHeader"]) + var parseCdnSwitchHeader: Boolean? = null, + + @SerializedName(value = "parseCdnNode", alternate = ["cdnNode"]) + @JsonAdapter(CdnNodeDeserializer::class) + var parseCdnNode: CdnNode? = null, // This is different in iOS + + @kotlin.Deprecated("Use {@link CdnNode} instead") + @SerializedName(value = "parseCdnNodeList", alternate = ["list"]) + var parseCdnNodeList: ArrayList? = null, + + @SerializedName(value = "parseCdnNameHeader", alternate = ["cdnNameHeader"]) + var parseCdnNameHeader: String? = null, + + @SerializedName(value = "parseNodeHeader", alternate = ["cdnNodeHeader"]) + var parseNodeHeader: String? = null, + + @SerializedName(value = "parseCdnTTL", alternate = ["cdnTTL"]) + var parseCdnTTL: Int? = null) + diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Session.kt b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Session.kt new file mode 100644 index 0000000..9044e66 --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Session.kt @@ -0,0 +1,7 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig + +import com.google.gson.annotations.SerializedName + +data class Session( + @SerializedName(value = "sessionMetrics", alternate = ["metrics"]) + var sessionMetrics: HashMap? = null) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/User.kt b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/User.kt new file mode 100644 index 0000000..4065984 --- /dev/null +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/User.kt @@ -0,0 +1,9 @@ +package com.kaltura.playkit.plugins.youbora.pluginconfig + +data class User ( + var anonymousId: String? = null, + var type: String? = null, + var email: String? = null, + var privacyProtocol: String? = null, + var obfuscateIp: Boolean? = false +) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index 9e07082..01fa306 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -3,12 +3,17 @@ import android.os.Bundle; import android.text.TextUtils; +import androidx.annotation.NonNull; +import androidx.annotation.Nullable; + +import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; import com.google.gson.annotations.SerializedName; import com.npaw.youbora.lib6.comm.transform.ViewTransform; import com.npaw.youbora.lib6.plugin.Options; +import java.util.ArrayList; import java.util.HashMap; import java.util.Map; @@ -34,60 +39,165 @@ public class YouboraConfig { private String accountCode; - private String username; + /** + * @deprecated This value is part of {@link App} + */ + @Deprecated + private String appName = ""; - private String userEmail; + /** + * @deprecated This value is part of {@link App} + */ + @Deprecated + private String appReleaseVersion = ""; - private String userAnonymousId; + /** + * Optional: auth token to validate all the requests. + */ + private String authToken; - private String userType; // any string - free / paid etc. + /** + * Optional: auth type. Used if authToken is set. + */ + private String authType; - private String houseHoldId; // which device is used to play + private String username; - private boolean userObfuscateIp; // Option to obfuscate the IP. + private String linkedViewId; - private boolean httpSecure = true; // youbora events will be sent via https + private String urlToParse; - private String appName = ""; + /** + * @deprecated This value is part of {@link User} + */ + @Deprecated + private String userPrivacyProtocol; // backward compatibility - private String appReleaseVersion = ""; + /** + * @deprecated This value is part of {@link User} + */ + @Deprecated + private String userEmail; // backward compatibility - private String urlToParse; + /** + * @deprecated This value is part of {@link User} + */ + @Deprecated + private String userAnonymousId; // backward compatibility - private String linkedViewId; + /** + * @deprecated This value is part of {@link User} + */ + @Deprecated + private String userType; // any string - free / paid etc. // backward compatibility + + /** + * @deprecated This value is part of {@link User} + */ + @Deprecated + private boolean userObfuscateIp; // Option to obfuscate the IP. // backward compatibility + + @SerializedName(value="houseHoldId", alternate={"householdId"}) + private String houseHoldId; // which device is used to play + + /** + * Host of the Fastdata service. + */ + private String host; - private boolean isAutoStart = true; + @SerializedName(value="isAutoStart", alternate={"autoStart"}) + private boolean isAutoStart = true; // backward compatible - private boolean isAutoDetectBackground = true; + @SerializedName(value="isAutoDetectBackground", alternate={"autoDetectBackground"}) + private boolean isAutoDetectBackground = true; // backward compatible + @SerializedName(value="isEnabled", alternate={"enabled"}) private boolean isEnabled = true; - private boolean isForceInit; + @SerializedName(value="isForceInit", alternate={"forceInit"}) + private boolean isForceInit; // backward compatible - private boolean isOffline; + @SerializedName(value="isOffline", alternate={"offline"}) + private boolean isOffline; // backward compatible - private App app; + /** + * Define the security of NQS calls. + * If `true` it will use "https://". + * If `false` it will use "http://". + * Default: `true`. + */ + private boolean httpSecure = true; // youbora events will be sent via https - private Parse parse; + /** + * Enabling this option enables the posibility of getting the /start request later on the view, + * making the flow go as follows: /init is sent when the player starts to load content, + * then when the playback starts /joinTime event will be sent, but with the difference of no + * /start request, instead it will be delayed until all the option keys from + * {@link #pendingMetadata} are not null, this is very important, since an empty string + * is considered a not null and therefore is a valid value. + */ + private boolean waitForMetadata; - private Device device; + /** + * Set option keys you want to wait for metadata, in order to work {@link #waitForMetadata} + * must be set to true. + * You need to create an {@link @ArrayList} with all the options you want to make the start + * be hold on. + * You can find all the keys with the following format: Options.KEY_{OPTION_NAME} where option + * name is the same one as the option itself. + * + * Find below an example: + * + * ArrayList optionsToWait = new ArrayList() + * optionsToWait.add(KEY_CONTENT_TITLE) + * optionsToWait.add(KEY_CONTENT_CUSTOM_DIMENSION_1) + * options.setPendingMetada(optionsToWait) + */ + private ArrayList pendingMetadata; - @SerializedName(value="content", alternate={"media"}) - private Content content; + private ViewTransform.FastDataConfig fastDataConfig; - private Network network; + @SerializedName(value="ads", alternate={"ad"}) + private Ads ads; // backward compatible + + private App app; // backward compatible private Errors errors; - private Ads ads; + /** + * Use user object to pass + * userEmail, userAnonymousId, userType, userObfuscateIp, userPrivacyProtocol + * If User object is passed along with that individually the values are also passed + * apart from User's object then User object will be prioritized + * + * Either pass User object or pass individual values (backward compatibility) + */ + private User user; + + private Network network; + + private Parse parse; + + private Session session; + @SerializedName(value="content", alternate={"media"}) + private Content content; + + private Device device; + + /** + * @deprecated This is moved internally to {@link Content} metadata and {@link Ads} metadata + */ + @Deprecated private Properties properties; - @SerializedName(value="contentCustomDimensions", alternate={"extraParams"}) + /** + * @deprecated This is moved internally to {@link Content} and {@link Ads} custom dimensions + */ + @Deprecated + @SerializedName(value="contentCustomDimensions", alternate={"extraParams", "customDimension", "customDimensions"}) private ContentCustomDimensions contentCustomDimensions; - private ViewTransform.FastDataConfig fastDataConfig; - public String getAccountCode() { return accountCode; } @@ -96,6 +206,32 @@ public void setAccountCode(String accountCode) { this.accountCode = accountCode; } + @Nullable + public String getHost() { + return host; + } + + public void setHost(String host) { + this.host = host; + } + + public String getAuthToken() { + return authToken; + } + + public void setAuthToken(String authToken) { + this.authToken = authToken; + } + + @Nullable + public String getAuthType() { + return authType; + } + + public void setAuthType(String authType) { + this.authType = authType; + } + public String getUsername() { return username; } @@ -104,26 +240,40 @@ public void setUsername(String username) { this.username = username; } + public User getUser() { + return user; + } + + public void setUser(User user) { + this.user = user; + } + + @Deprecated public String getUserEmail() { return userEmail; } + @Deprecated public void setUserEmail(String userEmail) { this.userEmail = userEmail; } + @Deprecated public String getUserAnonymousId() { return userAnonymousId; } + @Deprecated public void setUserAnonymousId(String userAnonymousId) { this.userAnonymousId = userAnonymousId; } + @Deprecated public String getUserType() { return userType; } + @Deprecated public void setUserType(String userType) { this.userType = userType; } @@ -136,18 +286,22 @@ public void setHttpSecure(boolean httpSecure) { this.httpSecure = httpSecure; } + @Deprecated public String getAppName() { return appName; } + @Deprecated public void setAppName(String appName) { this.appName = appName; } + @Deprecated public String getAppReleaseVersion() { return appReleaseVersion; } + @Deprecated public void setAppReleaseVersion(String appReleaseVersion) { this.appReleaseVersion = appReleaseVersion; } @@ -176,14 +330,26 @@ public void setHouseHoldId(String houseHoldId) { this.houseHoldId = houseHoldId; } + @Deprecated public boolean getUserObfuscateIp() { return userObfuscateIp; } + @Deprecated public void setUserObfuscateIp(boolean userObfuscateIp) { this.userObfuscateIp = userObfuscateIp; } + @Deprecated + public String getUserPrivacyProtocol() { + return userPrivacyProtocol; + } + + @Deprecated + public void setUserPrivacyProtocol(String userPrivacyProtocol) { + this.userPrivacyProtocol = userPrivacyProtocol; + } + public boolean getIsAutoStart() { return isAutoStart; } @@ -224,6 +390,30 @@ public void setIsOffline(boolean isOffline) { this.isOffline = isOffline; } + public boolean isWaitForMetadata() { + return waitForMetadata; + } + + public void setWaitForMetadata(boolean waitForMetadata) { + this.waitForMetadata = waitForMetadata; + } + + public ArrayList getPendingMetadata() { + return pendingMetadata; + } + + public void setPendingMetadata(ArrayList pendingMetadata) { + this.pendingMetadata = pendingMetadata; + } + + public Session getSession() { + return session; + } + + public void setSession(Session session) { + this.session = session; + } + public App getApp() { return app; } @@ -280,18 +470,22 @@ public void setAds(Ads ads) { this.ads = ads; } + @Deprecated public Properties getProperties() { return properties; } + @Deprecated public void setProperties(Properties properties) { this.properties = properties; } + @Deprecated public ContentCustomDimensions getContentCustomDimensions() { return contentCustomDimensions; } + @Deprecated public void setContentCustomDimensions(ContentCustomDimensions contentCustomDimensions) { this.contentCustomDimensions = contentCustomDimensions; } @@ -305,50 +499,127 @@ public void setFastDataConfig(ViewTransform.FastDataConfig fastDataConfig) { } public Options getYouboraOptions() { - Options youboraOptions = new Options(); - - youboraOptions.setAccountCode(accountCode); - youboraOptions.setUsername(username); - youboraOptions.setUserEmail(userEmail); - youboraOptions.setUserAnonymousId(userAnonymousId); - youboraOptions.setUserType(userType); - youboraOptions.setAppName(appName); - youboraOptions.setAppReleaseVersion(appReleaseVersion); - youboraOptions.setUrlToParse(urlToParse); - youboraOptions.setLinkedViewId(linkedViewId); - youboraOptions.setUserObfuscateIp(userObfuscateIp); + Options youboraOptions = new Options(); + + if (!TextUtils.isEmpty(accountCode)) { + youboraOptions.setAccountCode(accountCode); + } + + if (!TextUtils.isEmpty(host)) { + youboraOptions.setHost(host); + } + + if (!TextUtils.isEmpty(authToken)) { + youboraOptions.setAuthToken(authToken); + } + + if (!TextUtils.isEmpty(authType)) { + youboraOptions.setAuthType(authType); + } + + if (!TextUtils.isEmpty(username)) { + youboraOptions.setUsername(username); + } + + if (user != null) { + if (!TextUtils.isEmpty(user.getEmail())) { + youboraOptions.setUserEmail(user.getEmail()); + } + if (!TextUtils.isEmpty(user.getAnonymousId())) { + youboraOptions.setUserAnonymousId(user.getAnonymousId()); + } + if (!TextUtils.isEmpty(user.getType())) { + youboraOptions.setUserEmail(user.getType()); + } + + youboraOptions.setUserObfuscateIp(user.getObfuscateIp()); + + if (!TextUtils.isEmpty(user.getPrivacyProtocol())) { + youboraOptions.setUserPrivacyProtocol(user.getPrivacyProtocol()); + } + } else { + if (!TextUtils.isEmpty(getUserEmail())) { + youboraOptions.setUserEmail(getUserEmail()); + } + if (!TextUtils.isEmpty(getUserAnonymousId())) { + youboraOptions.setUserAnonymousId(getUserAnonymousId()); + } + if (!TextUtils.isEmpty(getUserType())) { + youboraOptions.setUserEmail(getUserType()); + } + + youboraOptions.setUserObfuscateIp(getUserObfuscateIp()); + + if (!TextUtils.isEmpty(getUserPrivacyProtocol())) { + youboraOptions.setUserPrivacyProtocol(getUserPrivacyProtocol()); + } + } + + if (app != null) { + if (!TextUtils.isEmpty(app.getAppName())) { + youboraOptions.setAppName(app.getAppName()); + } + if (!TextUtils.isEmpty(app.getAppReleaseVersion())) { + youboraOptions.setAppReleaseVersion(app.getAppReleaseVersion()); + } + } else { + if (!TextUtils.isEmpty(getAppName())) { + youboraOptions.setAppName(getAppName()); + } + if (!TextUtils.isEmpty(getAppReleaseVersion())) { + youboraOptions.setAppReleaseVersion(getAppReleaseVersion()); + } + } + + if (!TextUtils.isEmpty(urlToParse)) { + youboraOptions.setUrlToParse(urlToParse); + } + + if (!TextUtils.isEmpty(linkedViewId)) { + youboraOptions.setLinkedViewId(linkedViewId); + } + youboraOptions.setHttpSecure(httpSecure); youboraOptions.setAutoStart(isAutoStart); youboraOptions.setAutoDetectBackground(isAutoDetectBackground); youboraOptions.setEnabled(isEnabled); youboraOptions.setForceInit(isForceInit); youboraOptions.setOffline(isOffline); + youboraOptions.setWaitForMetadata(waitForMetadata); - if (app != null) { - if (app.getAppName() != null) { - youboraOptions.setAppName(app.getAppName()); - } - if (app.getAppReleaseVersion() != null) { - youboraOptions.setAppReleaseVersion(app.getAppReleaseVersion()); - } + if (pendingMetadata != null && !pendingMetadata.isEmpty()) { + youboraOptions.setPendingMetadata(pendingMetadata); } if (parse != null) { if (parse.getParseManifest() != null) { - youboraOptions.setParseManifest(parse.getParseManifest()); + if (parse.getParseManifest().getParseManifest() != null) { + youboraOptions.setParseManifest(parse.getParseManifest().getParseManifest()); + } + if (parse.getParseManifest().getParseManifestAuth() != null) { + youboraOptions.setParseManifestAuth(getBundleFromMap(parse.getParseManifest().getParseManifestAuth())); + } } + if (parse.getParseCdnNode() != null) { - youboraOptions.setParseCdnNode(parse.getParseCdnNode()); - } - if (parse.getParseCdnSwitchHeader() != null) { - youboraOptions.setParseCdnSwitchHeader(parse.getParseCdnSwitchHeader()); + if (parse.getParseCdnNode().getParseCdnNode() != null) { + youboraOptions.setParseCdnNode(parse.getParseCdnNode().getParseCdnNode()); + } + if (parse.getParseCdnNode().getParseCdnNodeList() != null) { + youboraOptions.setParseCdnNodeList(parse.getParseCdnNode().getParseCdnNodeList()); + } } - if (parse.getParseCdnNodeList() != null) { + + if (parse.getParseCdnNode() == null && parse.getParseCdnNodeList() != null && !parse.getParseCdnNodeList().isEmpty()) { youboraOptions.setParseCdnNodeList(parse.getParseCdnNodeList()); } + if (parse.getParseCdnNameHeader() != null) { youboraOptions.setParseCdnNameHeader(parse.getParseCdnNameHeader()); } + if (parse.getParseNodeHeader() != null) { + youboraOptions.setParseNodeHeader(parse.getParseNodeHeader()); + } if (parse.getParseCdnTTL() != null) { youboraOptions.setParseCdnTTL(parse.getParseCdnTTL()); } @@ -359,17 +630,13 @@ public Options getYouboraOptions() { //Generic Data by code see in Device class what Codes are available youboraOptions.setDeviceCode(device.getDeviceCode()); } - // Specific Data - if (device.getDeviceModel() != null) { - youboraOptions.setDeviceModel(device.getDeviceModel()); - } - if (device.getDeviceId() != null) { youboraOptions.setDeviceId(device.getDeviceId()); } - if (device.getDeviceEdId() != null) { - youboraOptions.setDeviceEDID(device.getDeviceEdId()); + // Specific Data + if (device.getDeviceModel() != null) { + youboraOptions.setDeviceModel(device.getDeviceModel()); } if (device.getDeviceBrand() != null) { @@ -388,10 +655,13 @@ public Options getYouboraOptions() { youboraOptions.setDeviceOsVersion(device.getDeviceOsVersion()); } - if (device.getDeviceType() != null) { - youboraOptions.setDeviceOsVersion(device.getDeviceOsVersion()); + if (device.getDeviceEdId() != null) { + youboraOptions.setDeviceEDID(device.getDeviceEdId()); + } + + if (device.getDeviceIsAnonymous() != null) { + youboraOptions.setDeviceIsAnonymous(device.getDeviceIsAnonymous()); } - youboraOptions.setDeviceIsAnonymous(device.getDeviceIsAnonymous()); } if (content != null) { @@ -422,18 +692,6 @@ public Options getYouboraOptions() { if (content.getContentDuration() != null) { youboraOptions.setContentDuration(content.getContentDuration()); } - if (content.getContentEncodingAudioCodec() != null) { - youboraOptions.setContentEncodingAudioCodec(content.getContentEncodingAudioCodec()); - } - if (content.getContentEncodingCodecProfile() != null) { - youboraOptions.setContentEncodingCodecProfile(content.getContentEncodingCodecProfile()); - } - if (content.getContentEncodingContainerFormat() != null) { - youboraOptions.setContentEncodingContainerFormat(content.getContentEncodingContainerFormat()); - } - if (content.getContentEncodingVideoCodec() != null) { - youboraOptions.setContentEncodingVideoCodec(content.getContentEncodingVideoCodec()); - } if (content.getContentEpisodeTitle() != null) { youboraOptions.setContentEpisodeTitle(content.getContentEpisodeTitle()); } @@ -452,13 +710,25 @@ public Options getYouboraOptions() { if (content.getContentImdbId() != null) { youboraOptions.setContentImdbId(content.getContentImdbId()); } - if (content.getContentIsLive() != null) { - youboraOptions.setContentIsLive(content.getContentIsLive()); + + if (content.isLive() != null) { + if (content.isLive().isLiveContent() != null) { + youboraOptions.setContentIsLive(content.isLive().isLiveContent()); + } + if (content.isLive().getNoSeek() != null) { + youboraOptions.setContentIsLiveNoSeek(content.isLive().getNoSeek()); + } else if (content.isDVR() != null) { + youboraOptions.setContentIsLiveNoSeek(!content.isDVR()); + } + if (content.isLive().getNoMonitor() != null) { + youboraOptions.setContentIsLiveNoMonitor(content.isLive().getNoMonitor()); + } } - if (content.getContentIsLiveNoSeek() != null) { + + if (content.isLive() == null && content.isLive().getNoSeek() == null && content.getContentIsLiveNoSeek() != null) { youboraOptions.setContentIsLiveNoSeek(content.getContentIsLiveNoSeek()); - } else if (content.getIsDVR() != null) { - youboraOptions.setContentIsLiveNoSeek(!content.getIsDVR()); + } else if (content.isDVR() != null) { + youboraOptions.setContentIsLiveNoSeek(!content.isDVR()); } if (content.getContentLanguage() != null) { @@ -509,22 +779,67 @@ public Options getYouboraOptions() { if (content.getContentTotalBytes() != null) { youboraOptions.setContentTotalBytes(content.getContentTotalBytes()); } - youboraOptions.setContentSendTotalBytes(content.getContentSendTotalBytes()); + if (content.getContentSendTotalBytes() != null) { + youboraOptions.setContentSendTotalBytes(content.getContentSendTotalBytes()); + } if (content.getContentTvShow() != null) { youboraOptions.setContentTvShow(content.getContentTvShow()); } if (content.getContentType() != null) { youboraOptions.setContentType(content.getContentType()); } + if (content.getContentMetaData() != null) { + youboraOptions.setContentMetadata(getContentMetaDataBundle(content.getContentMetaData())); + } + if (content.getContentMetrics() != null) { + youboraOptions.setContentMetrics(getBundleFromMap(content.getContentMetrics())); + } + if (content.getContentEncoding() != null) { + if (content.getContentEncoding().getAudioCodec() != null) { + youboraOptions.setContentEncodingAudioCodec(content.getContentEncoding().getAudioCodec()); + } + if (content.getContentEncoding().getCodecProfile() != null) { + youboraOptions.setContentEncodingCodecProfile(content.getContentEncoding().getCodecProfile()); + } + if (content.getContentEncoding().getContainerFormat() != null) { + youboraOptions.setContentEncodingContainerFormat(content.getContentEncoding().getContainerFormat()); + } + if (content.getContentEncoding().getVideoCodec() != null) { + youboraOptions.setContentEncodingVideoCodec(content.getContentEncoding().getVideoCodec()); + } + if (content.getContentEncoding().getCodecSettings() != null) { + youboraOptions.setContentEncodingCodecSettings(getBundleFromMap(content.getContentEncoding().getCodecSettings())); + } + } else { + if (content.getContentEncodingAudioCodec() != null) { + youboraOptions.setContentEncodingAudioCodec(content.getContentEncodingAudioCodec()); + } + if (content.getContentEncodingCodecProfile() != null) { + youboraOptions.setContentEncodingCodecProfile(content.getContentEncodingCodecProfile()); + } + if (content.getContentEncodingContainerFormat() != null) { + youboraOptions.setContentEncodingContainerFormat(content.getContentEncodingContainerFormat()); + } + if (content.getContentEncodingVideoCodec() != null) { + youboraOptions.setContentEncodingVideoCodec(content.getContentEncodingVideoCodec()); + } + } + if (content.getCustomDimensions() != null) { + populateContentCustomDimensions(youboraOptions, content.getCustomDimensions()); + } } - setLegacyContentPropertiesBundle(youboraOptions); - - youboraOptions.setContentMetadata(getContentMetaDataBundle()); + // Backward compatibility if app passes the custom dimension on top level instead of content + if ((content == null || content.getCustomDimensions() == null) && getContentCustomDimensions() != null) { + populateContentCustomDimensions(youboraOptions, getContentCustomDimensions()); + } - //youboraOptions.setContentMetrics(getContentMetricsBundle()); - //youboraOptions.setContentEncodingCodecSettings(getContentEncodingCodecSettingsBundle()); + setLegacyContentPropertiesBundle(youboraOptions); + // Backward compatibility if app passes the metadata Properties on top level instead of content and Ads + if ((content == null || content.getContentMetaData() == null) && getProperties() != null) { + youboraOptions.setContentMetadata(getContentMetaDataBundle(getProperties())); + } if (network != null) { if (network.getNetworkConnectionType() != null) { @@ -554,10 +869,12 @@ public Options getYouboraOptions() { if (ads.getAdBreaksTime() != null) { youboraOptions.setAdBreaksTime(ads.getAdBreaksTime()); } - youboraOptions.setAdCampaign(ads.getAdCampaign()); - youboraOptions.setAdCreativeId(ads.getAdCreativeId()); - - + if (ads.getAdCampaign() != null) { + youboraOptions.setAdCampaign(ads.getAdCampaign()); + } + if (ads.getAdCreativeId() != null) { + youboraOptions.setAdCreativeId(ads.getAdCreativeId()); + } if (ads.getAdExpectedBreaks() != null) { youboraOptions.setAdExpectedBreaks(ads.getAdExpectedBreaks()); } @@ -567,11 +884,15 @@ public Options getYouboraOptions() { if (ads.getAdGivenBreaks() != null) { youboraOptions.setAdGivenBreaks(ads.getAdGivenBreaks()); } - - youboraOptions.setAdProvider(ads.getAdProvider()); - youboraOptions.setAdResource(ads.getAdResource()); - youboraOptions.setAdTitle(ads.getAdTitle()); - + if (ads.getAdProvider() != null) { + youboraOptions.setAdProvider(ads.getAdProvider()); + } + if (ads.getAdResource() != null) { + youboraOptions.setAdResource(ads.getAdResource()); + } + if (ads.getAdTitle() != null) { + youboraOptions.setAdTitle(ads.getAdTitle()); + } if (ads.getAdCustomDimensions() != null) { youboraOptions.setAdCustomDimension1(ads.getAdCustomDimensions().getAdCustomDimension1()); youboraOptions.setAdCustomDimension2(ads.getAdCustomDimensions().getAdCustomDimension2()); @@ -585,36 +906,52 @@ public Options getYouboraOptions() { youboraOptions.setAdCustomDimension10(ads.getAdCustomDimensions().getAdCustomDimension10()); } - //UNSUPPORTED YET - //youboraOptions.setAdMetadata(getAdMetaDataBundle()); - //youboraOptions.setAdExpectedPattern(getAdExpectedPatternBundle()); + if (ads.getMetadata() != null) { + youboraOptions.setAdMetadata(getAdMetaDataBundle(ads.getMetadata())); + } + if (ads.getExpectedPattern() != null) { + youboraOptions.setAdExpectedPattern(getAdExpectedPatternBundle(ads.getExpectedPattern())); + } + if (ads.getBlockerDetected() != null) { + youboraOptions.setAdBlockerDetected(ads.getBlockerDetected()); + } + if (ads.getAfterStop() != null) { + youboraOptions.setAdsAfterStop(ads.getAfterStop()); + } } - if (contentCustomDimensions != null) { - youboraOptions.setContentCustomDimension1(contentCustomDimensions.getContentCustomDimension1()); - youboraOptions.setContentCustomDimension2(contentCustomDimensions.getContentCustomDimension2()); - youboraOptions.setContentCustomDimension3(contentCustomDimensions.getContentCustomDimension3()); - youboraOptions.setContentCustomDimension4(contentCustomDimensions.getContentCustomDimension4()); - youboraOptions.setContentCustomDimension5(contentCustomDimensions.getContentCustomDimension5()); - youboraOptions.setContentCustomDimension6(contentCustomDimensions.getContentCustomDimension6()); - youboraOptions.setContentCustomDimension7(contentCustomDimensions.getContentCustomDimension7()); - youboraOptions.setContentCustomDimension8(contentCustomDimensions.getContentCustomDimension8()); - youboraOptions.setContentCustomDimension9(contentCustomDimensions.getContentCustomDimension9()); - youboraOptions.setContentCustomDimension10(contentCustomDimensions.getContentCustomDimension10()); - youboraOptions.setContentCustomDimension11(contentCustomDimensions.getContentCustomDimension11()); - youboraOptions.setContentCustomDimension12(contentCustomDimensions.getContentCustomDimension12()); - youboraOptions.setContentCustomDimension13(contentCustomDimensions.getContentCustomDimension13()); - youboraOptions.setContentCustomDimension14(contentCustomDimensions.getContentCustomDimension14()); - youboraOptions.setContentCustomDimension15(contentCustomDimensions.getContentCustomDimension15()); - youboraOptions.setContentCustomDimension16(contentCustomDimensions.getContentCustomDimension16()); - youboraOptions.setContentCustomDimension17(contentCustomDimensions.getContentCustomDimension17()); - youboraOptions.setContentCustomDimension18(contentCustomDimensions.getContentCustomDimension18()); - youboraOptions.setContentCustomDimension19(contentCustomDimensions.getContentCustomDimension19()); - youboraOptions.setContentCustomDimension20(contentCustomDimensions.getContentCustomDimension20()); + if (session != null && session.getSessionMetrics() != null && !session.getSessionMetrics().isEmpty()) { + youboraOptions.setSessionMetrics(getBundleFromMap(session.getSessionMetrics())); } + return youboraOptions; } + private void populateContentCustomDimensions(Options youboraOptions, ContentCustomDimensions customDimensions) { + if (customDimensions != null) { + youboraOptions.setContentCustomDimension1(customDimensions.getContentCustomDimension1()); + youboraOptions.setContentCustomDimension2(customDimensions.getContentCustomDimension2()); + youboraOptions.setContentCustomDimension3(customDimensions.getContentCustomDimension3()); + youboraOptions.setContentCustomDimension4(customDimensions.getContentCustomDimension4()); + youboraOptions.setContentCustomDimension5(customDimensions.getContentCustomDimension5()); + youboraOptions.setContentCustomDimension6(customDimensions.getContentCustomDimension6()); + youboraOptions.setContentCustomDimension7(customDimensions.getContentCustomDimension7()); + youboraOptions.setContentCustomDimension8(customDimensions.getContentCustomDimension8()); + youboraOptions.setContentCustomDimension9(customDimensions.getContentCustomDimension9()); + youboraOptions.setContentCustomDimension10(customDimensions.getContentCustomDimension10()); + youboraOptions.setContentCustomDimension11(customDimensions.getContentCustomDimension11()); + youboraOptions.setContentCustomDimension12(customDimensions.getContentCustomDimension12()); + youboraOptions.setContentCustomDimension13(customDimensions.getContentCustomDimension13()); + youboraOptions.setContentCustomDimension14(customDimensions.getContentCustomDimension14()); + youboraOptions.setContentCustomDimension15(customDimensions.getContentCustomDimension15()); + youboraOptions.setContentCustomDimension16(customDimensions.getContentCustomDimension16()); + youboraOptions.setContentCustomDimension17(customDimensions.getContentCustomDimension17()); + youboraOptions.setContentCustomDimension18(customDimensions.getContentCustomDimension18()); + youboraOptions.setContentCustomDimension19(customDimensions.getContentCustomDimension19()); + youboraOptions.setContentCustomDimension20(customDimensions.getContentCustomDimension20()); + } + } + private void setLegacyContentPropertiesBundle(Options youboraOptions) { Properties prop = getProperties(); if (prop == null) { @@ -696,18 +1033,37 @@ private void setLegacyContentPropertiesBundle(Options youboraOptions) { } } + /** + * Returns a bundle from a HashMap + * @param map incoming HashMap + * @return Bundle + */ + @NonNull + private Bundle getBundleFromMap(HashMap map) { + Bundle bundle = new Bundle(); + if (map == null || map.isEmpty()) { + return bundle; + } + + for (Map.Entry entry : map.entrySet()) { + bundle.putString(entry.getKey(), entry.getValue()); + } + + return bundle; + } + /** * Containing mixed extra information about the content like: director, * parental rating, device info or the audio channels. * @return bundle having properties */ - private Bundle getContentMetaDataBundle() { - Properties prop = getProperties(); + @NonNull + private Bundle getContentMetaDataBundle(Properties prop) { + Bundle propertiesBundle = new Bundle(); if (prop == null) { - return new Bundle(); + return propertiesBundle; } - Bundle propertiesBundle = new Bundle(); if (prop.getDirector() != null) { propertiesBundle.putString("director", prop.getDirector()); } @@ -739,81 +1095,106 @@ private Bundle getContentMetaDataBundle() { return propertiesBundle; } - private Bundle getContentMetricsBundle() { - return new Bundle(); - } - - private Bundle getContentEncodingCodecSettingsBundle() { - return new Bundle(); - } - - private Bundle getAdMetaDataBundle() { - return new Bundle(); -// AdProperties prop = getAdProperties(); -// if (prop == null) { -// return new Bundle(); -// } -// -// Bundle propertiesBundle = new Bundle(); -// if (prop.getDirector() != null) { -// propertiesBundle.putString("director", prop.getDirector()); -// } -// if (prop.getParental() != null) { -// propertiesBundle.putString("parental", prop.getParental()); -// } -// if (prop.getParental() != null) { -// propertiesBundle.putString("audioType", prop.getAudioType()); -// } -// if (prop.getAudioChannels() != null) { -// propertiesBundle.putString("audioChannels", prop.getAudioChannels()); -// } -// if (prop.getDevice() != null) { -// propertiesBundle.putString("device", prop.getDevice()); -// } -// if (prop.getRating() != null) { -// propertiesBundle.putString("rating", prop.getRating()); -// } -// if (prop.getYear() != null) { -// propertiesBundle.putString("year", prop.getYear()); -// } -// if (prop.getCast() != null) { -// propertiesBundle.putString("cast", prop.getCast()); -// } -// if (prop.getOwner() != null) { -// propertiesBundle.putString("owner", prop.getOwner()); -// } -// -// -// return propertiesBundle; - } - - private Bundle getAdExpectedPatternBundle() { - return new Bundle(); + /** + * Containing mixed extra information about the Ads like: director, + * parental rating, device info or the audio channels. + * @return bundle having properties + */ + @NonNull + private Bundle getAdMetaDataBundle(Properties prop) { + Bundle propertiesBundle = new Bundle(); + if (prop == null) { + return propertiesBundle; + } + + if (prop.getDirector() != null) { + propertiesBundle.putString("director", prop.getDirector()); + } + if (prop.getParental() != null) { + propertiesBundle.putString("parental", prop.getParental()); + } + if (prop.getParental() != null) { + propertiesBundle.putString("audioType", prop.getAudioType()); + } + if (prop.getAudioChannels() != null) { + propertiesBundle.putString("audioChannels", prop.getAudioChannels()); + } + if (prop.getDevice() != null) { + propertiesBundle.putString("device", prop.getDevice()); + } + if (prop.getRating() != null) { + propertiesBundle.putString("rating", prop.getRating()); + } + if (prop.getYear() != null) { + propertiesBundle.putString("year", prop.getYear()); + } + if (prop.getCast() != null) { + propertiesBundle.putString("cast", prop.getCast()); + } + if (prop.getOwner() != null) { + propertiesBundle.putString("owner", prop.getOwner()); + } + + return propertiesBundle; } + /** + * Set to positive integer array indicating how many ads will be shown for each break, + * value expected by the customer (the number of ads requested to the server for each break). + * + * @return Bundle of expected Ad pattern + */ + @NonNull + private Bundle getAdExpectedPatternBundle(AdExpectedPattern adExpectedPattern) { + Bundle expectedPatternBundle = new Bundle(); + if (adExpectedPattern == null) { + return expectedPatternBundle; + } + if (adExpectedPattern.getPre() != null) { + expectedPatternBundle.putIntegerArrayList("pre", adExpectedPattern.getPre()); + } + if (adExpectedPattern.getMid() != null) { + expectedPatternBundle.putIntegerArrayList("mid", adExpectedPattern.getMid()); + } + if (adExpectedPattern.getPost() != null) { + expectedPatternBundle.putIntegerArrayList("post", adExpectedPattern.getPost()); + } + + return expectedPatternBundle; + } public JsonObject toJson() { Map rootLevelParams = new HashMap<>(); rootLevelParams.put("accountCode", new JsonPrimitive(getAccountCode() != null ? getAccountCode() : "")); + rootLevelParams.put("host", (getHost() != null) ? new JsonPrimitive(getHost()) : null); + rootLevelParams.put("authToken", (getAuthToken() != null) ? new JsonPrimitive(getAuthToken()) : null); + rootLevelParams.put("authType", (getAuthType() != null) ? new JsonPrimitive(getAuthType()) : null); rootLevelParams.put("username", (getUsername() != null) ? new JsonPrimitive(getUsername()) : null); + rootLevelParams.put("houseHoldId", (getHouseHoldId() != null) ? new JsonPrimitive(getHouseHoldId()) : null); + rootLevelParams.put("userEmail", (getUserEmail() != null) ? new JsonPrimitive(getUserEmail()) : null); rootLevelParams.put("userAnonymousId", (getUserAnonymousId() != null) ? new JsonPrimitive(getUserAnonymousId()) : null); rootLevelParams.put("userType", (getUserType() != null) ? new JsonPrimitive(getUserType()) : null); + rootLevelParams.put("isUserObfuscateIp", new JsonPrimitive(getUserObfuscateIp())); + rootLevelParams.put("userPrivacyProtocol", (getUserPrivacyProtocol() != null) ? new JsonPrimitive(getUserPrivacyProtocol()) : null); + rootLevelParams.put("appName", (getAppName() != null) ? new JsonPrimitive(getAppName()) : null); rootLevelParams.put("appReleaseVersion", (getAppReleaseVersion() != null) ? new JsonPrimitive(getAppReleaseVersion()) : null); - rootLevelParams.put("houseHoldId", (getHouseHoldId() != null) ? new JsonPrimitive(getHouseHoldId()) : null); + rootLevelParams.put("urlToParse", (getUrlToParse() != null) ? new JsonPrimitive(getUrlToParse()) : null); rootLevelParams.put("linkedViewId", (getLinkedViewId() != null) ? new JsonPrimitive(getLinkedViewId()) : null); - - rootLevelParams.put("isUserObfuscateIp", new JsonPrimitive(getUserObfuscateIp())); rootLevelParams.put("httpSecure", new JsonPrimitive(getHttpSecure())); rootLevelParams.put("isAutoStart", new JsonPrimitive(getIsAutoStart())); rootLevelParams.put("isAutoDetectBackground", new JsonPrimitive(getIsAutoDetectBackground())); rootLevelParams.put("isEnabled", new JsonPrimitive(getIsEnabled())); rootLevelParams.put("isForceInit", new JsonPrimitive(getIsForceInit())); rootLevelParams.put("isOffline", new JsonPrimitive(getIsOffline())); + rootLevelParams.put("waitForMetadata", new JsonPrimitive(isWaitForMetadata())); + JsonObject user = YouboraConfigJsonBuilder.getUserJsonObject(getUser()); + JsonArray pendingMetadata = YouboraConfigJsonBuilder.getPendingMetaDataJsonObject(getPendingMetadata()); + JsonObject sessionMetrics = YouboraConfigJsonBuilder.getSessionMetricsJsonObject(getSession() != null ? getSession().getSessionMetrics() : null); JsonObject app = YouboraConfigJsonBuilder.getAppJsonObject(getApp()); JsonObject parse = YouboraConfigJsonBuilder.getParseJsonObject(getParse()); JsonObject device = YouboraConfigJsonBuilder.getDeviceJsonObject(getDevice()); @@ -822,8 +1203,11 @@ public JsonObject toJson() { JsonObject errors = YouboraConfigJsonBuilder.getErrorsJsonObject(getErrors()); JsonObject adsEntry = YouboraConfigJsonBuilder.getAdsJsonObject(getAds()); JsonObject properties = YouboraConfigJsonBuilder.getPropertiesJsonObject(getProperties()); - JsonObject contentCustomDimensions = YouboraConfigJsonBuilder.getContnentCustomDimentionsJsonObject(getContentCustomDimensions()); + JsonObject contentCustomDimensions = YouboraConfigJsonBuilder.getContentCustomDimensionsJsonObject(getContentCustomDimensions()); return YouboraConfigJsonBuilder.getYouboraConfigJsonObject(rootLevelParams, + user, + pendingMetadata, + sessionMetrics, app, parse, device, @@ -834,7 +1218,7 @@ public JsonObject toJson() { properties, contentCustomDimensions); } - + public void merge(YouboraConfig youboraConfigUiConf) { if (youboraConfigUiConf == null) { return; @@ -843,6 +1227,15 @@ public void merge(YouboraConfig youboraConfigUiConf) { if (TextUtils.isEmpty(accountCode)) { accountCode = youboraConfigUiConf.getAccountCode(); } + if (TextUtils.isEmpty(host)) { + host = youboraConfigUiConf.getHost(); + } + if (TextUtils.isEmpty(authToken)) { + authToken = youboraConfigUiConf.getAuthToken(); + } + if (TextUtils.isEmpty(authType)) { + authType = youboraConfigUiConf.getAuthType(); + } if (TextUtils.isEmpty(username)) { username = youboraConfigUiConf.getUsername(); } @@ -858,127 +1251,152 @@ public void merge(YouboraConfig youboraConfigUiConf) { if (content != null) { if (youboraConfigUiConf.getContent() != null) { + if (content.getContentBitrate() == null) { content.setContentBitrate(youboraConfigUiConf.getContent().getContentBitrate()); } - if (content.getContentCdn() == null) { + if (TextUtils.isEmpty(content.getContentCdn())) { content.setContentCdn(youboraConfigUiConf.getContent().getContentCdn()); } - if (content.getContentCdnNode() == null) { + if (TextUtils.isEmpty(content.getContentCdnNode())) { content.setContentCdnNode(youboraConfigUiConf.getContent().getContentCdnNode()); } - if (content.getContentCdnType() == null) { + if (TextUtils.isEmpty(content.getContentCdnType())) { content.setContentCdnType(youboraConfigUiConf.getContent().getContentCdnType()); } - if (content.getContentChannel() == null) { + if (TextUtils.isEmpty(content.getContentChannel())) { content.setContentChannel(youboraConfigUiConf.getContent().getContentChannel()); } - if (content.getContentContractedResolution() == null) { + if (TextUtils.isEmpty(content.getContentContractedResolution())) { content.setContentContractedResolution(youboraConfigUiConf.getContent().getContentContractedResolution()); } - if (content.getContentCost() == null) { + if (TextUtils.isEmpty(content.getContentCost())) { content.setContentCost(youboraConfigUiConf.getContent().getContentCost()); } - if (content.getContentDrm() == null) { + if (TextUtils.isEmpty(content.getContentDrm())) { content.setContentDrm(youboraConfigUiConf.getContent().getContentDrm()); } if (content.getContentDuration() == null) { content.setContentDuration(youboraConfigUiConf.getContent().getContentDuration()); } - if (content.getContentEncodingAudioCodec() == null) { - content.setContentEncodingAudioCodec(youboraConfigUiConf.getContent().getContentEncodingAudioCodec()); - } - if (content.getContentEncodingCodecProfile() == null) { - content.setContentEncodingCodecProfile(youboraConfigUiConf.getContent().getContentEncodingCodecProfile()); - } - if (content.getContentEncodingContainerFormat() == null) { - content.setContentEncodingContainerFormat(youboraConfigUiConf.getContent().getContentEncodingContainerFormat()); - } - if (content.getContentEncodingVideoCodec() == null) { - content.setContentEncodingVideoCodec(youboraConfigUiConf.getContent().getContentEncodingVideoCodec()); - } - if (content.getContentEpisodeTitle() == null) { + if (TextUtils.isEmpty(content.getContentEpisodeTitle())) { content.setContentEpisodeTitle(youboraConfigUiConf.getContent().getContentEpisodeTitle()); } if (content.getContentFps() == null) { content.setContentFps(youboraConfigUiConf.getContent().getContentFps()); } - if (content.getContentGenre() == null) { + if (TextUtils.isEmpty(content.getContentGenre())) { content.setContentGenre(youboraConfigUiConf.getContent().getContentGenre()); } - if (content.getContentGracenoteId() == null) { + if (TextUtils.isEmpty(content.getContentGracenoteId())) { content.setContentGracenoteId(youboraConfigUiConf.getContent().getContentGracenoteId()); } - if (content.getContentId() == null) { + if (TextUtils.isEmpty(content.getContentId())) { content.setContentId(youboraConfigUiConf.getContent().getContentId()); } - if (content.getContentImdbId() == null) { + if (TextUtils.isEmpty(content.getContentImdbId())) { content.setContentImdbId(youboraConfigUiConf.getContent().getContentImdbId()); } - if (content.getContentIsLive() == null) { - content.setContentIsLive(youboraConfigUiConf.getContent().getContentIsLive()); + if (content.isLive() == null) { + if (content.isLive().isLiveContent() == null) { + content.isLive().setLiveContent(youboraConfigUiConf.getContent().isLive().isLiveContent()); + } + if (content.isLive().getNoSeek() == null) { + content.isLive().setNoSeek(youboraConfigUiConf.getContent().isLive().getNoSeek()); + } + if (content.isLive().getNoMonitor() == null) { + content.isLive().setNoMonitor(youboraConfigUiConf.getContent().isLive().getNoMonitor()); + } } - if (content.getContentIsLiveNoSeek() == null && youboraConfigUiConf.getContent().getContentIsLiveNoSeek() != null) { - content.setContentIsLiveNoSeek(youboraConfigUiConf.getContent().getContentIsLiveNoSeek()); - } - if (content.getIsDVR() == null && youboraConfigUiConf.getContent().getIsDVR() != null) { - content.setContentIsLiveNoSeek(!youboraConfigUiConf.getContent().getIsDVR()); + + if (content.getContentIsLiveNoSeek() == null) { + content.setContentIsLiveNoSeek(youboraConfigUiConf.getContent().getContentIsLiveNoSeek()); + } else if (content.isDVR() == null && youboraConfigUiConf.getContent().isDVR() != null) { + content.setContentIsLiveNoSeek(!youboraConfigUiConf.getContent().isDVR()); } - if (content.getContentLanguage() == null) { + + if (TextUtils.isEmpty(content.getContentLanguage())) { content.setContentLanguage(youboraConfigUiConf.getContent().getContentLanguage()); } - if (content.getContentPackage() == null) { + if (TextUtils.isEmpty(content.getContentPackage())) { content.setContentPackage(youboraConfigUiConf.getContent().getContentPackage()); } - if (content.getContentPlaybackType() == null) { + if (TextUtils.isEmpty(content.getContentPlaybackType())) { content.setContentPlaybackType(youboraConfigUiConf.getContent().getContentPlaybackType()); } - if (content.getContentPrice() == null) { + if (TextUtils.isEmpty(content.getContentPrice())) { content.setContentPrice(youboraConfigUiConf.getContent().getContentPrice()); } - if (content.getContentProgram() == null) { + if (TextUtils.isEmpty(content.getContentProgram())) { content.setContentProgram(youboraConfigUiConf.getContent().getContentProgram()); } - if (content.getContentRendition() == null) { + if (TextUtils.isEmpty(content.getContentRendition())) { content.setContentRendition(youboraConfigUiConf.getContent().getContentRendition()); } - if (content.getContentResource() == null) { + if (TextUtils.isEmpty(content.getContentResource())) { content.setContentResource(youboraConfigUiConf.getContent().getContentResource()); } - if (content.getContentSaga() == null) { + if (TextUtils.isEmpty(content.getContentSaga())) { content.setContentSaga(youboraConfigUiConf.getContent().getContentSaga()); } - if (content.getContentSeason() == null) { + if (TextUtils.isEmpty(content.getContentSeason())) { content.setContentSeason(youboraConfigUiConf.getContent().getContentSeason()); } - if (content.getContentStreamingProtocol() == null) { + if (TextUtils.isEmpty(content.getContentStreamingProtocol())) { content.setContentStreamingProtocol(youboraConfigUiConf.getContent().getContentStreamingProtocol()); } - if (content.getContentSubtitles() == null) { + if (TextUtils.isEmpty(content.getContentSubtitles())) { content.setContentSubtitles(youboraConfigUiConf.getContent().getContentSubtitles()); } if (content.getContentThroughput() == null) { content.setContentThroughput(youboraConfigUiConf.getContent().getContentThroughput()); } - if (content.getContentTitle() == null) { + if (TextUtils.isEmpty(content.getContentTitle())) { content.setContentTitle(youboraConfigUiConf.getContent().getContentTitle()); } - if (content.getContentTransactionCode() == null) { + if (TextUtils.isEmpty(content.getContentTransactionCode())) { content.setContentTransactionCode(youboraConfigUiConf.getContent().getContentTransactionCode()); } + if (TextUtils.isEmpty(content.getContentTransportFormat())) { + content.setContentTransportFormat(youboraConfigUiConf.getContent().getContentTransportFormat()); + } if (content.getContentTotalBytes() == null) { content.setContentTotalBytes(youboraConfigUiConf.getContent().getContentTotalBytes()); } - if (content.getContentTransportFormat() == null) { - content.setContentTransportFormat(youboraConfigUiConf.getContent().getContentTransportFormat()); + if (content.getContentSendTotalBytes() == null) { + content.setContentSendTotalBytes(youboraConfigUiConf.getContent().getContentSendTotalBytes()); } - content.setContentSendTotalBytes(youboraConfigUiConf.getContent().getContentSendTotalBytes()); - if (content.getContentTvShow() == null) { + if (TextUtils.isEmpty(content.getContentTvShow())) { content.setContentTvShow(youboraConfigUiConf.getContent().getContentTvShow()); } - if (content.getContentType() == null) { + if (TextUtils.isEmpty(content.getContentType())) { content.setContentType(youboraConfigUiConf.getContent().getContentType()); } + if (content.getContentMetaData() == null) { + content.setContentMetaData(youboraConfigUiConf.getContent().getContentMetaData()); + } + if (content.getContentMetrics() == null) { + content.setContentMetrics(youboraConfigUiConf.getContent().getContentMetrics()); + } + if (content.getContentEncoding() == null) { + content.setContentEncoding(youboraConfigUiConf.getContent().getContentEncoding()); + } else { + if (TextUtils.isEmpty(content.getContentEncodingAudioCodec())) { + content.setContentEncodingAudioCodec(youboraConfigUiConf.getContent().getContentEncodingAudioCodec()); + } + if (TextUtils.isEmpty(content.getContentEncodingCodecProfile())) { + content.setContentEncodingCodecProfile(youboraConfigUiConf.getContent().getContentEncodingCodecProfile()); + } + if (TextUtils.isEmpty(content.getContentEncodingContainerFormat())) { + content.setContentEncodingContainerFormat(youboraConfigUiConf.getContent().getContentEncodingContainerFormat()); + } + if (TextUtils.isEmpty(content.getContentEncodingVideoCodec())) { + content.setContentEncodingVideoCodec(youboraConfigUiConf.getContent().getContentEncodingVideoCodec()); + } + } + if (content.getCustomDimensions() == null) { + content.setCustomDimensions(youboraConfigUiConf.getContent().getCustomDimensions()); + } } } else { content = youboraConfigUiConf.getContent(); @@ -986,15 +1404,15 @@ public void merge(YouboraConfig youboraConfigUiConf) { if (app != null) { if (youboraConfigUiConf.getApp() != null) { - if (app.getAppName() == null) { + if (TextUtils.isEmpty(app.getAppName())) { app.setAppName(youboraConfigUiConf.getApp().getAppName()); } - if (app.getAppReleaseVersion() == null) { - app.setAppReleaseVersion(youboraConfigUiConf.getAppReleaseVersion()); + if (TextUtils.isEmpty(app.getAppReleaseVersion())) { + app.setAppReleaseVersion(youboraConfigUiConf.getApp().getAppReleaseVersion()); } - } else { - app = youboraConfigUiConf.getApp(); } + } else { + app = youboraConfigUiConf.getApp(); } if (parse != null) { @@ -1002,6 +1420,12 @@ public void merge(YouboraConfig youboraConfigUiConf) { if (parse.getParseManifest() == null) { parse.setParseManifest(youboraConfigUiConf.getParse().getParseManifest()); } + if (parse.getParseCdnNodeList() == null) { + parse.setParseCdnNodeList(youboraConfigUiConf.getParse().getParseCdnNodeList()); + } + if (parse.getParseCdnNode() == null) { + parse.setParseCdnNode(youboraConfigUiConf.getParse().getParseCdnNode()); + } if (parse.getParseCdnNode() == null) { parse.setParseCdnNode(youboraConfigUiConf.getParse().getParseCdnNode()); } @@ -1011,9 +1435,12 @@ public void merge(YouboraConfig youboraConfigUiConf) { if (parse.getParseCdnTTL() == null) { parse.setParseCdnTTL(youboraConfigUiConf.getParse().getParseCdnTTL()); } - if (parse.getParseCdnNameHeader() == null) { + if (TextUtils.isEmpty(parse.getParseCdnNameHeader())) { parse.setParseCdnNameHeader(youboraConfigUiConf.getParse().getParseCdnNameHeader()); } + if (TextUtils.isEmpty(parse.getParseNodeHeader())) { + parse.setParseNodeHeader(youboraConfigUiConf.getParse().getParseNodeHeader()); + } if (parse.getParseCdnSwitchHeader() == null) { parse.setParseCdnSwitchHeader(youboraConfigUiConf.getParse().getParseCdnSwitchHeader()); } @@ -1027,10 +1454,10 @@ public void merge(YouboraConfig youboraConfigUiConf) { if (network.getNetworkConnectionType() == null) { network.setNetworkConnectionType(youboraConfigUiConf.getNetwork().getNetworkConnectionType()); } - if (network.getNetworkIP() == null) { + if (TextUtils.isEmpty(network.getNetworkIP())) { network.setNetworkIP(youboraConfigUiConf.getNetwork().getNetworkIP()); } - if (network.getNetworkIsp() == null) { + if (TextUtils.isEmpty(network.getNetworkIsp())) { network.setNetworkIsp(youboraConfigUiConf.getNetwork().getNetworkIsp()); } } @@ -1059,10 +1486,10 @@ public void merge(YouboraConfig youboraConfigUiConf) { if (ads.getAdBreaksTime() == null) { ads.setAdBreaksTime(youboraConfigUiConf.getAds().getAdBreaksTime()); } - if (ads.getAdCampaign() == null) { + if (TextUtils.isEmpty(ads.getAdCampaign())) { ads.setAdCampaign(youboraConfigUiConf.getAds().getAdCampaign()); } - if (ads.getAdCreativeId() == null) { + if (TextUtils.isEmpty(ads.getAdCreativeId())) { ads.setAdCreativeId(youboraConfigUiConf.getAds().getAdCreativeId()); } if (ads.getAdExpectedBreaks() == null) { @@ -1074,15 +1501,27 @@ public void merge(YouboraConfig youboraConfigUiConf) { if (ads.getAdGivenBreaks() == null) { ads.setAdGivenBreaks(youboraConfigUiConf.getAds().getAdGivenBreaks()); } - if (ads.getAdProvider() == null) { + if (TextUtils.isEmpty(ads.getAdProvider())) { ads.setAdProvider(youboraConfigUiConf.getAds().getAdProvider()); } - if (ads.getAdResource() == null) { + if (TextUtils.isEmpty(ads.getAdResource())) { ads.setAdResource(youboraConfigUiConf.getAds().getAdResource()); } - if (ads.getAdTitle() == null) { + if (TextUtils.isEmpty(ads.getAdTitle())) { ads.setAdTitle(youboraConfigUiConf.getAds().getAdTitle()); } + if (ads.getBlockerDetected() == null) { + ads.setBlockerDetected(youboraConfigUiConf.getAds().getBlockerDetected()); + } + if (ads.getMetadata() == null) { + ads.setMetadata(youboraConfigUiConf.getAds().getMetadata()); + } + if (ads.getExpectedPattern() == null) { + ads.setExpectedPattern(youboraConfigUiConf.getAds().getExpectedPattern()); + } + if (ads.getAfterStop() == null) { + ads.setAfterStop(youboraConfigUiConf.getAds().getAfterStop()); + } } } else { ads = youboraConfigUiConf.getAds(); @@ -1188,5 +1627,13 @@ public void merge(YouboraConfig youboraConfigUiConf) { } else { contentCustomDimensions = youboraConfigUiConf.getContentCustomDimensions(); } + + if (session != null) { + if (youboraConfigUiConf.getSession() != null) { + if (session.getSessionMetrics() == null) { + session.setSessionMetrics(youboraConfigUiConf.getSession().getSessionMetrics()); + } + } + } } } diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java index 174269c..d1973a9 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java @@ -3,11 +3,14 @@ import android.text.TextUtils; import androidx.annotation.NonNull; +import androidx.annotation.Nullable; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; +import java.util.ArrayList; +import java.util.HashMap; import java.util.Map; @@ -15,15 +18,18 @@ public class YouboraConfigJsonBuilder { @NonNull static JsonObject getYouboraConfigJsonObject( Map rootLevelParams, - JsonObject app, - JsonObject parse, - JsonObject device, - JsonObject content, - JsonObject network, - JsonObject errors, - JsonObject ads, - JsonObject properties, - JsonObject contentCustomDimensions) { + JsonObject user, + JsonArray pendingMetadata, + JsonObject sessionMetrics, + JsonObject app, + JsonObject parse, + JsonObject device, + JsonObject content, + JsonObject network, + JsonObject errors, + JsonObject ads, + JsonObject properties, + JsonObject contentCustomDimensions) { JsonObject youboraConfig = new JsonObject(); for (Map.Entry entry :rootLevelParams.entrySet()) { if (!TextUtils.isEmpty(entry.getKey()) && entry.getValue() != null) { @@ -31,6 +37,15 @@ static JsonObject getYouboraConfigJsonObject( Map rootLev } } + if (pendingMetadata != null) { + youboraConfig.add("pendingMetadata", pendingMetadata); + } + if (user != null) { + youboraConfig.add("user", user); + } + if (sessionMetrics != null) { + youboraConfig.add("session", sessionMetrics); + } youboraConfig.add("app", app); youboraConfig.add("parse", parse); youboraConfig.add("device", device); @@ -43,6 +58,38 @@ static JsonObject getYouboraConfigJsonObject( Map rootLev return youboraConfig; } + @Nullable + static JsonArray getPendingMetaDataJsonObject(ArrayList metaData) { + if (metaData == null || metaData.isEmpty()) { + return null; + } + return getJsonArrayFromList(metaData); + } + + @Nullable + static JsonObject getSessionMetricsJsonObject(HashMap sessionMetrics) { + if (sessionMetrics == null || sessionMetrics.isEmpty()) { + return null; + } + JsonObject sessionJsonObject = new JsonObject(); + sessionJsonObject.add("sessionMetrics", addHashMapValuesToJsonObject(sessionMetrics)); + return sessionJsonObject; + } + + static JsonObject getUserJsonObject(User user) { + if (user == null) { + return null; + } + + JsonObject jsonObject = new JsonObject(); + jsonObject.addProperty("anonymousId", (!TextUtils.isEmpty(user.getAnonymousId())) ? user.getAnonymousId() : ""); + jsonObject.addProperty("type", (!TextUtils.isEmpty(user.getType())) ? user.getType() : ""); + jsonObject.addProperty("email", (!TextUtils.isEmpty(user.getEmail())) ? user.getEmail() : ""); + jsonObject.addProperty("obfuscateIp", (user.getObfuscateIp() != null) ? user.getObfuscateIp() : false); + jsonObject.addProperty("privacyProtocol", (user.getPrivacyProtocol() != null) ? user.getPrivacyProtocol() : ""); + return jsonObject; + } + @NonNull static JsonObject getAppJsonObject(App app) { JsonObject appJsonObject = new JsonObject(); @@ -55,7 +102,7 @@ static JsonObject getAppJsonObject(App app) { } if (app.getAppReleaseVersion() != null) { - appJsonObject.addProperty("appName", app.getAppReleaseVersion()); + appJsonObject.addProperty("appReleaseVersion", app.getAppReleaseVersion()); } return appJsonObject; @@ -70,15 +117,11 @@ static JsonObject getParseJsonObject(Parse parse) { } if (parse.getParseManifest() != null) { - parseJsonObject.addProperty("parseManifest", parse.getParseManifest()); + parseJsonObject.add("parseManifest", getParseManifestObject(parse.getParseManifest())); } if (parse.getParseCdnNode() != null) { - parseJsonObject.addProperty("parseCdnNode", parse.getParseCdnNode()); - } - - if (parse.getParseCdnSwitchHeader() != null) { - parseJsonObject.addProperty("parseCdnSwitchHeader", parse.getParseCdnSwitchHeader()); + parseJsonObject.add("parseCdnNode", getParseCdnNodeObject(parse.getParseCdnNode())); } if (parse.getParseCdnNodeList() != null) { @@ -89,8 +132,16 @@ static JsonObject getParseJsonObject(Parse parse) { parseJsonObject.add("parseCdnNodeList", parseCdnNodeListJsonArray); } + if (parse.getParseCdnSwitchHeader() != null) { + parseJsonObject.addProperty("parseCdnSwitchHeader", parse.getParseCdnSwitchHeader()); + } + if (parse.getParseCdnNameHeader() != null) { - parseJsonObject.addProperty("parseCdnNameHeader", parse.getParseCdnNameHeader() ); + parseJsonObject.addProperty("parseCdnNameHeader", parse.getParseCdnNameHeader()); + } + + if (parse.getParseNodeHeader() != null) { + parseJsonObject.addProperty("parseNodeHeader", parse.getParseNodeHeader()); } if (parse.getParseCdnTTL() != null) { @@ -99,6 +150,46 @@ static JsonObject getParseJsonObject(Parse parse) { return parseJsonObject; } + @NonNull + static JsonObject getParseManifestObject(Manifest manifest) { + JsonObject manifestJsonObject = new JsonObject(); + if (manifest == null) { + return manifestJsonObject; + } + + if (manifest.getParseManifest() != null) { + manifestJsonObject.addProperty("parseManifest", manifest.getParseManifest()); + } + + if (manifest.getParseManifestAuth() != null) { + manifestJsonObject.add("parseManifestAuth", addHashMapValuesToJsonObject(manifest.getParseManifestAuth())); + } + + return manifestJsonObject; + } + + @NonNull + static JsonObject getParseCdnNodeObject(CdnNode cdnNode) { + JsonObject cdnNodeJsonObject = new JsonObject(); + if (cdnNode == null) { + return cdnNodeJsonObject; + } + + if (cdnNode.getParseCdnNode() != null) { + cdnNodeJsonObject.addProperty("parseCdnNode", cdnNode.getParseCdnNode()); + } + + if (cdnNode.getParseCdnNodeList() != null) { + JsonArray parseCdnNodeListJsonArray = new JsonArray(); + for(String cdn : cdnNode.getParseCdnNodeList()) { + parseCdnNodeListJsonArray.add(cdn); + } + cdnNodeJsonObject.add("parseCdnNodeList", parseCdnNodeListJsonArray); + } + + return cdnNodeJsonObject; + } + @NonNull static JsonObject getDeviceJsonObject(Device device) { JsonObject deviceJsonObject = new JsonObject(); @@ -137,6 +228,11 @@ static JsonObject getDeviceJsonObject(Device device) { if (device.getDeviceOsVersion() != null) { deviceJsonObject.addProperty("deviceOsVersion", device.getDeviceOsVersion()); } + + if (device.getDeviceIsAnonymous() != null) { + deviceJsonObject.addProperty("deviceIsAnonymous", device.getDeviceIsAnonymous()); + } + return deviceJsonObject; } @@ -181,6 +277,9 @@ static JsonObject getContentJsonObject(Content content) { if (content.getContentEncodingCodecProfile() != null) { contentEntry.addProperty("contentEncodingCodecProfile", content.getContentEncodingCodecProfile()); } + if (content.getContentEncoding() != null) { + contentEntry.add("contentEncoding", getEncodingJsonObject(content.getContentEncoding())); + } if (content.getContentEncodingContainerFormat() != null) { contentEntry.addProperty("contentEncodingContainerFormat", content.getContentEncodingContainerFormat()); } @@ -205,11 +304,13 @@ static JsonObject getContentJsonObject(Content content) { if (content.getContentImdbId() != null) { contentEntry.addProperty("contentImdbId", content.getContentImdbId()); } - contentEntry.addProperty("contentisLive", content.getContentIsLive() != null ? content.getContentIsLive() : Boolean.FALSE); + if (content.isLive() != null) { + contentEntry.add("contentIsLive", getIsLiveJsonObject(content.isLive())); + } if (content.getContentIsLiveNoSeek() != null) { contentEntry.addProperty("contentIsLiveNoSeek", content.getContentIsLiveNoSeek()); - } else if (content.getIsDVR() != null) { - contentEntry.addProperty("contentIsLiveNoSeek", !content.getIsDVR()); + } else if (content.isDVR() != null) { + contentEntry.addProperty("contentIsLiveNoSeek", !content.isDVR()); } if (content.getContentLanguage() != null) { @@ -228,7 +329,7 @@ static JsonObject getContentJsonObject(Content content) { contentEntry.addProperty("contentProgram", content.getContentProgram()); } if (content.getContentRendition() != null) { - contentEntry.addProperty("conetentRendition", content.getContentRendition()); + contentEntry.addProperty("contentRendition", content.getContentRendition()); } if (content.getContentResource() != null) { contentEntry.addProperty("contentResource", content.getContentResource()); @@ -260,13 +361,25 @@ static JsonObject getContentJsonObject(Content content) { if (content.getContentTransportFormat() != null) { contentEntry.addProperty("contentTransportFormat", content.getContentTransportFormat()); } - contentEntry.addProperty("contentSendTotalBytes", content.getContentSendTotalBytes()); + if (content.getContentSendTotalBytes() != null) { + contentEntry.addProperty("contentSendTotalBytes", content.getContentSendTotalBytes()); + } if (content.getContentTvShow() != null) { contentEntry.addProperty("contentTvShow", content.getContentTvShow()); } if (content.getContentType() != null) { contentEntry.addProperty("contentType", content.getContentType()); } + if (content.getContentMetaData() != null) { + contentEntry.add("contentMetaData", getPropertiesJsonObject(content.getContentMetaData())); + } + if (content.getContentMetrics() != null && !content.getContentMetrics().isEmpty()) { + JsonObject metricsJson = new JsonObject(); + contentEntry.add("contentMetrics", addHashMapValuesToJsonObject(content.getContentMetrics())); + } + if (content.getCustomDimensions() != null) { + contentEntry.add("customDimensions", getContentCustomDimensionsJsonObject(content.getCustomDimensions())); + } return contentEntry; } @@ -370,10 +483,43 @@ static JsonObject getAdsJsonObject(Ads ads) { if (ads.getAdTitle() != null) { adsEntry.addProperty("adTitle", ads.getAdTitle()); } - + if (ads.getAdCustomDimensions() != null) { + adsEntry.add("adCustomDimensions", getAdCustomDimensionsJsonObject(ads.getAdCustomDimensions())); + } + if (ads.getMetadata() != null) { + adsEntry.add("metadata", getPropertiesJsonObject(ads.getMetadata())); + } + if (ads.getExpectedPattern() != null) { + adsEntry.add("expectedPattern", getAdExpectedPatternJsonObject(ads.getExpectedPattern())); + } + if (ads.getBlockerDetected() != null) { + adsEntry.addProperty("blockerDetected", ads.getBlockerDetected()); + } + if (ads.getAfterStop() != null) { + adsEntry.addProperty("afterStop", ads.getAfterStop()); + } return adsEntry; } + @NonNull + static JsonObject getAdExpectedPatternJsonObject(AdExpectedPattern adExpectedPattern) { + JsonObject expectedPatternJsonObject = new JsonObject(); + if (adExpectedPattern == null) { + return expectedPatternJsonObject; + } + if (adExpectedPattern.getPre() != null && !adExpectedPattern.getPre().isEmpty()) { + expectedPatternJsonObject.add("pre", getJsonArrayFromList(adExpectedPattern.getPre())); + } + if (adExpectedPattern.getMid() != null && !adExpectedPattern.getMid().isEmpty()) { + expectedPatternJsonObject.add("mid", getJsonArrayFromList(adExpectedPattern.getMid())); + } + if (adExpectedPattern.getPost() != null && !adExpectedPattern.getPost().isEmpty()) { + expectedPatternJsonObject.add("post", getJsonArrayFromList(adExpectedPattern.getPost())); + } + + return expectedPatternJsonObject; + } + @NonNull static JsonObject getPropertiesJsonObject(Properties prop) { JsonObject propertiesEntry = new JsonObject(); @@ -483,8 +629,93 @@ static JsonObject getPropertiesJsonObject(Properties prop) { return propertiesEntry; } + static JsonObject getAdCustomDimensionsJsonObject(AdCustomDimensions adCustomDimensions) { + JsonObject customDimensionsEntry = new JsonObject(); + if (adCustomDimensions == null) { + return customDimensionsEntry; + } + + if (adCustomDimensions.getAdCustomDimension1() != null) { + customDimensionsEntry.addProperty("adCustomDimension1", adCustomDimensions.getAdCustomDimension1()); + } + if (adCustomDimensions.getAdCustomDimension2() != null) { + customDimensionsEntry.addProperty("adCustomDimension2", adCustomDimensions.getAdCustomDimension2()); + } + if (adCustomDimensions.getAdCustomDimension3() != null) { + customDimensionsEntry.addProperty("adCustomDimension3", adCustomDimensions.getAdCustomDimension3()); + } + if (adCustomDimensions.getAdCustomDimension4() != null) { + customDimensionsEntry.addProperty("adCustomDimension4", adCustomDimensions.getAdCustomDimension4()); + } + if (adCustomDimensions.getAdCustomDimension5() != null) { + customDimensionsEntry.addProperty("adCustomDimension5", adCustomDimensions.getAdCustomDimension5()); + } + if (adCustomDimensions.getAdCustomDimension6() != null) { + customDimensionsEntry.addProperty("adCustomDimension6", adCustomDimensions.getAdCustomDimension6()); + } + if (adCustomDimensions.getAdCustomDimension7() != null) { + customDimensionsEntry.addProperty("adCustomDimension7", adCustomDimensions.getAdCustomDimension7()); + } + if (adCustomDimensions.getAdCustomDimension8() != null) { + customDimensionsEntry.addProperty("adCustomDimension8", adCustomDimensions.getAdCustomDimension8()); + } + if (adCustomDimensions.getAdCustomDimension9() != null) { + customDimensionsEntry.addProperty("adCustomDimension9", adCustomDimensions.getAdCustomDimension9()); + } + if (adCustomDimensions.getAdCustomDimension10() != null) { + customDimensionsEntry.addProperty("adCustomDimension10", adCustomDimensions.getAdCustomDimension10()); + } + + return customDimensionsEntry; + } + + @NonNull + static JsonObject getEncodingJsonObject(Encoding encoding) { + JsonObject encodingJsonObject = new JsonObject(); + if (encoding == null) { + return encodingJsonObject; + } + + if (encoding.getAudioCodec() != null) { + encodingJsonObject.addProperty("audioCodec", encoding.getAudioCodec()); + } + if (encoding.getCodecProfile() != null) { + encodingJsonObject.addProperty("codecProfile", encoding.getCodecProfile()); + } + if (encoding.getCodecSettings() != null) { + encodingJsonObject.add("codecSettings", addHashMapValuesToJsonObject(encoding.getCodecSettings())); + } + if (encoding.getContainerFormat() != null) { + encodingJsonObject.addProperty("containerFormat", encoding.getContainerFormat()); + } + if (encoding.getVideoCodec() != null) { + encodingJsonObject.addProperty("videoCodec", encoding.getVideoCodec()); + } + return encodingJsonObject; + } + @NonNull - static JsonObject getContnentCustomDimentionsJsonObject(ContentCustomDimensions contentCustomDimensions) { + static JsonObject getIsLiveJsonObject(IsLive isLive) { + JsonObject isLiveJsonObject = new JsonObject(); + if (isLive == null) { + return isLiveJsonObject; + } + + if (isLive.isLiveContent() != null) { + isLiveJsonObject.addProperty("isLiveContent", isLive.isLiveContent()); + } + if (isLive.getNoSeek() != null) { + isLiveJsonObject.addProperty("noSeek", isLive.getNoSeek()); + } + if (isLive.getNoMonitor() != null) { + isLiveJsonObject.addProperty("noMonitor", isLive.getNoMonitor()); + } + + return isLiveJsonObject; + } + + @NonNull + static JsonObject getContentCustomDimensionsJsonObject(ContentCustomDimensions contentCustomDimensions) { JsonObject customDimensionsEntry = new JsonObject(); if (contentCustomDimensions == null) { return customDimensionsEntry; @@ -552,4 +783,29 @@ static JsonObject getContnentCustomDimentionsJsonObject(ContentCustomDimensions } return customDimensionsEntry; } + + @NonNull + private static JsonArray getJsonArrayFromList(ArrayList valueArray) { + JsonArray jsonArray = new JsonArray(); + for(Object value : valueArray) { + jsonArray.add(String.valueOf(value)); + } + + return jsonArray; + } + + @Nullable + private static JsonObject addHashMapValuesToJsonObject(HashMap map) { + if (map == null || map.isEmpty()) { + return null; + } + + JsonObject jsonObject = new JsonObject(); + + for (Map.Entry entry : map.entrySet()) { + jsonObject.addProperty(entry.getKey(), entry.getValue()); + } + + return jsonObject; + } } From cbd08a9a6aa498dca0ccb9bdbc6130d9bd8615e3 Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Tue, 23 Aug 2022 12:41:47 +0530 Subject: [PATCH 130/143] Updated Readme doc (#99) --- README.md | 264 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 158 insertions(+), 106 deletions(-) diff --git a/README.md b/README.md index fd33f77..6803872 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ player = KalturaOttPlayer.create(this@MainActivity, playerInitOptions) ##### Example for some of the properties the App can send to Youbora plugin. The only must property to send is _your account code_. In case if properties are not sent and if plugin have it internally plugin will set it automatically i.e media title, media resource and more. -[Youbora Bundle Keys referance](https://bitbucket.org/npaw/lib-plugin-android/src/047a982e74b452ce2e5aeda426830f3a83da5e29/youboralib/src/main/java/com/npaw/youbora/lib6/plugin/Options.kt#lines-628) +[Youbora Bundle Keys reference](https://bitbucket.org/npaw/lib-plugin-android/src/047a982e74b452ce2e5aeda426830f3a83da5e29/youboralib/src/main/java/com/npaw/youbora/lib6/plugin/Options.kt#lines-628) ``` /** @@ -156,27 +156,60 @@ private fun getYouboraConfig(): JsonObject { // Youbora config json. Main config goes here. val youboraConfigJson = JsonObject() - youboraConfigJson.addProperty("accountCode", ACCOUNT_CODE) - youboraConfigJson.addProperty("username", UNIQUE_USER_NAME) - youboraConfigJson.addProperty("userObfuscateIp", true) - youboraConfigJson.addProperty("httpSecure", true) -// // Backward compatibility, Use user Json instead -// youboraConfigJson.addProperty("userEmail", USER_EMAIL) -// youboraConfigJson.addProperty("userAnonymousId", "my anonymousId") -// youboraConfigJson.addProperty("userType", "my user type") -// youboraConfigJson.addProperty("userObfuscateIp", false) + // MUST to have config + youboraConfigJson.addProperty("accountCode", "kalturatest") + + // Backward compatibility DEPRECATED +// youboraConfigJson.addProperty("appName", "Kaltura Full demo sample deprecated"); +// youboraConfigJson.addProperty("appReleaseVersion", "1.0.1 deprecated"); + + // App JSON + val appJson = JsonObject() + appJson.addProperty("appName", "Kaltura Full demo sample") + appJson.addProperty("appReleaseVersion", "1.0.1") + + // Backward compatibility DEPRECATED +// youboraConfigJson.addProperty("userEmail", "test@at.com DEPRECATED"); +// youboraConfigJson.addProperty("userAnonymousId", "my anonymousId DEPRECATED"); +// youboraConfigJson.addProperty("userType", "my user type DEPRECATED"); +// youboraConfigJson.addProperty("userObfuscateIp", false); +// youboraConfigJson.addProperty("privacyProtocol", "https DEPRECATED"); + // USER Json val userJson = JsonObject() userJson.addProperty("email", USER_EMAIL) userJson.addProperty("anonymousId", "my anonymousId") userJson.addProperty("type", "my user type") - userJson.addProperty("obfuscateIp", "My ObfuscateIp") + userJson.addProperty("obfuscateIp", true) + userJson.addProperty("privacyProtocol", "https") + + // Miscellaneous Configs + youboraConfigJson.addProperty("authToken", "myTokenString") + youboraConfigJson.addProperty("authType", "Bearer") + youboraConfigJson.addProperty("username", "youboraTest") + youboraConfigJson.addProperty("linkedViewId", "my linked View ID") + youboraConfigJson.addProperty("urlToParse", "http://abcasd.com") + + youboraConfigJson.addProperty("householdId", "My householdId") + youboraConfigJson.addProperty("host", "a-fds.youborafds01.com") + youboraConfigJson.addProperty("autoStart", true) + youboraConfigJson.addProperty("autoDetectBackground", true) + youboraConfigJson.addProperty("enabled", true) + youboraConfigJson.addProperty("forceInit", false) + youboraConfigJson.addProperty("offline", false) + youboraConfigJson.addProperty("httpSecure", true) + youboraConfigJson.addProperty("waitForMetadata", false) + + // Pending Metadata JSON + val pendingMetaDataArray = JsonArray() + pendingMetaDataArray.add("title") + pendingMetaDataArray.add("userName") + youboraConfigJson.add("pendingMetadata", pendingMetaDataArray) - // Youbora ads configuration json. + //Youbora ads configuration json. val adsJson = JsonObject() adsJson.addProperty("blockerDetected", false) - adsJson.addProperty("campaign", "zzz") // Create AdMetaData val adMetaData = JsonObject() adMetaData.addProperty("year", "2022") @@ -188,7 +221,8 @@ private fun getYouboraConfig(): JsonObject { adMetaData.addProperty("device", "device 2022") adMetaData.addProperty("audioChannels", "audioChannels 2022") adsJson.add("metadata", adMetaData) - adsJson.addProperty("campaign", CAMPAIGN) + + adsJson.addProperty("campaign", "ad campaign 2022") adsJson.addProperty("title", "ad title 2022") adsJson.addProperty("resource", "resource 2022") adsJson.addProperty("givenBreaks", 5) @@ -220,24 +254,85 @@ private fun getYouboraConfig(): JsonObject { val adCustomDimensions = JsonObject() adCustomDimensions.addProperty("param1", "my adCustomDimension1") adCustomDimensions.addProperty("10", "my adCustomDimension10") - adsJson.add("customDimension", adCustomDimensions) + adsJson.add("adCustomDimension", adCustomDimensions) + + // Error JSON + val errorJson = JsonObject() + val ignoredErrors = JsonArray() + ignoredErrors.add("Asset Not Found.") + errorJson.add("errorsIgnore", ignoredErrors) + + // Create Network JSON object + val networkJson = JsonObject() + networkJson.addProperty("networkConnectionType", "Wireless") + networkJson.addProperty("networkIP", "18212.16218.01.012132") + networkJson.addProperty("networkIsp", "XYZ TTML") + + // Create Parse JSON object + val parseJson = JsonObject() +// parseJson.addProperty("parseManifest", true); // Deprecated way to pass value + val parseManifestJson = JsonObject() // New way to pass value + + parseManifestJson.addProperty("manifest", true) + val manifestAuthMap = JsonObject() + manifestAuthMap.addProperty("AUTH1", "VALUE1") + manifestAuthMap.addProperty("AUTH2", "VALUE2") + manifestAuthMap.addProperty("AUTH3", "VALUE3") + manifestAuthMap.addProperty("AUTH4", "VALUE4") + parseManifestJson.add("auth", manifestAuthMap) + parseJson.add("parseManifest", parseManifestJson) + + parseJson.addProperty("parseCdnSwitchHeader", true) + +// parseJson.addProperty("parseCdnNode", true); // Deprecated way to pass value +// JsonArray cdnNodeListArray = new JsonArray(); // Deprecated way to pass value +// cdnNodeListArray.add("Akamai"); +// cdnNodeListArray.add("Cloudfront"); +// cdnNodeListArray.add("NosOtt"); +// parseJson.add("parseCdnNodeList", cdnNodeListArray); + + val cdnNodeJson = JsonObject() // New way to pass value + cdnNodeJson.addProperty("requestDebugHeaders", true) + val cdnNodeListJson = JsonArray() + cdnNodeListJson.add("Akamai") + cdnNodeListJson.add("Cloudfront") + cdnNodeListJson.add("NosOtt") + cdnNodeJson.add("parseCdnNodeList", cdnNodeListJson) + + parseJson.add("cdnNode", cdnNodeJson) + + parseJson.addProperty("parseCdnNameHeader", "x-cdn") + parseJson.addProperty("parseNodeHeader", "x-node") + parseJson.addProperty("parseCdnTTL", 60) + + //Optional - Device json o/w youbora will decide by its own. + val deviceJson = JsonObject() + deviceJson.addProperty("deviceCode", DEVICE_CODE) + deviceJson.addProperty("deviceBrand", "Brand Xiaomi") + deviceJson.addProperty("deviceCode", "Code Xiaomi") + deviceJson.addProperty("deviceId", "Device ID Xiaomi") + deviceJson.addProperty("deviceEdId", "EdId Xiaomi") + deviceJson.addProperty("deviceModel", "Model MI3") + deviceJson.addProperty("deviceOsName", "Android/Oreo") + deviceJson.addProperty("deviceOsVersion", "8.1") + deviceJson.addProperty("deviceType", "TvBox TYPE") + deviceJson.addProperty("deviceName", "TvBox") + deviceJson.addProperty("deviceIsAnonymous", "TvBox") - // Media entry json. [Content JSON] + //Media entry json. [Content JSON] val mediaEntryJson = JsonObject() - mediaEntryJson.addProperty("title", MEDIA_TITLE) - mediaEntryJson.addProperty("contentIsLiveNoSeek", true) - mediaEntryJson.addProperty("contentCdnCode", CONTENT_CDN_CODE) - mediaEntryJson.addProperty("contentGenre", GENRE) - mediaEntryJson.addProperty("contentEpisodeTitle", "xxxxxxx") - mediaEntryJson.addProperty("contentPrice", PRICE) - mediaEntryJson.addProperty("contentTransactionCode", TRANSACTION_TYPE) - mediaEntryJson.addProperty("contentProgram", PROGRAM) - mediaEntryJson.addProperty("isLive", IS_LIVE_MEDIA) + //mediaEntryJson.addProperty("isLive", isLive); // IT's REMOVED NOW USE `isLive` class instead + val isLiveJson = JsonObject() + isLiveJson.addProperty("isLiveContent", true) + isLiveJson.addProperty("noSeek", true) + isLiveJson.addProperty("noMonitor", true) + mediaEntryJson.add("isLive", isLiveJson) + +// mediaEntryJson.addProperty("isLive", true); mediaEntryJson.addProperty("contentBitrate", 480000) - // Encoding JSON val encodingJson = JsonObject() encodingJson.addProperty("videoCodec", "video codec name") - mediaEntryJson.add("contentEncodingCodecSettings", encodingJson) + mediaEntryJson.add("encoding", encodingJson) // Create Content MetaData val contentMetaData = JsonObject() contentMetaData.addProperty("year", "2022") @@ -255,89 +350,46 @@ private fun getYouboraConfig(): JsonObject { contentCustomDimensions.addProperty("param2", "param2") mediaEntryJson.add("customDimensions", contentCustomDimensions) - // Optional - Create Parse JSON object - val parseJson = JsonObject() - parseJson.addProperty("parseManifest", PARSE_MANIFEST) - parseJson.addProperty("parseCdnNode", PARSE_CDN_NODE) - parseJson.addProperty("parseCdnSwitchHeader", PARSE_CDN_SWITCH_HEADER) - val parseCdnNodeListJsonArray = JsonArray() - for(cdn in PARSE_CDN_NODE_LIST) { - parseCdnNodeListJsonArray.add(cdn) - } - parseJson.add("cdnNodeList", parseCdnNodeListJsonArray) - parseJson.addProperty("cdnNameHeaders", PARSE_CDN_NAME_HEADERS) - parseJson.addProperty("parseNodeHeader", PARSE_CDN_NODE_HEADERS) - parseJson.addProperty("parseCdnTTL", PARSE_CDN_TTL) - - // Optional - Device json o/w youbora will decide by its own. - val deviceJson = JsonObject() - deviceJson.addProperty("deviceCode", DEVICE_CODE) - deviceJson.addProperty("deviceBrand", "Brand Xiaomi") - deviceJson.addProperty("deviceCode", "Code Xiaomi") - deviceJson.addProperty("deviceId", "Device ID Xiaomi") - deviceJson.addProperty("deviceEdId", "EdId Xiaomi") - deviceJson.addProperty("deviceModel", "Model MI3") - deviceJson.addProperty("deviceOsName", "Android/Oreo") - deviceJson.addProperty("deviceOsVersion", "8.1") - deviceJson.addProperty("deviceType", "TvBox TYPE") - deviceJson.addProperty("deviceName", "TvBox") - deviceJson.addProperty("deviceIsAnonymous", "TvBox") - - // Optional: Create Network JSON object - val networkJson = JsonObject() - networkJson.addProperty("networkConnectionType", "Wireless") - networkJson.addProperty("networkIP", "1.1.1.1") - networkJson.addProperty("networkIsp", "Country ISP") - - // App JSON - val appJson = JsonObject() - appJson.addProperty("appName", "MyTestApp") - appJson.addProperty("appReleaseVersion", "1.0.1") - - // Errors JSON - val errorsJson = JsonObject() - val errorJsonArray = JsonArray() - errorJsonArray.add("exception1") - errorJsonArray.add("exception2") - errorsJson.add("errorsIgnore", errorJsonArray) - - // SessionMetrics JSON + val sessionMetricsMap = JsonObject() + sessionMetricsMap.addProperty("sessionKey", "sessionValue") val sessionJson = JsonObject() - sessionJson.addProperty("metricsKey", "metricsValue") - -// // Configure custom properties here, Backward Compatible -// // Properties are actually metadata which are moved to Ad and Content respectively -// val propertiesJson = JsonObject() -// propertiesJson.addProperty("year", YEAR) -// propertiesJson.addProperty("cast", CAST) -// propertiesJson.addProperty("director", DIRECTOR) -// propertiesJson.addProperty("owner", OWNER) -// propertiesJson.addProperty("parental", PARENTAL) -// -// propertiesJson.addProperty("rating", RATING) -// propertiesJson.addProperty("audioType", AUDIO_TYPE) -// propertiesJson.addProperty("audioChannels", AUDIO_CHANNELS) -// propertiesJson.addProperty("device", DEVICE) -// propertiesJson.addProperty("quality", QUALITY) -// -// -// // Backward Compatible. -// // These are custom dimensions which are moved to Ads and Content respectively -// val extraParamJson = JsonObject() -// extraParamJson.addProperty("param1", EXTRA_PARAM_1) -// extraParamJson.addProperty("param2", EXTRA_PARAM_2) - - // Add all the json objects created before to the pluginEntry json. - youboraConfigJson.add("media", mediaEntryJson) - youboraConfigJson.add("app", appJson) + sessionJson.add("metrics", sessionMetricsMap) + + //Configure custom properties here: DEPRECATED in the Youbora Plugin +// JsonObject propertiesJson = new JsonObject(); +// propertiesJson.addProperty("genre", ""); +// propertiesJson.addProperty("type", ""); +// propertiesJson.addProperty("transactionType", "TransactionType-1"); +// propertiesJson.addProperty("year", ""); +// propertiesJson.addProperty("cast", ""); +// propertiesJson.addProperty("director", ""); +// propertiesJson.addProperty("owner", ""); +// propertiesJson.addProperty("parental", ""); +// propertiesJson.addProperty("price", ""); +// propertiesJson.addProperty("rating", ""); +// propertiesJson.addProperty("audioType", ""); +// propertiesJson.addProperty("audioChannels", ""); +// propertiesJson.addProperty("device", ""); +// propertiesJson.addProperty("quality", ""); +// propertiesJson.addProperty("contentCdnCode", CONTENT_CDN_CODE); + + //You can add some extra params here: DEPRECATED in the plugin +// JsonObject extraParamJson = new JsonObject(); +// extraParamJson.addProperty("1", "param1"); +// extraParamJson.addProperty("2", "param2"); + + //Add all the json objects created before to the pluginEntry json. + youboraConfigJson.add("user", userJson) youboraConfigJson.add("parse", parseJson) youboraConfigJson.add("network", networkJson) youboraConfigJson.add("device", deviceJson) - youboraConfigJson.add("errors", errorsJson) - youboraConfigJson.add("ads", adsJson) - youboraConfigJson.add("sessionMetrics", sessionJson) -// youboraConfigJson.add("properties", propertiesJson) -// youboraConfigJson.add("extraParams", extraParamJson) + youboraConfigJson.add("media", mediaEntryJson) + youboraConfigJson.add("ad", adsJson) + youboraConfigJson.add("app", appJson) + youboraConfigJson.add("errors", errorJson) + youboraConfigJson.add("session", sessionJson) +// youboraConfigJson.add("properties", propertiesJson); +// youboraConfigJson.add("extraParams", extraParamJson); return youboraConfigJson } From 51f138fd7c6b31e2437b7fd4858a3d8b8a87896b Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Tue, 23 Aug 2022 18:07:47 +0530 Subject: [PATCH 131/143] - Fixed potential crash after Youbora upgrade (#100) --- .../kaltura/playkit/plugins/youbora/pluginconfig/Device.kt | 2 +- .../playkit/plugins/youbora/pluginconfig/YouboraConfig.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.kt b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.kt index f684fb7..ec8afd6 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.kt +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/Device.kt @@ -33,7 +33,7 @@ data class Device( @SerializedName(value = "deviceType", alternate = ["type"]) var deviceType: String? = null, @SerializedName(value = "deviceIsAnonymous", alternate = ["isAnonymous"]) - var deviceIsAnonymous: Boolean? = false + var deviceIsAnonymous: Boolean? = null ) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index 01fa306..98f624f 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -725,7 +725,7 @@ public Options getYouboraOptions() { } } - if (content.isLive() == null && content.isLive().getNoSeek() == null && content.getContentIsLiveNoSeek() != null) { + if ((content.isLive() == null || content.isLive().getNoSeek() == null) && content.getContentIsLiveNoSeek() != null) { youboraOptions.setContentIsLiveNoSeek(content.getContentIsLiveNoSeek()); } else if (content.isDVR() != null) { youboraOptions.setContentIsLiveNoSeek(!content.isDVR()); @@ -1297,7 +1297,7 @@ public void merge(YouboraConfig youboraConfigUiConf) { if (TextUtils.isEmpty(content.getContentImdbId())) { content.setContentImdbId(youboraConfigUiConf.getContent().getContentImdbId()); } - if (content.isLive() == null) { + if (content.isLive() != null && youboraConfigUiConf.getContent().isLive() != null) { if (content.isLive().isLiveContent() == null) { content.isLive().setLiveContent(youboraConfigUiConf.getContent().isLive().isLiveContent()); } From 37e7e252d2bb55cacee84df4de50bd62fd8366d6 Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Thu, 25 Aug 2022 13:02:56 +0530 Subject: [PATCH 132/143] - Fixed user type and email typo (#101) - refactor and isEmpty Checks --- .../youbora/pluginconfig/YouboraConfig.java | 28 +++++++++---------- .../YouboraConfigJsonBuilder.java | 9 +++--- 2 files changed, 18 insertions(+), 19 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java index 98f624f..4b3b06a 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfig.java @@ -529,11 +529,11 @@ public Options getYouboraOptions() { youboraOptions.setUserAnonymousId(user.getAnonymousId()); } if (!TextUtils.isEmpty(user.getType())) { - youboraOptions.setUserEmail(user.getType()); + youboraOptions.setUserType(user.getType()); + } + if (user.getObfuscateIp() != null) { + youboraOptions.setUserObfuscateIp(user.getObfuscateIp()); } - - youboraOptions.setUserObfuscateIp(user.getObfuscateIp()); - if (!TextUtils.isEmpty(user.getPrivacyProtocol())) { youboraOptions.setUserPrivacyProtocol(user.getPrivacyProtocol()); } @@ -545,7 +545,7 @@ public Options getYouboraOptions() { youboraOptions.setUserAnonymousId(getUserAnonymousId()); } if (!TextUtils.isEmpty(getUserType())) { - youboraOptions.setUserEmail(getUserType()); + youboraOptions.setUserType(getUserType()); } youboraOptions.setUserObfuscateIp(getUserObfuscateIp()); @@ -605,7 +605,7 @@ public Options getYouboraOptions() { if (parse.getParseCdnNode().getParseCdnNode() != null) { youboraOptions.setParseCdnNode(parse.getParseCdnNode().getParseCdnNode()); } - if (parse.getParseCdnNode().getParseCdnNodeList() != null) { + if (parse.getParseCdnNode().getParseCdnNodeList() != null && !parse.getParseCdnNode().getParseCdnNodeList().isEmpty()) { youboraOptions.setParseCdnNodeList(parse.getParseCdnNode().getParseCdnNodeList()); } } @@ -791,7 +791,7 @@ public Options getYouboraOptions() { if (content.getContentMetaData() != null) { youboraOptions.setContentMetadata(getContentMetaDataBundle(content.getContentMetaData())); } - if (content.getContentMetrics() != null) { + if (content.getContentMetrics() != null && !content.getContentMetrics().isEmpty()) { youboraOptions.setContentMetrics(getBundleFromMap(content.getContentMetrics())); } if (content.getContentEncoding() != null) { @@ -854,19 +854,19 @@ public Options getYouboraOptions() { } if (errors != null) { - if (errors.getErrorsIgnore() != null) { + if (errors.getErrorsIgnore() != null && errors.getErrorsIgnore().length > 0) { youboraOptions.setErrorsToIgnore(errors.getErrorsIgnore()); } - if (errors.getErrorsFatal() != null) { + if (errors.getErrorsFatal() != null && errors.getErrorsFatal().length > 0) { youboraOptions.setFatalErrors(errors.getErrorsFatal()); } - if (errors.getErrorsNonFatal() != null) { + if (errors.getErrorsNonFatal() != null && errors.getErrorsNonFatal().length > 0) { youboraOptions.setNonFatalErrors(errors.getErrorsNonFatal()); } } if (ads != null) { - if (ads.getAdBreaksTime() != null) { + if (ads.getAdBreaksTime() != null && !ads.getAdBreaksTime().isEmpty()) { youboraOptions.setAdBreaksTime(ads.getAdBreaksTime()); } if (ads.getAdCampaign() != null) { @@ -1150,13 +1150,13 @@ private Bundle getAdExpectedPatternBundle(AdExpectedPattern adExpectedPattern) { if (adExpectedPattern == null) { return expectedPatternBundle; } - if (adExpectedPattern.getPre() != null) { + if (adExpectedPattern.getPre() != null && !adExpectedPattern.getPre().isEmpty()) { expectedPatternBundle.putIntegerArrayList("pre", adExpectedPattern.getPre()); } - if (adExpectedPattern.getMid() != null) { + if (adExpectedPattern.getMid() != null && !adExpectedPattern.getMid().isEmpty()) { expectedPatternBundle.putIntegerArrayList("mid", adExpectedPattern.getMid()); } - if (adExpectedPattern.getPost() != null) { + if (adExpectedPattern.getPost() != null && !adExpectedPattern.getPost().isEmpty()) { expectedPatternBundle.putIntegerArrayList("post", adExpectedPattern.getPost()); } diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java index d1973a9..44b83f8 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/pluginconfig/YouboraConfigJsonBuilder.java @@ -124,7 +124,7 @@ static JsonObject getParseJsonObject(Parse parse) { parseJsonObject.add("parseCdnNode", getParseCdnNodeObject(parse.getParseCdnNode())); } - if (parse.getParseCdnNodeList() != null) { + if (parse.getParseCdnNodeList() != null && !parse.getParseCdnNodeList().isEmpty()) { JsonArray parseCdnNodeListJsonArray = new JsonArray(); for(String cdn : parse.getParseCdnNodeList()) { parseCdnNodeListJsonArray.add(cdn); @@ -161,7 +161,7 @@ static JsonObject getParseManifestObject(Manifest manifest) { manifestJsonObject.addProperty("parseManifest", manifest.getParseManifest()); } - if (manifest.getParseManifestAuth() != null) { + if (manifest.getParseManifestAuth() != null && !manifest.getParseManifestAuth().isEmpty()) { manifestJsonObject.add("parseManifestAuth", addHashMapValuesToJsonObject(manifest.getParseManifestAuth())); } @@ -179,7 +179,7 @@ static JsonObject getParseCdnNodeObject(CdnNode cdnNode) { cdnNodeJsonObject.addProperty("parseCdnNode", cdnNode.getParseCdnNode()); } - if (cdnNode.getParseCdnNodeList() != null) { + if (cdnNode.getParseCdnNodeList() != null && !cdnNode.getParseCdnNodeList().isEmpty()) { JsonArray parseCdnNodeListJsonArray = new JsonArray(); for(String cdn : cdnNode.getParseCdnNodeList()) { parseCdnNodeListJsonArray.add(cdn); @@ -374,7 +374,6 @@ static JsonObject getContentJsonObject(Content content) { contentEntry.add("contentMetaData", getPropertiesJsonObject(content.getContentMetaData())); } if (content.getContentMetrics() != null && !content.getContentMetrics().isEmpty()) { - JsonObject metricsJson = new JsonObject(); contentEntry.add("contentMetrics", addHashMapValuesToJsonObject(content.getContentMetrics())); } if (content.getCustomDimensions() != null) { @@ -682,7 +681,7 @@ static JsonObject getEncodingJsonObject(Encoding encoding) { if (encoding.getCodecProfile() != null) { encodingJsonObject.addProperty("codecProfile", encoding.getCodecProfile()); } - if (encoding.getCodecSettings() != null) { + if (encoding.getCodecSettings() != null && !encoding.getCodecSettings().isEmpty()) { encodingJsonObject.add("codecSettings", addHashMapValuesToJsonObject(encoding.getCodecSettings())); } if (encoding.getContainerFormat() != null) { From 503c68a905c4cfb9e18a9c98fc4d1f4dd2e68172 Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Mon, 5 Dec 2022 22:31:30 +0530 Subject: [PATCH 133/143] - Upgrade youbora to the latest v6.8.4 (#103) --- youboraplugin/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 52c639d..105bf81 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -35,7 +35,7 @@ dependencies { implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' //implementation project(":playkit") - api 'com.nicepeopleatwork:youboralib:6.7.72' + api 'com.nicepeopleatwork:youboralib:6.8.4' // Kotlin Config implementation 'androidx.core:core-ktx:1.3.2' From 74b773318a28352f98cebff7dd7affb6fc081b7d Mon Sep 17 00:00:00 2001 From: GouravSna <38206744+GouravSna@users.noreply.github.com> Date: Tue, 6 Dec 2022 08:19:57 +0530 Subject: [PATCH 134/143] FEC-12338 `compileSdkVersion` and `targetSdkVersion` to 33 (#102) --- build.gradle | 4 ++-- gradle/wrapper/gradle-wrapper.properties | 2 +- youboraplugin/build.gradle | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index cb203ae..15ae44c 100644 --- a/build.gradle +++ b/build.gradle @@ -1,14 +1,14 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.5.20' + ext.kotlin_version = '1.7.10' repositories { google() mavenCentral() maven { url "https://jitpack.io" } } dependencies { - classpath 'com.android.tools.build:gradle:7.0.3' + classpath 'com.android.tools.build:gradle:7.2.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0ee0265..1e8dc74 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 105bf81..49567ac 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -3,14 +3,14 @@ apply plugin: 'kotlin-android' apply from: 'version.gradle' android { - compileSdkVersion 31 + compileSdkVersion 33 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } defaultConfig { minSdkVersion 16 - targetSdkVersion 30 + targetSdkVersion 33 versionName libVersion testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" buildConfigField("String","VERSION_NAME","\"${libVersion}\"") @@ -38,7 +38,7 @@ dependencies { api 'com.nicepeopleatwork:youboralib:6.8.4' // Kotlin Config - implementation 'androidx.core:core-ktx:1.3.2' + implementation 'androidx.core:core-ktx:1.9.0' implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" testImplementation 'junit:junit:4.13.2' From ad890c6b178a9c0f6016d1a32a76c439afdeff4d Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Thu, 5 Jan 2023 14:41:21 +0200 Subject: [PATCH 135/143] feat(FEC-12558) | Add github actions support --- .github/publish.sh | 191 +++++++++++++++++++++++++++ .github/release_notes.sh | 54 ++++++++ .github/workflows/build.yml | 31 +++++ .github/workflows/publish.yml | 61 +++++++++ .travis.yml | 24 ---- build.gradle | 19 +++ gradle.properties | 2 + travis-push-to-bintray.sh | 43 ------ youboraplugin/gradle-mvn-push.gradle | 12 +- 9 files changed, 364 insertions(+), 73 deletions(-) create mode 100644 .github/publish.sh create mode 100644 .github/release_notes.sh create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/publish.yml delete mode 100644 .travis.yml delete mode 100755 travis-push-to-bintray.sh diff --git a/.github/publish.sh b/.github/publish.sh new file mode 100644 index 0000000..70fd800 --- /dev/null +++ b/.github/publish.sh @@ -0,0 +1,191 @@ +#!/bin/bash +# This script takes care of the following tasks, +## 1. Create a new branch from the default 'develop' or 'dev' branch. +## 2. Change the version in version.gradle file. +## 3. Commit and push the version.gradle changes to remote. +## 4. Call `release_notes.sh` to generate release notes. +## 5. Publish and Close it for SONATYPE Maven publishing. +## 6. Create a TAG with release notes and push to remote. +## 7. Notify MS-Teams when the whole process it done. +## IMP: For Patch, there should always be a branch pushed to the remote +## named as `patch/v*.*.*`. Because for patch, script is checking out that branch +## and tagging it. + +exit_on_failure() { + echo "$@" 1>&2 + exit 1 +} + +checkout() { + echo Checking out newtag = "$NEW_TAG", release type = "$RELEASE_TYPE" + + case $RELEASE_TYPE in + Full) + git checkout -b "$BRANCH_NAME" || exit_on_failure "Unable to checkout $BRANCH_NAME";; + Patch) + git checkout "$BRANCH_NAME" || exit_on_failure "Unable to checkout $BRANCH_NAME";; + Update) + git checkout -b "$BRANCH_NAME" "$PREV_TAG" || exit_on_failure "Unable to checkout $BRANCH_NAME";; + esac +} + +set_version() { + echo Setting version of "$REPO_NAME" to "$NEW_VERSION" + + # Changing the version in version.gradle file + perl -pi -e "s/^ext.libVersion.*$/ext.libVersion = '$NEW_VERSION'/" $VERSION_FILE +} + +build() { + chmod +x gradlew + ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository +} + +release_and_tag() { + git config user.name "$GH_USER_NAME" + git config user.email "<>" + + echo Releasing version $NEW_VERSION of $REPO_NAME to GitHub + set +e + git add $VERSION_FILE + git commit -m "Update version to $NEW_TAG" + set -e + git push origin HEAD:$BRANCH_NAME + + # Generate Release notes + bash $RELEASE_NOTES_SCRIPT + + if [[ "$RELEASE_TYPE" = "Patch" || "$RELEASE_TYPE" = "Full" ]]; then + + releaseNotes=$(awk -v d="\\\n" '{s=(NR==1?s:s d)$0}END{print s}' $RELEASE_NOTES) + + +cat << EOF > ./post.json +{ + "name": "$NEW_TAG", + "body": "$releaseNotes", + "tag_name": "$NEW_TAG", + "target_commitish": "$BRANCH_NAME" +} +EOF + fi + + if [ "$RELEASE_TYPE" = "Update" ]; then + JSON_BODY="### Youbora Plugin Support\n\n" + JSON_BODY="$JSON_BODY$NEW_TAG\n\n" + JSON_BODY="$JSON_BODY * upgrade to $NEW_TAG\n\n" + JSON_BODY="$JSON_BODY #### Gradle\n\n" + JSON_BODY="$JSON_BODY * implementation 'com.kaltura.playkit:youbora" + JSON_BODY="$NEW_VERSION" + JSON_BODY="$JSON_BODY'" + + +cat << EOF > ./post.json +{ + "name": "$NEW_TAG", + "body": "## Changes from [$PREV_TAG](https://github.com/kaltura/$REPO_NAME/releases/tag/$PREV_TAG)\n\n$JSON_BODY", + "tag_name": "$NEW_TAG", + "target_commitish": "$BRANCH_NAME" +} +EOF + fi + + cat post.json + + curl --request POST \ + --url https://api.github.com/repos/kaltura/$REPO_NAME/releases \ + --header "authorization: Bearer $TOKEN" \ + --header 'content-type: application/json' \ + -d@post.json + + rm ./post.json + rm $RELEASE_NOTES + + # delete temp branch + #git push origin --delete $BRANCH_NAME +} + +notify_teams() { +COMMIT_SHA=$(git log --pretty=format:'%h' -n 1) +COMMIT_MESSAGE=$(git log --format=%B -n 1 "$COMMIT_SHA") + +color=0072C6 + curl "$TEAMS_WEBHOOK" -d @- << EOF + { + "@context": "https://schema.org/extensions", + "@type": "MessageCard", + "themeColor": "$color", + "title": "$REPO_NAME | $BRANCH_NAME", + "text": "🎉 Release Ready", + "sections": [ + { + "facts": [ + { + "name": "Branch/tag", + "value": "$BRANCH_NAME" + }, + { + "name": "Commit", + "value": "$COMMIT_SHA ($COMMIT_MESSAGE)" + }, + { + "name": "Pusher", + "value": "$GH_USER_NAME" + }, + { + "name": "Gradle line", + "value": "implementation 'com.kaltura.playkit:youbora:$COMMIT_SHA'" + } + ] + } + ], + "potentialAction": [ + { + "@type": "OpenUri", + "name": "GitHub Release Page", + "targets": [ + { + "os": "default", + "uri": "$RELEASE_URL" + } + ] + } + ] + } +EOF + +} + + RELEASE_TYPE=$RELEASE_TYPE + + export REPO_NAME=$REPO_NAME + MODULE_NAME=$MODULE_NAME + VERSION_FILE=$MODULE_NAME/version.gradle + + REPO_URL=https://github.com/kaltura/$REPO_NAME + export NEW_VERSION=$NEW_VERSION + PREV_VERSION=$PREV_VERSION + TOKEN=$TOKEN + TEAMS_WEBHOOK=$TEAMS_WEBHOOK + + NEW_TAG=v$NEW_VERSION #New Version with 'v' + export PREV_TAG=v$PREV_VERSION #Previous Version with 'v' + RELEASE_URL=$REPO_URL/releases/tag/$NEW_TAG + + if [[ "$RELEASE_TYPE" = "Full" || "$RELEASE_TYPE" = "Update" ]]; then + BRANCH_NAME="release/$NEW_TAG" + fi + + if [ "$RELEASE_TYPE" = "Patch" ]; then + BRANCH_NAME="patch/$NEW_TAG" + fi + + export RELEASE_NOTES="release_notes.md" + RELEASE_NOTES_SCRIPT=".github/release_notes.sh" + GH_USER_NAME="Github Actions Bot KLTR" + + checkout + set_version + build + release_and_tag + notify_teams diff --git a/.github/release_notes.sh b/.github/release_notes.sh new file mode 100644 index 0000000..5c7ad81 --- /dev/null +++ b/.github/release_notes.sh @@ -0,0 +1,54 @@ +#!/bin/bash +# This script generates "release_notes.md". +# It grabs the logs from the previous defined tag till the HEAD +# and do grep of the PULL requests by filtering using '(#' +# While generating a release notes file, it has 3 sections +# 'New Features', 'Bug Fixes' and 'More Changes' + +# STRICT RULES FOR PULL REQUEST SUBJECT LINE: +## 1. 'New Feature' PR should start with 'feat(FEC-***)'. Add '|' Pipe symbol should be added before subject line starts. +## Example: feat(FEC-1234) | PR Subject line +## 2. 'Bug Fixes' PR should start with 'fix(FEC-***)'. Add '|' Pipe symbol should be added before subject line starts. +## Example: fix(FEC-1234) | PR Subject line +## 3. 'Other Changes' PR which is apart from the above can start like +## Example: FEC-1234 | PR Subject line + +nl=$'\n' +touch $RELEASE_NOTES +echo "## Changes from [$PREV_TAG](https://github.com/kaltura/$REPO_NAME/releases/tag/$PREV_TAG)$nl" > $RELEASE_NOTES + +resultedLine=$(git log $PREV_TAG..HEAD --oneline --grep='(#') +if [[ ! -n "$resultedLine" ]]; then + echo "### Plugin Playkit Support$nl v$NEW_VERSION" >> $RELEASE_NOTES +else + git log $PREV_TAG..HEAD --oneline --grep='(#' | cut -d' ' -f2- | while read -r line; do + echo "$line" + + bugFixes="Bug Fixes" + newFeatures="New Features" + moreChanges="More Changes" + + if [[ "$line" == "fix"* || "$line" == "fix(FEC-"* || "$line" == "fix (FEC-"* ]]; then + + grep -qF -- $bugFixes $RELEASE_NOTES || echo "### "$bugFixes$nl >> $RELEASE_NOTES + modifiedLine=$(echo "$line" | sed 's/fix://' | sed 's/fix//' | sed 's|(\(FEC-[^)]*\))|\1|') +sed -i '/'"$bugFixes"'/a\ +'"- $modifiedLine$nl"'' $RELEASE_NOTES + + elif [[ "$line" == "feat"* || "$line" == "feat(FEC-"* || "$line" == "feat (FEC-"* ]]; then + + grep -qF -- $newFeatures $RELEASE_NOTES || echo "### "$newFeatures$nl >> $RELEASE_NOTES + modifiedLine=$(echo "$line" | sed 's/feat://' | sed 's/feat//' | sed 's|(\(FEC-[^)]*\))|\1|') +sed -i '/'"$newFeatures"'/a\ +'"- $modifiedLine$nl"'' $RELEASE_NOTES + + else + grep -qF -- $moreChanges $RELEASE_NOTES || echo "### "$moreChanges$nl >> $RELEASE_NOTES + echo "- $line$nl" >> $RELEASE_NOTES + + fi + done +fi + +echo "### Gradle" >> $RELEASE_NOTES +echo "$nl* \`implementation 'com.kaltura.playkit:youbora:$NEW_VERSION"\'\` >> $RELEASE_NOTES diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..07735d9 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,31 @@ +name: build CI + +on: + push: + branches: [ "develop", "master", "main" ] + pull_request: + branches: [ "develop", "master", "main" ] + workflow_call: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + gradle-build: + environment: Build + runs-on: ubuntu-latest + + steps: + - name: Checkout repo and clone to CI workspace + uses: actions/checkout@v3 + + - name: Setup JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'adopt' + cache: 'gradle' + + - name: Gradle Build... + run: ./gradlew build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..c74a1b8 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,61 @@ +name: publish CI + +on: + workflow_dispatch: + inputs: + release_type: + type: choice + required: true + description: 'Release Type' + options: + - Full + - Patch + new_version: + description: "New Version (Without 'v' Ex: 1.0.0)" + required: true + type: string + prev_version: + description: "Previous Version (Without 'v' Ex: 1.0.0)" + required: true + type: string + +env: + RELEASE_TYPE: ${{ inputs.release_type }} + NEW_VERSION: ${{ inputs.new_version }} + PREV_VERSION: ${{ inputs.prev_version }} + REPO_NAME: ${{ github.event.repository.name }} + NEXUS_USERNAME: ${{ secrets.OSSRH_USERNAME }} + NEXUS_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} + SIGNING_KEYID: ${{ secrets.SIGNING_KEY_ID }} + SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} + MODULE_NAME: ${{ secrets.MODULE_NAME }} + +jobs: + build: + uses: ./.github/workflows/build.yml + + maven-release: + environment: Release + runs-on: ubuntu-latest + needs: build + + steps: + - name: Checkout repo and clone to CI workspace + uses: actions/checkout@v3 + with: + fetch-depth: '0' + + - name: Copy and Decode + run: | + mkdir $PWD/.kltrenv && echo "${{ secrets.SIGNING_KEY }}" > $PWD/.kltrenv/secring.gpg.b64 + base64 -d $PWD/.kltrenv/secring.gpg.b64 > $PWD/.kltrenv/secring.gpg + + - name: Run publish Script + run: | + RELEASE_TYPE=${RELEASE_TYPE} NEW_VERSION=${NEW_VERSION} + PREV_VERSION=${PREV_VERSION} REPO_NAME=${REPO_NAME} + TOKEN=${{ secrets.GITHUB_TOKEN }} MODULE_NAME=${MODULE_NAME} TEAMS_WEBHOOK=${{ secrets.TEAMS_WEBHOOK }} bash .github/publish.sh + + - name: Delete secring file + run: | + rm -rf $PWD/.kltrenv diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 523b809..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: android -dist: trusty -sudo: required -jdk: - - openjdk11 -android: - components: - - tools - - build-tools-31.0.3 - - android-31 -before_script: - - curl https://kaltura.github.io/fe-tools/android/license.sh | sh -script: - - ./gradlew youboraplugin:build -after_failure: - - cat youboraplugin/build/outputs/lint-results-debug.xml -notifications: - email: - recipients: - - noam.tamim@kaltura.com - - gilad.nadav@kaltura.com - - gourav.saxena@kaltura.com - on_success: always - on_failure: always diff --git a/build.gradle b/build.gradle index 15ae44c..474607b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,10 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. +apply plugin: 'io.github.gradle-nexus.publish-plugin' + +ext["nexusUserName"] = System.getenv('NEXUS_USERNAME') +ext["nexusPassword"] = System.getenv('NEXUS_PASSWORD') +ext["signingKeyId"] = System.getenv('SIGNING_KEYID') +ext["signingPassword"] = System.getenv('SIGNING_PASSWORD') buildscript { ext.kotlin_version = '1.7.10' @@ -10,6 +16,7 @@ buildscript { dependencies { classpath 'com.android.tools.build:gradle:7.2.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + classpath 'io.github.gradle-nexus:publish-plugin:1.1.0' } } @@ -21,6 +28,18 @@ allprojects { } } +nexusPublishing { + repositories { + sonaType { + nexusUrl.set(uri("https://oss.sonatype.org/service/local/")) + snapshotRepositoryUrl.set(uri("https://oss.sonatype.org/content/repositories/snapshots/")) + packageGroup = GROUP + username = nexusUserName + password = nexusPassword + } + } +} + task clean(type: Delete) { delete rootProject.buildDir } diff --git a/gradle.properties b/gradle.properties index 4be7299..3cb42c7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -31,3 +31,5 @@ POM_LICENCE_URL=https://www.gnu.org/licenses/agpl-3.0.html POM_LICENCE_DIST=repo POM_DEVELOPER_ID=playkitdev POM_DEVELOPER_NAME=Playkit Dev + +SECRING_PATH=../.kltrenv/secring.gpg diff --git a/travis-push-to-bintray.sh b/travis-push-to-bintray.sh deleted file mode 100755 index 14f96b0..0000000 --- a/travis-push-to-bintray.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash - -# Required env vars: -# TRAVIS_TAG: current tag (e.g. v0.1.2) -# BINTRAY_USER, BINTRAY_KEY - -# Run locally: -# TRAVIS_TAG=v0.1.2 BINTRAY_USER=username BINTRAY_KEY=fjkhsdfka3289r82rkfe ./travis-push-to-bintray.sh - - -LIB=youboraplugin - -DRY_RUN=false - -# Only allow tags -if [ -z "$TRAVIS_TAG" ]; then - echo "Not a Travis tag build; will perform a dry-run." - TRAVIS_TAG=v0.0.0 - DRY_RUN=true -fi - -# Strip the "v" prefix -TAG_VERSION_NAME=${TRAVIS_TAG:1} - -# Only allow proper "digits.digits.digits" versions. -if [[ ! $TAG_VERSION_NAME =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "Not a proper version string; will perform a dry-run." - DRY_RUN=true -fi - -# Check that defined library version matches the tag. -if ! grep -q "ext.libVersion = '$TAG_VERSION_NAME'" $LIB/version.gradle -then - echo "Library version name in build.gradle does not match tag name; will perform a dry-run." - DRY_RUN=true -fi - - -# Assuming a successful build, create javadoc jar, sources jar, pom -./gradlew $LIB:publishReleasePublicationToMavenLocal - -# Upload -./gradlew $LIB:bintrayUpload -PdryRun=$DRY_RUN -PbintrayUser=$BINTRAY_USER -PbintrayKey=$BINTRAY_KEY diff --git a/youboraplugin/gradle-mvn-push.gradle b/youboraplugin/gradle-mvn-push.gradle index a42cf6c..e26cac0 100644 --- a/youboraplugin/gradle-mvn-push.gradle +++ b/youboraplugin/gradle-mvn-push.gradle @@ -16,11 +16,11 @@ def getSnapshotRepositoryUrl() { } def getRepositoryUsername() { - return System.getenv("NEXUS_USERNAME") + return nexusUserName } def getRepositoryPassword() { - return System.getenv("NEXUS_PASSWORD") + return nexusPassword } afterEvaluate { project -> @@ -75,12 +75,12 @@ afterEvaluate { project -> } signing { - allprojects { ext."signing.keyId" = System.getenv("MAVEN_KEYID") } - allprojects { ext."signing.password" = System.getenv("MAVEN_PASSWORD") } - allprojects { ext."signing.secretKeyRingFile" = System.getenv("MAVEN_SECRING_PATH") } + allprojects { ext."signing.keyId" = signingKeyId } + allprojects { ext."signing.password" = signingPassword } + allprojects { ext."signing.secretKeyRingFile" = SECRING_PATH } required { isReleaseBuild() && gradle.taskGraph.hasTask("publish") } - sign publishing.publications.mavenJava + sign publishing.publications } task androidJavadocs(type: Javadoc) { From 03d534822ee4c40f1afa30ec59332a418d28d02c Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Thu, 5 Jan 2023 14:53:14 +0200 Subject: [PATCH 136/143] fix(FEC-12558): add comment continue for commit hash ad890c6b178a9c0f6016d1a32a76c439afdeff4d (#104) --- gradle.properties | 1 + 1 file changed, 1 insertion(+) diff --git a/gradle.properties b/gradle.properties index 3cb42c7..ab4df3b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -32,4 +32,5 @@ POM_LICENCE_DIST=repo POM_DEVELOPER_ID=playkitdev POM_DEVELOPER_NAME=Playkit Dev +# This file will be generated by publish.yml from workflow (.github folder) SECRING_PATH=../.kltrenv/secring.gpg From 6cc05dafff9489a2ea03efc298fcb20444265a2f Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Fri, 6 Jan 2023 13:37:18 +0200 Subject: [PATCH 137/143] fix(12558): fix readme (#105) --- .github/publish.sh | 16 ++++++++++++++-- .github/release_notes.sh | 2 +- README.md | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/publish.sh b/.github/publish.sh index 70fd800..d643eaf 100644 --- a/.github/publish.sh +++ b/.github/publish.sh @@ -34,6 +34,16 @@ set_version() { # Changing the version in version.gradle file perl -pi -e "s/^ext.libVersion.*$/ext.libVersion = '$NEW_VERSION'/" $VERSION_FILE + + # Changing the version in build.gradle file + if [[ "$RELEASE_TYPE" == "Patch" || "$RELEASE_TYPE" == "Update" ]]; then + echo "RELEASE_TYPE = '$RELEASE_TYPE'" + perl -pi -e "s/playkit:playkit:$PLAYKIT_PREV_VERSION/playkit:playkit:$NEW_VERSION/" $BUILD_GRADLE + fi + if [ "$RELEASE_TYPE" == "Full" ]; then + echo "RELEASE_TYPE = '$RELEASE_TYPE'" + perl -pi -e "s/:playkit-android:dev-SNAPSHOT/.playkit:playkit:$NEW_VERSION/" $BUILD_GRADLE + fi } build() { @@ -48,6 +58,7 @@ release_and_tag() { echo Releasing version $NEW_VERSION of $REPO_NAME to GitHub set +e git add $VERSION_FILE + git add $BUILD_GRADLE git commit -m "Update version to $NEW_TAG" set -e git push origin HEAD:$BRANCH_NAME @@ -75,7 +86,7 @@ EOF JSON_BODY="$JSON_BODY$NEW_TAG\n\n" JSON_BODY="$JSON_BODY * upgrade to $NEW_TAG\n\n" JSON_BODY="$JSON_BODY #### Gradle\n\n" - JSON_BODY="$JSON_BODY * implementation 'com.kaltura.playkit:youbora" + JSON_BODY="$JSON_BODY * implementation 'com.kaltura.playkit:youboraplugin" JSON_BODY="$NEW_VERSION" JSON_BODY="$JSON_BODY'" @@ -134,7 +145,7 @@ color=0072C6 }, { "name": "Gradle line", - "value": "implementation 'com.kaltura.playkit:youbora:$COMMIT_SHA'" + "value": "implementation 'com.kaltura.playkit:youboraplugin:$COMMIT_SHA'" } ] } @@ -161,6 +172,7 @@ EOF export REPO_NAME=$REPO_NAME MODULE_NAME=$MODULE_NAME VERSION_FILE=$MODULE_NAME/version.gradle + BUILD_GRADLE=$MODULE_NAME/build.gradle REPO_URL=https://github.com/kaltura/$REPO_NAME export NEW_VERSION=$NEW_VERSION diff --git a/.github/release_notes.sh b/.github/release_notes.sh index 5c7ad81..9e30b5b 100644 --- a/.github/release_notes.sh +++ b/.github/release_notes.sh @@ -51,4 +51,4 @@ sed -i '/'"$newFeatures"'/a\ fi echo "### Gradle" >> $RELEASE_NOTES -echo "$nl* \`implementation 'com.kaltura.playkit:youbora:$NEW_VERSION"\'\` >> $RELEASE_NOTES +echo "$nl* \`implementation 'com.kaltura.playkit:youboraplugin:$NEW_VERSION"\'\` >> $RELEASE_NOTES diff --git a/README.md b/README.md index 6803872..27246f6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![CI Status](https://api.travis-ci.org/kaltura/playkit-android-youbora.svg?branch=develop)](https://travis-ci.org/github/kaltura/playkit-android-youbora) +[![CI Status](https://github.com/kaltura/playkit-android-youbora/actions/workflows/build.yml/badge.svg)](https://github.com/kaltura/playkit-android-youbora/actions/workflows/build.yml) [![Download](https://img.shields.io/maven-central/v/com.kaltura.playkit/youboraplugin?label=Download)](https://search.maven.org/artifact/com.kaltura.playkit/youboraplugin) [![License](https://img.shields.io/badge/license-AGPLv3-black.svg)](https://github.com/kaltura/playkit-android-kava/blob/master/LICENSE) ![Android](https://img.shields.io/badge/platform-android-green.svg) From df14b53e1732ca4def29bdd8801f39a088d22e90 Mon Sep 17 00:00:00 2001 From: Gourav Saxena <38206744+GouravSna@users.noreply.github.com> Date: Wed, 1 Feb 2023 21:04:12 +0530 Subject: [PATCH 138/143] feat(FEC-12917) | Fixed undefined variable (#106) --- .github/publish.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/publish.sh b/.github/publish.sh index d643eaf..5066d61 100644 --- a/.github/publish.sh +++ b/.github/publish.sh @@ -38,7 +38,7 @@ set_version() { # Changing the version in build.gradle file if [[ "$RELEASE_TYPE" == "Patch" || "$RELEASE_TYPE" == "Update" ]]; then echo "RELEASE_TYPE = '$RELEASE_TYPE'" - perl -pi -e "s/playkit:playkit:$PLAYKIT_PREV_VERSION/playkit:playkit:$NEW_VERSION/" $BUILD_GRADLE + perl -pi -e "s/playkit:playkit:$PREV_VERSION/playkit:playkit:$NEW_VERSION/" $BUILD_GRADLE fi if [ "$RELEASE_TYPE" == "Full" ]; then echo "RELEASE_TYPE = '$RELEASE_TYPE'" From 99bd47b4c324dd424b4edad8a9f5c091a9fc5c62 Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Sat, 18 Feb 2023 20:07:45 +0200 Subject: [PATCH 139/143] Update README.md --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 27246f6..1be1626 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,16 @@ player = KalturaOttPlayer.create(this@MainActivity, playerInitOptions) ``` +### Example: + +[Youbora plugin sample](https://github.com/kaltura/playkit-android-samples/blob/c28187bed44d20efe399cae82a48d69e193883ac/Youbora/app/src/main/java/com/kaltura/playkit/samples/youbora/MainActivity.java#L116) +* Inorder to run the sample: + +download [Samples Repo](https://github.com/kaltura/kaltura-player-android-samples/tree/master) +in Android Studio open the Advanced Samples folder and run the youbora sample + #### Build your Youbora config using Bundle + ##### Example for some of the properties the App can send to Youbora plugin. The only must property to send is _your account code_. In case if properties are not sent and if plugin have it internally plugin will set it automatically i.e media title, media resource and more. From 484b160a171892807967d3d4473f59473db8074d Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 24 May 2023 21:39:00 +0300 Subject: [PATCH 140/143] fix(FEC-13183): stop youbora monitoring upon stopped event (#109) --- .../youbora/PKYouboraPlayerAdapter.java | 46 +++++++++++-------- .../plugins/youbora/YouboraPlugin.java | 4 -- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index 5ba31db..2ffdaf8 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -217,26 +217,12 @@ private void addListeners() { onStateChangedEvent(event); }); - messageBus.addListener(this, PlayerEvent.ended, event -> { - printReceivedPlayerEvent(event); - if (isNullAdapter()) { - return; - } - - if (PKAdPluginType.server.equals(getLastReportedAdPluginType())) { - getPlugin().getAdapter().fireStop(); - fireStop(); - isFirstPlay = true; - adCuePoints = null; - } else { - if (!isFirstPlay && ((adCuePoints == null) || !adCuePoints.hasPostRoll())) { - fireStop(); - isFirstPlay = true; - adCuePoints = null; - } - } + messageBus.addListener(this, PlayerEvent.stopped, event -> { + handlePlaybackTeardown(event); + }); - sendReportEvent(event); + messageBus.addListener(this, PlayerEvent.ended, event -> { + handlePlaybackTeardown(event); }); messageBus.addListener(this, PlayerEvent.tracksAvailable, event -> { @@ -358,6 +344,28 @@ private void addListeners() { }); } + private void handlePlaybackTeardown(PKEvent event) { + printReceivedPlayerEvent(event); + if (isNullAdapter()) { + return; + } + + if (PKAdPluginType.server.equals(getLastReportedAdPluginType())) { + getPlugin().getAdapter().fireStop(); + fireStop(); + isFirstPlay = true; + adCuePoints = null; + } else { + if (!isFirstPlay && ((adCuePoints == null) || !adCuePoints.hasPostRoll())) { + fireStop(); + isFirstPlay = true; + adCuePoints = null; + } + } + + sendReportEvent(event); + } + private String getVideoCodecs(List tracks) { Set codecs = new LinkedHashSet<>(); for (VideoTrack track : tracks) { diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java index db25fb4..5b993c9 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/YouboraPlugin.java @@ -123,10 +123,6 @@ private void loadPlugin() { log.d("YouboraPlugin DURATION_CHANGE"); }); - messageBus.addListener(this, PlayerEvent.stopped, event -> { - log.d("YouboraPlugin STOPPED"); - }); - messageBus.addListener(this, InterceptorEvent.cdnSwitched, event -> { if (npawPlugin != null && npawPlugin.getOptions() != null) { log.d("InterceptorEvent.cdnSwitched " + event.getCdnCode()); From 01a1353a2b91d035716cd33d7000aa39a47d80fc Mon Sep 17 00:00:00 2001 From: Gilad Nadav Date: Wed, 21 Jun 2023 22:26:47 +0300 Subject: [PATCH 141/143] fix(FEC-13238): add dataSpec with damaged url if it is available (#110) * FEC-13238 - add data spec for HttpDataSource errors in youbora events --- .../plugins/youbora/PKYouboraPlayerAdapter.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java index 2ffdaf8..da67074 100644 --- a/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java +++ b/youboraplugin/src/main/java/com/kaltura/playkit/plugins/youbora/PKYouboraPlayerAdapter.java @@ -14,6 +14,7 @@ import android.text.TextUtils; +import com.kaltura.android.exoplayer2.upstream.HttpDataSource; import com.kaltura.playkit.BuildConfig; import com.kaltura.playkit.MessageBus; import com.kaltura.playkit.PKAudioCodec; @@ -136,9 +137,11 @@ private void sendErrorHandler(PKEvent event) { if (playerErrorException != null && playerErrorException.getCause() != null && playerErrorException.getCause().getClass() != null) { exceptionClass = playerErrorException.getCause().getClass().getName(); errorMetadata = (playerErrorException.getCause().toString() != null) ? playerErrorException.getCause().toString() : errorMetadata; + errorMetadata = appendDataSpec(errorMetadata, error); } else { if (error.exception.getClass() != null) { exceptionClass = error.exception.getClass().getName(); + errorMetadata = appendDataSpec(errorMetadata, error); } } @@ -161,6 +164,19 @@ private void sendErrorHandler(PKEvent event) { } } + private static String appendDataSpec(String errorMetadata, PKError error) { + if (error.exception instanceof HttpDataSource.HttpDataSourceException) { + errorMetadata += ", " + ((HttpDataSource.HttpDataSourceException) error.exception).dataSpec; + } else if (error.exception instanceof HttpDataSource.InvalidResponseCodeException) { + errorMetadata += ", " + ((HttpDataSource.InvalidResponseCodeException) error.exception).dataSpec; + } else if (error.exception.getCause() instanceof HttpDataSource.HttpDataSourceException) { + errorMetadata += ", " + ((HttpDataSource.HttpDataSourceException) error.exception.getCause()).dataSpec; + } else if (error.exception.getCause() instanceof HttpDataSource.InvalidResponseCodeException) { + errorMetadata += ", " + ((HttpDataSource.InvalidResponseCodeException) error.exception.getCause()).dataSpec; + } + return errorMetadata; + } + public static LinkedHashSet getExceptionMessageChain(Throwable throwable) { LinkedHashSet result = new LinkedHashSet<>(); while (throwable != null) { From 218d602296b235d13167230f0badc1f150c1fc88 Mon Sep 17 00:00:00 2001 From: volodymyr bondarenko Date: Wed, 30 Oct 2024 13:32:09 +0200 Subject: [PATCH 142/143] SUP-42513: (PPF CZ) 3201: NG STB Videolibrary (VOD) error --- youboraplugin/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index 49567ac..fe826d2 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -32,7 +32,7 @@ android { dependencies { //TODO change to latest playkit version after tagging. - implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' + implementation 'com.kaltura:playkit-android:no_vcodec_reuse-SNAPSHOT' //implementation project(":playkit") api 'com.nicepeopleatwork:youboralib:6.8.4' From 9adf59a720702995ef404c0a47d05532de4dd9c1 Mon Sep 17 00:00:00 2001 From: Viktor <> Date: Thu, 21 Nov 2024 15:52:24 +0200 Subject: [PATCH 143/143] Revert "SUP-42513: (PPF CZ) 3201: NG STB Videolibrary (VOD) error" This reverts commit 218d602296b235d13167230f0badc1f150c1fc88. --- youboraplugin/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youboraplugin/build.gradle b/youboraplugin/build.gradle index fe826d2..49567ac 100644 --- a/youboraplugin/build.gradle +++ b/youboraplugin/build.gradle @@ -32,7 +32,7 @@ android { dependencies { //TODO change to latest playkit version after tagging. - implementation 'com.kaltura:playkit-android:no_vcodec_reuse-SNAPSHOT' + implementation 'com.kaltura:playkit-android:dev-SNAPSHOT' //implementation project(":playkit") api 'com.nicepeopleatwork:youboralib:6.8.4'