@24i/smartapps-bigscreen-rnv-build-engine 0.17.27-alpha.2786 → 0.17.27-alpha.2792
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/sdks/sdk-androidtv/sdkAndroidtv.js +5 -7
- package/dist/src/sdks/sdk-tizen/sdkTizen.js +0 -2
- package/dist/src/sdks/sdk-webos/sdkWebos.js +0 -2
- package/dist/src/sdks/sdk-webpack/sdkWebpack.js +0 -2
- package/dist/templates/platforms/androidtv/project/amazoniap/build.gradle +10 -8
- package/dist/templates/platforms/androidtv/project/amazoniap/src/main/kotlin/com/twentyfouri/bridgetv/amazoniap/AmazonIapService.kt +90 -0
- package/dist/templates/platforms/androidtv/project/amazoniap/src/main/kotlin/com/twentyfouri/bridgetv/amazoniap/AmazonIapServiceFactory.kt +13 -0
- package/dist/templates/platforms/androidtv/project/app/build.gradle +26 -26
- package/dist/templates/platforms/androidtv/project/app/proguard-rules.pro +3 -3
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/bridge/BridgeFromJavaScript.kt +6 -0
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/configuration/BridgeConfig.kt +2 -2
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/global/utils/PlayerFactoryBitmovinCustomized.kt +7 -0
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/global/utils/PlayerFactoryConfigured.kt +16 -24
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/global/utils/PlayerFactoryExoPlayerCustomized.kt +6 -1
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/webview/view/WebViewActivity.kt +1 -15
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/webview/viewmodel/WebViewModel.kt +3 -26
- package/dist/templates/platforms/androidtv/project/build.gradle +5 -5
- package/dist/templates/platforms/androidtv/project/common/build.gradle +10 -7
- package/dist/templates/platforms/androidtv/project/googleiap/build.gradle +8 -7
- package/dist/templates/platforms/androidtv/project/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/dist/templates/platforms/androidtv/project/gradle/wrapper/gradle-wrapper.properties +3 -2
- package/dist/templates/platforms/androidtv/project/gradle.properties +0 -1
- package/dist/templates/platforms/androidtv/project/gradlew +176 -110
- package/dist/templates/platforms/androidtv/project/gradlew.bat +24 -34
- package/package.json +1 -1
- package/dist/src/utils/copyTheoPlayerLibs.js +0 -48
- package/dist/templates/platforms/androidtv/project/amazoniap/libs/in-app-purchasing-2.0.76.jar +0 -0
- package/dist/templates/platforms/androidtv/project/amazoniap/src/main/java/com/twentyfouri/bridgetv/amazoniap/AmazonIapSevice.kt +0 -106
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/global/utils/PlayerFactoryTheoPlayerCustomized.kt +0 -14
|
@@ -39,7 +39,6 @@ const sdk_webpack_2 = require("../sdk-webpack");
|
|
|
39
39
|
const sdk_utils_1 = require("../sdk-utils");
|
|
40
40
|
const services_1 = require("../sdk-utils/sdk-installer/services");
|
|
41
41
|
const resolvers_1 = require("../../resolvers");
|
|
42
|
-
const copyTheoPlayerLibs_1 = require("../../utils/copyTheoPlayerLibs");
|
|
43
42
|
const copyEnvironmentFolder_1 = require("../../utils/copyEnvironmentFolder");
|
|
44
43
|
const constants_1 = require("../../constants");
|
|
45
44
|
const buildGradleFileName = 'build.gradle';
|
|
@@ -143,7 +142,7 @@ const configureProject = (c) => {
|
|
|
143
142
|
const appId = rnv_1.Common.getConfigProp(c, c.platform, 'id', '');
|
|
144
143
|
const minSdkVersion = rnv_1.Common.getConfigProp(c, c.platform, 'minSdkVersion', 21);
|
|
145
144
|
const targetSdkVersion = rnv_1.Common.getConfigProp(c, c.platform, 'targetSdkVersion', 34);
|
|
146
|
-
const compileSdkVersion = rnv_1.Common.getConfigProp(c, c.platform, 'compileSdkVersion',
|
|
145
|
+
const compileSdkVersion = rnv_1.Common.getConfigProp(c, c.platform, 'compileSdkVersion', 36);
|
|
147
146
|
let versionCode = rnv_1.Common.getConfigProp(c, c.platform, 'versionCode');
|
|
148
147
|
if (typeof versionCode === 'undefined') {
|
|
149
148
|
const major = `${semVerObj.major}`.padStart(2, '0');
|
|
@@ -196,8 +195,8 @@ const configureEntryUrl = (c) => {
|
|
|
196
195
|
rnv_1.Logger.logTask('configureEntryUrl');
|
|
197
196
|
const buildGradleFilePath = path.join(rnv_1.Common.getPlatformProjectDir(c), 'app', buildGradleFileName);
|
|
198
197
|
const entryUrl = getHostedAppEntryUrl(c);
|
|
199
|
-
const
|
|
200
|
-
|| rnv_1.Common.getConfigProp(c, c.platform, '
|
|
198
|
+
const bitmovinLicense = process.env.BITMOVIN_LICENSE
|
|
199
|
+
|| rnv_1.Common.getConfigProp(c, c.platform, 'bitmovinLicense', '');
|
|
201
200
|
const npawAccountCode = process.env.NPAW_ACCOUNT_CODE
|
|
202
201
|
|| rnv_1.Common.getConfigProp(c, c.platform, 'npawAccountCode', '');
|
|
203
202
|
const enableImaSdk = !!rnv_1.Common.getConfigProp(c, c.platform, 'enableImaSdk', false);
|
|
@@ -205,8 +204,8 @@ const configureEntryUrl = (c) => {
|
|
|
205
204
|
pattern: '{{APP_URL}}',
|
|
206
205
|
override: entryUrl,
|
|
207
206
|
}, {
|
|
208
|
-
pattern: '{{
|
|
209
|
-
override:
|
|
207
|
+
pattern: '{{BITMOVIN_LICENSE}}',
|
|
208
|
+
override: bitmovinLicense,
|
|
210
209
|
}, {
|
|
211
210
|
pattern: '{{NPAW_ACCOUNT_CODE}}',
|
|
212
211
|
override: npawAccountCode,
|
|
@@ -246,7 +245,6 @@ const configureAndroidTVProject = async (c) => {
|
|
|
246
245
|
fs.chmodSync(gradlew, '755');
|
|
247
246
|
await rnv_1.ProjectManager.copyBuildsFolder(c, platform);
|
|
248
247
|
(0, copyEnvironmentFolder_1.copyEnvFolderInPublicConfig)(c);
|
|
249
|
-
(0, copyTheoPlayerLibs_1.copyTheoPlayerLibs)(c);
|
|
250
248
|
};
|
|
251
249
|
exports.configureAndroidTVProject = configureAndroidTVProject;
|
|
252
250
|
const getSdkInstallerUrl = () => {
|
|
@@ -33,7 +33,6 @@ const rnv_1 = require("rnv");
|
|
|
33
33
|
const sdk_webpack_1 = require("@rnv/sdk-webpack");
|
|
34
34
|
const sdk_webpack_2 = require("../sdk-webpack");
|
|
35
35
|
const sdk_utils_1 = require("../sdk-utils");
|
|
36
|
-
const copyTheoPlayerLibs_1 = require("../../utils/copyTheoPlayerLibs");
|
|
37
36
|
const copyEnvironmentFolder_1 = require("../../utils/copyEnvironmentFolder");
|
|
38
37
|
const constants_1 = require("../../constants");
|
|
39
38
|
const { createDevelopTizenCertificate, DEFAULT_CERTIFICATE_NAME, DEFAULT_SECURITY_PROFILE_NAME, } = rnv_1.SDKManager.Tizen;
|
|
@@ -94,7 +93,6 @@ const configureTizenProject = async (c) => {
|
|
|
94
93
|
configureProject(c);
|
|
95
94
|
await rnv_1.ProjectManager.copyBuildsFolder(c, platform);
|
|
96
95
|
(0, copyEnvironmentFolder_1.copyEnvFolderInPublicConfig)(c);
|
|
97
|
-
(0, copyTheoPlayerLibs_1.copyTheoPlayerLibs)(c);
|
|
98
96
|
};
|
|
99
97
|
exports.configureTizenProject = configureTizenProject;
|
|
100
98
|
const handleLinuxKeyring = () => {
|
|
@@ -31,7 +31,6 @@ const rnv_1 = require("rnv");
|
|
|
31
31
|
const sdk_webpack_1 = require("@rnv/sdk-webpack");
|
|
32
32
|
const sdk_webpack_2 = require("../sdk-webpack");
|
|
33
33
|
const sdk_utils_1 = require("../sdk-utils");
|
|
34
|
-
const copyTheoPlayerLibs_1 = require("../../utils/copyTheoPlayerLibs");
|
|
35
34
|
const copyEnvironmentFolder_1 = require("../../utils/copyEnvironmentFolder");
|
|
36
35
|
const constants_1 = require("../../constants");
|
|
37
36
|
const buildWebOSProject = async (c) => {
|
|
@@ -67,7 +66,6 @@ const configureWebOSProject = async (c) => {
|
|
|
67
66
|
configureProject(c);
|
|
68
67
|
await rnv_1.ProjectManager.copyBuildsFolder(c, platform);
|
|
69
68
|
(0, copyEnvironmentFolder_1.copyEnvFolderInPublicConfig)(c);
|
|
70
|
-
(0, copyTheoPlayerLibs_1.copyTheoPlayerLibs)(c);
|
|
71
69
|
};
|
|
72
70
|
exports.configureWebOSProject = configureWebOSProject;
|
|
73
71
|
const sdkInstallerUUrl = 'https://s3.amazonaws.com/tools.nxg-bigscreen.24imedia.com/sdks/webos/ares_webos_builder_v1.10.4_multiplatform.zip';
|
|
@@ -9,7 +9,6 @@ const ip_1 = __importDefault(require("ip"));
|
|
|
9
9
|
const rnv_1 = require("rnv");
|
|
10
10
|
const sdk_webpack_1 = require("@rnv/sdk-webpack");
|
|
11
11
|
const resolvers_1 = require("../../resolvers");
|
|
12
|
-
const copyTheoPlayerLibs_1 = require("../../utils/copyTheoPlayerLibs");
|
|
13
12
|
const copyEnvironmentFolder_1 = require("../../utils/copyEnvironmentFolder");
|
|
14
13
|
const configureWebProject = async (c) => {
|
|
15
14
|
rnv_1.Logger.logTask('configureWebProject');
|
|
@@ -22,7 +21,6 @@ const configureWebProject = async (c) => {
|
|
|
22
21
|
await (0, sdk_webpack_1.configureCoreWebProject)(c);
|
|
23
22
|
await rnv_1.ProjectManager.copyBuildsFolder(c, platform);
|
|
24
23
|
(0, copyEnvironmentFolder_1.copyEnvFolderInPublicConfig)(c);
|
|
25
|
-
(0, copyTheoPlayerLibs_1.copyTheoPlayerLibs)(c);
|
|
26
24
|
};
|
|
27
25
|
exports.configureWebProject = configureWebProject;
|
|
28
26
|
const getWebpackPath = () => {
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
plugins {
|
|
2
|
+
id 'com.android.library'
|
|
3
|
+
id 'kotlin-android'
|
|
4
|
+
}
|
|
3
5
|
|
|
4
6
|
android {
|
|
5
7
|
namespace = "com.twentyfouri.androidtv.amazoniap"
|
|
6
|
-
compileSdk =
|
|
8
|
+
compileSdk = 36
|
|
7
9
|
|
|
8
10
|
compileOptions {
|
|
9
11
|
sourceCompatibility JavaVersion.VERSION_17
|
|
10
12
|
targetCompatibility JavaVersion.VERSION_17
|
|
11
13
|
}
|
|
14
|
+
kotlinOptions {
|
|
15
|
+
jvmTarget = '17'
|
|
16
|
+
}
|
|
12
17
|
|
|
13
18
|
defaultConfig {
|
|
14
19
|
minSdk = 21
|
|
@@ -30,9 +35,6 @@ android {
|
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
dependencies {
|
|
33
|
-
|
|
34
|
-
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
35
|
-
implementation 'androidx.core:core-ktx:1.13.1'
|
|
36
|
-
implementation 'androidx.appcompat:appcompat:1.7.0'
|
|
38
|
+
implementation 'com.amazon.device:amazon-appstore-sdk:3.0.7'
|
|
37
39
|
implementation project(':common')
|
|
38
|
-
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
package com.twentyfouri.bridgetv.amazoniap
|
|
2
|
+
|
|
3
|
+
import android.app.Activity
|
|
4
|
+
import android.content.Context
|
|
5
|
+
import com.amazon.device.iap.PurchasingListener
|
|
6
|
+
import com.amazon.device.iap.PurchasingService
|
|
7
|
+
import com.amazon.device.iap.model.FulfillmentResult
|
|
8
|
+
import com.amazon.device.iap.model.ProductDataResponse
|
|
9
|
+
import com.amazon.device.iap.model.PurchaseResponse
|
|
10
|
+
import com.amazon.device.iap.model.PurchaseUpdatesResponse
|
|
11
|
+
import com.amazon.device.iap.model.UserDataResponse
|
|
12
|
+
import com.twentyfouri.tvbridge.common.IapCallback
|
|
13
|
+
import com.twentyfouri.tvbridge.common.IapException
|
|
14
|
+
import com.twentyfouri.tvbridge.common.IapProduct
|
|
15
|
+
import com.twentyfouri.tvbridge.common.IapPurchase
|
|
16
|
+
import com.twentyfouri.tvbridge.common.IapService
|
|
17
|
+
|
|
18
|
+
class AmazonIapService(private val context: Context) : IapService, PurchasingListener {
|
|
19
|
+
private var callback: IapCallback? = null
|
|
20
|
+
|
|
21
|
+
override fun initialize() {
|
|
22
|
+
PurchasingService.registerListener(context, this)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
override fun destroy() = Unit
|
|
26
|
+
|
|
27
|
+
override fun setCallback(callback: IapCallback?) {
|
|
28
|
+
this.callback = callback
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
override fun onUserDataResponse(result: UserDataResponse) = Unit
|
|
32
|
+
|
|
33
|
+
override fun checkNewPurchases() {
|
|
34
|
+
PurchasingService.getPurchaseUpdates(true)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
override fun onPurchaseUpdatesResponse(result: PurchaseUpdatesResponse) {
|
|
38
|
+
if (result.requestStatus == PurchaseUpdatesResponse.RequestStatus.SUCCESSFUL) {
|
|
39
|
+
callback?.checkNewPurchasesFinished(
|
|
40
|
+
result.receipts.map { receipt ->
|
|
41
|
+
IapPurchase(receipt.sku, result.userData.userId, receipt.receiptId)
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
} else {
|
|
45
|
+
callback?.checkNewPurchasesFinished(IapException(result.requestStatus.name))
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
override fun purchase(activity: Activity, sku: String) {
|
|
50
|
+
PurchasingService.purchase(sku)
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
override fun onPurchaseResponse(result: PurchaseResponse) {
|
|
54
|
+
if (result.requestStatus == PurchaseResponse.RequestStatus.SUCCESSFUL) {
|
|
55
|
+
callback?.purchaseFinished(
|
|
56
|
+
IapPurchase(result.receipt.sku, result.userData.userId, result.receipt.receiptId)
|
|
57
|
+
)
|
|
58
|
+
} else {
|
|
59
|
+
callback?.purchaseFinished(IapException(result.requestStatus.name))
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
override fun getProducts(skus: List<String>) {
|
|
64
|
+
PurchasingService.getProductData(skus.toSet())
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
override fun onProductDataResponse(result: ProductDataResponse) {
|
|
68
|
+
if (result.requestStatus == ProductDataResponse.RequestStatus.SUCCESSFUL) {
|
|
69
|
+
callback?.getProductsFinished(
|
|
70
|
+
result.productData.values.map {
|
|
71
|
+
IapProduct(
|
|
72
|
+
it.title.orEmpty(),
|
|
73
|
+
it.description.orEmpty(),
|
|
74
|
+
it.price.orEmpty(),
|
|
75
|
+
it.smallIconUrl.orEmpty(),
|
|
76
|
+
it.productType.name,
|
|
77
|
+
it.sku
|
|
78
|
+
)
|
|
79
|
+
},
|
|
80
|
+
result.unavailableSkus.toList()
|
|
81
|
+
)
|
|
82
|
+
} else {
|
|
83
|
+
callback?.getProductsFinished(IapException(result.requestStatus.name))
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
override fun acknowledgeReceipt(receipt: String) {
|
|
88
|
+
PurchasingService.notifyFulfillment(receipt, FulfillmentResult.FULFILLED)
|
|
89
|
+
}
|
|
90
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
package com.twentyfouri.bridgetv.amazoniap
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import android.os.Build
|
|
5
|
+
import com.twentyfouri.tvbridge.common.IapServiceFactory
|
|
6
|
+
import com.twentyfouri.tvbridge.common.installerPackageName
|
|
7
|
+
|
|
8
|
+
object AmazonIapServiceFactory : IapServiceFactory {
|
|
9
|
+
override fun detectSupport(context: Context) =
|
|
10
|
+
context.installerPackageName == "com.amazon.venezia" || Build.MANUFACTURER == "Amazon"
|
|
11
|
+
|
|
12
|
+
override fun build(context: Context) = AmazonIapService(context)
|
|
13
|
+
}
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
plugins {
|
|
2
|
+
id 'com.android.application'
|
|
3
|
+
id 'kotlin-android'
|
|
4
|
+
id 'kotlin-kapt'
|
|
5
|
+
}
|
|
4
6
|
|
|
5
|
-
def
|
|
6
|
-
def
|
|
7
|
+
def bitmovinLicense = '{{BITMOVIN_LICENSE}}'
|
|
8
|
+
def useBitmovin = bitmovinLicense != ''
|
|
7
9
|
def npawAccountCode = '{{NPAW_ACCOUNT_CODE}}'
|
|
8
10
|
def useNpawPlugin = npawAccountCode != ''
|
|
9
11
|
def useImaSdk = {{ENABLE_IMA_SDK}}
|
|
10
12
|
|
|
13
|
+
def player_version = '0.8.0-alpha.19'
|
|
14
|
+
|
|
11
15
|
android {
|
|
12
16
|
namespace = 'com.twentyfouri.tvbridge'
|
|
13
17
|
compileSdk = {{COMPILE_SDK_VERSION}}
|
|
@@ -17,7 +21,6 @@ android {
|
|
|
17
21
|
sourceCompatibility JavaVersion.VERSION_17
|
|
18
22
|
targetCompatibility JavaVersion.VERSION_17
|
|
19
23
|
}
|
|
20
|
-
|
|
21
24
|
kotlinOptions {
|
|
22
25
|
jvmTarget = '17'
|
|
23
26
|
freeCompilerArgs = ['-Xjvm-default=all-compatibility']
|
|
@@ -40,7 +43,7 @@ android {
|
|
|
40
43
|
multiDexEnabled true
|
|
41
44
|
|
|
42
45
|
buildConfigField "String", "APP_URL", '"{{APP_URL}}"'
|
|
43
|
-
buildConfigField "String", "
|
|
46
|
+
buildConfigField "String", "BITMOVIN_LICENSE", "\"$bitmovinLicense\""
|
|
44
47
|
buildConfigField "String", "NPAW_ACCOUNT_CODE", "\"$npawAccountCode\""
|
|
45
48
|
buildConfigField "Boolean", "startWithHighVideoQuality", "true"
|
|
46
49
|
}
|
|
@@ -82,36 +85,35 @@ android {
|
|
|
82
85
|
{{SIGNING_CONFIG_REF}}
|
|
83
86
|
}
|
|
84
87
|
}
|
|
88
|
+
lintOptions {
|
|
89
|
+
disable "Instantiatable"
|
|
90
|
+
}
|
|
85
91
|
}
|
|
86
92
|
|
|
87
93
|
dependencies {
|
|
88
94
|
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
|
|
89
95
|
|
|
90
|
-
implementation
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
96
|
+
implementation project(':common')
|
|
97
|
+
|
|
98
|
+
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
|
|
99
|
+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.2"
|
|
94
100
|
|
|
95
101
|
compileOnly "javax.annotation:jsr250-api:1.0"
|
|
96
|
-
implementation 'androidx.core:core-ktx:1.13.1'
|
|
97
|
-
implementation "androidx.appcompat:appcompat:1.7.0"
|
|
98
102
|
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
|
|
99
103
|
|
|
100
|
-
implementation "com.google.dagger:dagger:2.56.
|
|
101
|
-
kapt "com.google.dagger:dagger-compiler:2.56.
|
|
104
|
+
implementation "com.google.dagger:dagger:2.56.2"
|
|
105
|
+
kapt "com.google.dagger:dagger-compiler:2.56.2"
|
|
102
106
|
|
|
103
|
-
implementation "com.squareup.retrofit2:retrofit:2.
|
|
104
|
-
implementation "com.squareup.retrofit2:converter-gson:2.
|
|
107
|
+
implementation "com.squareup.retrofit2:retrofit:2.11.0"
|
|
108
|
+
implementation "com.squareup.retrofit2:converter-gson:2.11.0"
|
|
105
109
|
implementation "com.squareup.okhttp3:logging-interceptor:4.12.0"
|
|
106
110
|
implementation "com.squareup.okhttp3:okhttp:4.12.0"
|
|
107
|
-
if (
|
|
108
|
-
compileOnly "com.twentyfouri.player:exoplayer
|
|
109
|
-
implementation "com.twentyfouri.player:
|
|
110
|
-
implementation "com.theoplayer.theoplayer-sdk-android:core:8.2.0"
|
|
111
|
+
if (useBitmovin) {
|
|
112
|
+
compileOnly "com.twentyfouri.player:exoplayer:$player_version"
|
|
113
|
+
implementation "com.twentyfouri.player:bitmovin:$player_version"
|
|
111
114
|
} else {
|
|
112
|
-
implementation "com.twentyfouri.player:exoplayer
|
|
113
|
-
compileOnly "com.twentyfouri.player:
|
|
114
|
-
compileOnly "com.theoplayer.theoplayer-sdk-android:core:8.2.0"
|
|
115
|
+
implementation "com.twentyfouri.player:exoplayer:$player_version"
|
|
116
|
+
compileOnly "com.twentyfouri.player:bitmovin:$player_version"
|
|
115
117
|
}
|
|
116
118
|
|
|
117
119
|
if (useNpawPlugin) {
|
|
@@ -128,7 +130,5 @@ dependencies {
|
|
|
128
130
|
implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.36.0'
|
|
129
131
|
}
|
|
130
132
|
|
|
131
|
-
implementation project(':common')
|
|
132
|
-
|
|
133
133
|
implementation "com.google.android.gms:play-services-ads-identifier:18.2.0"
|
|
134
134
|
}
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
-keep class com.amazon.** {*;}
|
|
30
30
|
-keepattributes *Annotation*
|
|
31
31
|
|
|
32
|
-
-keep class com.
|
|
33
|
-
-dontwarn com.
|
|
32
|
+
-keep class com.bitmovin.** {*;}
|
|
33
|
+
-dontwarn com.bitmovin.**
|
|
34
34
|
-keep public class com.google.android.gms.* { public *; }
|
|
35
35
|
-dontwarn com.google.android.gms.**
|
|
36
36
|
|
|
@@ -44,4 +44,4 @@
|
|
|
44
44
|
-keep class com.google.ads.interactivemedia.** { *; }
|
|
45
45
|
-keep interface com.google.ads.interactivemedia.** { *; }
|
|
46
46
|
|
|
47
|
-
-optimizationpasses 1
|
|
47
|
+
-optimizationpasses 1
|
|
@@ -386,6 +386,12 @@ class BridgeFromJavaScript(
|
|
|
386
386
|
@JavascriptInterface
|
|
387
387
|
fun bridgeJavaScriptToAndroid_GetLimitAdTracking() = viewModel.limitAdTracking
|
|
388
388
|
|
|
389
|
+
/***
|
|
390
|
+
* Bridget JS 2 Android to get default OS language
|
|
391
|
+
*/
|
|
392
|
+
@JavascriptInterface
|
|
393
|
+
fun bridgeJavaScriptToAndroid_GetOsLanguage() = viewModel.language
|
|
394
|
+
|
|
389
395
|
companion object {
|
|
390
396
|
const val LOG_TAG = "JavaScriptBridge"
|
|
391
397
|
val DISABLED_AUDIO_TRACK = JsonObject().apply {
|
|
@@ -13,6 +13,6 @@ class BridgeConfig {
|
|
|
13
13
|
var iapEventPrefix: String = ""
|
|
14
14
|
var customizableUrl: Boolean = BuildConfig.DEBUG
|
|
15
15
|
var startWithHighVideoQuality: Boolean = false
|
|
16
|
-
var
|
|
16
|
+
var bitmovinLicense: String = BuildConfig.BITMOVIN_LICENSE
|
|
17
17
|
var npawAccount: String = BuildConfig.NPAW_ACCOUNT_CODE
|
|
18
|
-
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
package com.twentyfouri.tvbridge.global.utils
|
|
2
|
+
|
|
3
|
+
import com.twentyfouri.player.bitmovin.PlayerFactoryBitmovin
|
|
4
|
+
import com.twentyfouri.tvbridge.configuration.BridgeConfig
|
|
5
|
+
|
|
6
|
+
class PlayerFactoryBitmovinCustomized(config: BridgeConfig) :
|
|
7
|
+
PlayerFactoryBitmovin(config.bitmovinLicense), PlayerFactoryVersion
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
package com.twentyfouri.tvbridge.global.utils
|
|
2
2
|
|
|
3
|
-
import com.twentyfouri.player.base
|
|
4
|
-
import com.twentyfouri.player.theoplayer.PlayerFactoryTheoPlayer
|
|
3
|
+
import com.twentyfouri.player.base.PlayerFactoryBase
|
|
5
4
|
import com.twentyfouri.tvbridge.configuration.BridgeConfig
|
|
6
5
|
|
|
7
6
|
object PlayerFactoryConfigured {
|
|
8
|
-
|
|
9
7
|
fun buildFactory(bridgeConfig: BridgeConfig): PlayerFactoryBase {
|
|
10
8
|
var factory: PlayerFactoryBase? = null
|
|
11
|
-
if (bridgeConfig.
|
|
12
|
-
factory = factory ?:
|
|
9
|
+
if (bridgeConfig.bitmovinLicense.isNotEmpty()) {
|
|
10
|
+
factory = factory ?: buildBitmovinFactory(bridgeConfig)
|
|
13
11
|
}
|
|
14
12
|
if (bridgeConfig.npawAccount.isNotEmpty()) {
|
|
15
13
|
factory = factory ?: buildNpawFactory(bridgeConfig)
|
|
@@ -18,27 +16,21 @@ object PlayerFactoryConfigured {
|
|
|
18
16
|
return factory ?: throw Exception("Cannot create player factory")
|
|
19
17
|
}
|
|
20
18
|
|
|
21
|
-
private fun buildExoFactory(bridgeConfig: BridgeConfig)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return null
|
|
26
|
-
}
|
|
19
|
+
private fun buildExoFactory(bridgeConfig: BridgeConfig) = try {
|
|
20
|
+
PlayerFactoryExoPlayerCustomized(bridgeConfig)
|
|
21
|
+
} catch (e: NoClassDefFoundError) {
|
|
22
|
+
null
|
|
27
23
|
}
|
|
28
24
|
|
|
29
|
-
private fun buildNpawFactory(bridgeConfig: BridgeConfig)
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return null
|
|
34
|
-
}
|
|
25
|
+
private fun buildNpawFactory(bridgeConfig: BridgeConfig) = try {
|
|
26
|
+
PlayerFactoryExoPlayerNpaw(bridgeConfig)
|
|
27
|
+
} catch (e: NoClassDefFoundError) {
|
|
28
|
+
null
|
|
35
29
|
}
|
|
36
30
|
|
|
37
|
-
private fun
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return null
|
|
42
|
-
}
|
|
31
|
+
private fun buildBitmovinFactory(bridgeConfig: BridgeConfig) = try {
|
|
32
|
+
PlayerFactoryBitmovinCustomized(bridgeConfig)
|
|
33
|
+
} catch (e: NoClassDefFoundError) {
|
|
34
|
+
null
|
|
43
35
|
}
|
|
44
|
-
}
|
|
36
|
+
}
|
|
@@ -7,12 +7,14 @@ import com.google.android.exoplayer2.drm.DefaultDrmSessionManager
|
|
|
7
7
|
import com.google.android.exoplayer2.drm.DrmSessionManager
|
|
8
8
|
import com.google.android.exoplayer2.drm.FrameworkMediaDrm
|
|
9
9
|
import com.google.android.exoplayer2.drm.MediaDrmCallback
|
|
10
|
+
import com.google.android.exoplayer2.ext.ima.ImaAdsLoader
|
|
10
11
|
import com.google.android.exoplayer2.upstream.HttpDataSource
|
|
11
12
|
import com.google.android.exoplayer2.upstream.LoadErrorHandlingPolicy
|
|
12
13
|
import com.twentyfouri.player.base.DrmPlayready
|
|
13
14
|
import com.twentyfouri.player.base.DrmWidevine
|
|
14
15
|
import com.twentyfouri.player.base.Source
|
|
15
16
|
import com.twentyfouri.player.base.SourceDrm
|
|
17
|
+
import com.twentyfouri.player.base.TimeProvider
|
|
16
18
|
import com.twentyfouri.player.exoplayer.*
|
|
17
19
|
import com.twentyfouri.tvbridge.configuration.BridgeConfig
|
|
18
20
|
|
|
@@ -44,7 +46,10 @@ class PlayerFactoryExoPlayerCustomized(
|
|
|
44
46
|
DefaultMediaSourceFactoryProvider().also {
|
|
45
47
|
it.useLiveMediaTailorWorkaround = true
|
|
46
48
|
}
|
|
47
|
-
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
override val focusSkipButton: Boolean
|
|
52
|
+
get() = false
|
|
48
53
|
}
|
|
49
54
|
|
|
50
55
|
private inner class CustomizedPlayerComponents(shared: SharedComponents) : DefaultPlayerComponents(shared) {
|
|
@@ -11,10 +11,6 @@ import android.text.TextWatcher
|
|
|
11
11
|
import android.util.Log
|
|
12
12
|
import android.view.KeyEvent
|
|
13
13
|
import android.view.View
|
|
14
|
-
import android.view.ViewTreeObserver
|
|
15
|
-
import android.webkit.WebView
|
|
16
|
-
import com.twentyfouri.tvbridge.R
|
|
17
|
-
import com.twentyfouri.tvbridge.webview.client.BridgeWebView
|
|
18
14
|
import android.view.View.MeasureSpec
|
|
19
15
|
import android.view.WindowManager
|
|
20
16
|
import android.view.inputmethod.InputMethodManager
|
|
@@ -82,15 +78,6 @@ class WebViewActivity : AppCompatActivity(), Mainview {
|
|
|
82
78
|
|
|
83
79
|
loadUrl(config.baseUrl)
|
|
84
80
|
|
|
85
|
-
val mainWebView = findViewById<WebView>(R.id.webview)
|
|
86
|
-
|
|
87
|
-
window.decorView.viewTreeObserver.addOnGlobalFocusChangeListener { oldFocus: View?, newFocus: View? ->
|
|
88
|
-
if (newFocus is WebView) {
|
|
89
|
-
Log.d("FocusDebug", "WebView získal focus, vracím zpět na hlavní view")
|
|
90
|
-
mainWebView.requestFocus()
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
81
|
initialized = true
|
|
95
82
|
}
|
|
96
83
|
|
|
@@ -243,7 +230,6 @@ class WebViewActivity : AppCompatActivity(), Mainview {
|
|
|
243
230
|
|
|
244
231
|
override fun loadUrl(url: String?) {
|
|
245
232
|
if (url.isNullOrEmpty()) return
|
|
246
|
-
|
|
247
233
|
binding.webview.visibility = View.VISIBLE
|
|
248
234
|
binding.webview.loadUrl(url)
|
|
249
235
|
if (url.startsWith("http")) {
|
|
@@ -256,4 +242,4 @@ class WebViewActivity : AppCompatActivity(), Mainview {
|
|
|
256
242
|
setCookiePolicy(CookiePolicy.ACCEPT_ALL)
|
|
257
243
|
}
|
|
258
244
|
}
|
|
259
|
-
}
|
|
245
|
+
}
|
|
@@ -18,7 +18,6 @@ import com.google.android.gms.common.GooglePlayServicesNotAvailableException
|
|
|
18
18
|
import com.google.gson.JsonArray
|
|
19
19
|
import com.google.gson.JsonObject
|
|
20
20
|
import com.twentyfouri.player.base.*
|
|
21
|
-
import com.twentyfouri.player.theoplayer.PlayerTheoPlayer
|
|
22
21
|
import com.twentyfouri.tvbridge.BuildConfig
|
|
23
22
|
import com.twentyfouri.tvbridge.Flavor
|
|
24
23
|
import com.twentyfouri.tvbridge.bridge.BridgeFromJavaScript
|
|
@@ -39,6 +38,7 @@ import org.json.JSONArray
|
|
|
39
38
|
import org.json.JSONException
|
|
40
39
|
import org.json.JSONObject
|
|
41
40
|
import java.net.NetworkInterface
|
|
41
|
+
import java.util.Locale
|
|
42
42
|
import javax.inject.Inject
|
|
43
43
|
|
|
44
44
|
/**
|
|
@@ -597,10 +597,6 @@ class WebViewModel @Inject constructor(
|
|
|
597
597
|
mediaInfo.put("liveLatency", metrics.liveLatency)
|
|
598
598
|
}
|
|
599
599
|
}
|
|
600
|
-
if (config.theoLicense.isNotEmpty()) {
|
|
601
|
-
detectMediaInfoTheo(mediaInfo, player)
|
|
602
|
-
}
|
|
603
|
-
|
|
604
600
|
} catch (e: JSONException) {
|
|
605
601
|
mediaInfo.put("errorType", e.javaClass.simpleName)
|
|
606
602
|
mediaInfo.put("errorMessage", e.message)
|
|
@@ -608,27 +604,6 @@ class WebViewModel @Inject constructor(
|
|
|
608
604
|
return mediaInfo
|
|
609
605
|
}
|
|
610
606
|
|
|
611
|
-
private fun detectMediaInfoTheo(mediaInfo: JSONObject, player: PlayerBase) {
|
|
612
|
-
try {
|
|
613
|
-
val theoPlayer = (player as? PlayerTheoPlayer)?.theoPlayer ?: return
|
|
614
|
-
theoPlayer.player.buffered.also {
|
|
615
|
-
if (it.length() > 0) {
|
|
616
|
-
mediaInfo.put("bufferLevel", it.getEnd(it.length() - 1))
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
theoPlayer.player.metrics?.also { theoMetrics ->
|
|
620
|
-
mediaInfo.put("bufferedSegments", theoMetrics.bufferedSegments.amountOfBufferedVideoSegments)
|
|
621
|
-
mediaInfo.put("droppedVideoFrames", theoMetrics.droppedVideoFrames)
|
|
622
|
-
mediaInfo.put("corruptedVideoFrames", theoMetrics.corruptedVideoFrames)
|
|
623
|
-
mediaInfo.put("estimatedBandwidth", theoMetrics.currentBandwidthEstimate)
|
|
624
|
-
mediaInfo.put("totalDataLoaded", theoMetrics.totalBytesLoaded)
|
|
625
|
-
|
|
626
|
-
}
|
|
627
|
-
} catch (e: NoClassDefFoundError) {
|
|
628
|
-
// ignore
|
|
629
|
-
}
|
|
630
|
-
}
|
|
631
|
-
|
|
632
607
|
val adId get() = try {
|
|
633
608
|
// Let's try Google first
|
|
634
609
|
AdvertisingIdClient.getAdvertisingIdInfo(context).id
|
|
@@ -653,6 +628,8 @@ class WebViewModel @Inject constructor(
|
|
|
653
628
|
}
|
|
654
629
|
}
|
|
655
630
|
|
|
631
|
+
val language get() = Locale.getDefault().language
|
|
632
|
+
|
|
656
633
|
private inner class InnerIapCallback : IapCallback {
|
|
657
634
|
override fun checkNewPurchasesFinished(result: List<IapPurchase>) {
|
|
658
635
|
// not actually used at the moment
|
|
@@ -6,7 +6,7 @@ buildscript {
|
|
|
6
6
|
mavenCentral()
|
|
7
7
|
}
|
|
8
8
|
dependencies {
|
|
9
|
-
classpath 'com.android.tools.build:gradle:8.9.
|
|
9
|
+
classpath 'com.android.tools.build:gradle:8.9.2'
|
|
10
10
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
|
11
11
|
classpath 'com.google.gms:google-services:4.4.2'
|
|
12
12
|
classpath 'com.google.firebase:firebase-crashlytics-gradle:3.0.2'
|
|
@@ -34,12 +34,12 @@ allprojects {
|
|
|
34
34
|
password = "$mavenRepositoryPassword"
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
maven { url "https://maven.theoplayer.com/releases" }
|
|
38
37
|
maven { url "https://jitpack.io" }
|
|
39
38
|
maven { url "https://artifact.plugin.npaw.com/artifactory/plugins/android" }
|
|
39
|
+
maven { url "https://artifacts.bitmovin.com/artifactory/public-releases" }
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
delete rootProject.
|
|
45
|
-
}
|
|
43
|
+
tasks.register('clean', Delete) {
|
|
44
|
+
delete rootProject.layout.buildDirectory
|
|
45
|
+
}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
plugins {
|
|
2
|
+
id 'com.android.library'
|
|
3
|
+
id 'kotlin-android'
|
|
4
|
+
}
|
|
3
5
|
|
|
4
6
|
android {
|
|
5
7
|
namespace = "com.twentyfouri.tvbridge.common"
|
|
6
|
-
compileSdk =
|
|
8
|
+
compileSdk = 36
|
|
7
9
|
|
|
8
10
|
compileOptions {
|
|
9
11
|
sourceCompatibility JavaVersion.VERSION_17
|
|
10
12
|
targetCompatibility JavaVersion.VERSION_17
|
|
11
13
|
}
|
|
14
|
+
kotlinOptions {
|
|
15
|
+
jvmTarget = '17'
|
|
16
|
+
}
|
|
12
17
|
|
|
13
18
|
defaultConfig {
|
|
14
19
|
minSdk = 21
|
|
@@ -30,8 +35,6 @@ android {
|
|
|
30
35
|
}
|
|
31
36
|
|
|
32
37
|
dependencies {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
implementation 'androidx.core:core-ktx:1.13.1'
|
|
36
|
-
implementation 'androidx.appcompat:appcompat:1.7.0'
|
|
38
|
+
api 'androidx.core:core-ktx:1.16.0'
|
|
39
|
+
api 'androidx.appcompat:appcompat:1.7.0'
|
|
37
40
|
}
|