@24i/smartapps-bigscreen-rnv-build-engine 0.17.27-alpha.2782 → 0.17.27-alpha.2786
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/templates/platforms/androidtv/project/app/build.gradle +2 -0
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/bridge/BridgeFromJavaScript.kt +14 -3
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/webview/view/WebViewActivity.kt +15 -1
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/webview/viewmodel/WebViewModel.kt +27 -1
- package/dist/templates/platforms/tizen/project/config.xml +1 -0
- package/package.json +1 -1
|
@@ -8,15 +8,14 @@ import android.webkit.JavascriptInterface
|
|
|
8
8
|
import com.google.gson.JsonObject
|
|
9
9
|
import com.twentyfouri.player.base.TextTrack
|
|
10
10
|
import com.twentyfouri.player.base.TrackKind
|
|
11
|
-
import com.twentyfouri.tvbridge.webview.parser.SourceParser.stringToJson
|
|
12
11
|
import com.twentyfouri.tvbridge.webview.parser.PlaybackInfoParser.parse
|
|
13
|
-
import com.twentyfouri.tvbridge.webview.parser.SourceParser
|
|
12
|
+
import com.twentyfouri.tvbridge.webview.parser.SourceParser.stringToJson
|
|
14
13
|
import com.twentyfouri.tvbridge.webview.parser.TrackJsonModelParser.audioFromJson
|
|
15
14
|
import com.twentyfouri.tvbridge.webview.parser.TrackJsonModelParser.textFromJson
|
|
16
15
|
import com.twentyfouri.tvbridge.webview.parser.TrackJsonModelParser.toJson
|
|
17
16
|
import com.twentyfouri.tvbridge.webview.viewmodel.WebViewModel
|
|
18
17
|
import java.text.SimpleDateFormat
|
|
19
|
-
import java.util
|
|
18
|
+
import java.util.Arrays
|
|
20
19
|
import java.util.concurrent.CountDownLatch
|
|
21
20
|
import java.util.concurrent.TimeUnit
|
|
22
21
|
import kotlin.math.roundToInt
|
|
@@ -375,6 +374,18 @@ class BridgeFromJavaScript(
|
|
|
375
374
|
return ""
|
|
376
375
|
}
|
|
377
376
|
|
|
377
|
+
/***
|
|
378
|
+
* Bridget JS 2 Android to get advertising id
|
|
379
|
+
*/
|
|
380
|
+
@JavascriptInterface
|
|
381
|
+
fun bridgeJavaScriptToAndroid_GetAdId() = viewModel.adId
|
|
382
|
+
|
|
383
|
+
/***
|
|
384
|
+
* Bridget JS 2 Android to get limit ad tracking info
|
|
385
|
+
*/
|
|
386
|
+
@JavascriptInterface
|
|
387
|
+
fun bridgeJavaScriptToAndroid_GetLimitAdTracking() = viewModel.limitAdTracking
|
|
388
|
+
|
|
378
389
|
companion object {
|
|
379
390
|
const val LOG_TAG = "JavaScriptBridge"
|
|
380
391
|
val DISABLED_AUDIO_TRACK = JsonObject().apply {
|
|
@@ -11,6 +11,10 @@ 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
|
|
14
18
|
import android.view.View.MeasureSpec
|
|
15
19
|
import android.view.WindowManager
|
|
16
20
|
import android.view.inputmethod.InputMethodManager
|
|
@@ -78,6 +82,15 @@ class WebViewActivity : AppCompatActivity(), Mainview {
|
|
|
78
82
|
|
|
79
83
|
loadUrl(config.baseUrl)
|
|
80
84
|
|
|
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
|
+
|
|
81
94
|
initialized = true
|
|
82
95
|
}
|
|
83
96
|
|
|
@@ -230,6 +243,7 @@ class WebViewActivity : AppCompatActivity(), Mainview {
|
|
|
230
243
|
|
|
231
244
|
override fun loadUrl(url: String?) {
|
|
232
245
|
if (url.isNullOrEmpty()) return
|
|
246
|
+
|
|
233
247
|
binding.webview.visibility = View.VISIBLE
|
|
234
248
|
binding.webview.loadUrl(url)
|
|
235
249
|
if (url.startsWith("http")) {
|
|
@@ -242,4 +256,4 @@ class WebViewActivity : AppCompatActivity(), Mainview {
|
|
|
242
256
|
setCookiePolicy(CookiePolicy.ACCEPT_ALL)
|
|
243
257
|
}
|
|
244
258
|
}
|
|
245
|
-
}
|
|
259
|
+
}
|
|
@@ -6,12 +6,15 @@ import android.content.Intent
|
|
|
6
6
|
import android.graphics.Bitmap
|
|
7
7
|
import android.graphics.Canvas
|
|
8
8
|
import android.os.Build
|
|
9
|
+
import android.provider.Settings
|
|
9
10
|
import android.util.Log
|
|
10
11
|
import android.view.KeyEvent
|
|
11
12
|
import android.view.View
|
|
12
13
|
import android.webkit.CookieManager
|
|
13
14
|
import android.webkit.WebChromeClient
|
|
14
15
|
import android.webkit.WebView
|
|
16
|
+
import com.google.android.gms.ads.identifier.AdvertisingIdClient
|
|
17
|
+
import com.google.android.gms.common.GooglePlayServicesNotAvailableException
|
|
15
18
|
import com.google.gson.JsonArray
|
|
16
19
|
import com.google.gson.JsonObject
|
|
17
20
|
import com.twentyfouri.player.base.*
|
|
@@ -23,7 +26,6 @@ import com.twentyfouri.tvbridge.bridge.BridgeToJavaScript
|
|
|
23
26
|
import com.twentyfouri.tvbridge.common.*
|
|
24
27
|
import com.twentyfouri.tvbridge.configuration.BridgeConfig
|
|
25
28
|
import com.twentyfouri.tvbridge.global.utils.LocalStorage
|
|
26
|
-
import com.twentyfouri.tvbridge.global.utils.PlayerFactoryTheoPlayerCustomized
|
|
27
29
|
import com.twentyfouri.tvbridge.global.utils.PlayerFactoryVersion
|
|
28
30
|
import com.twentyfouri.tvbridge.global.utils.SourceDrmOverridden
|
|
29
31
|
import com.twentyfouri.tvbridge.webview.client.BridgeWebView
|
|
@@ -627,6 +629,30 @@ class WebViewModel @Inject constructor(
|
|
|
627
629
|
}
|
|
628
630
|
}
|
|
629
631
|
|
|
632
|
+
val adId get() = try {
|
|
633
|
+
// Let's try Google first
|
|
634
|
+
AdvertisingIdClient.getAdvertisingIdInfo(context).id
|
|
635
|
+
} catch (e: GooglePlayServicesNotAvailableException) {
|
|
636
|
+
// Probably Amazon
|
|
637
|
+
try {
|
|
638
|
+
Settings.Secure.getString(context.contentResolver, "advertising_id")
|
|
639
|
+
} catch (snfe: Settings.SettingNotFoundException) {
|
|
640
|
+
null
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
val limitAdTracking get() = try {
|
|
645
|
+
// Let's try Google first
|
|
646
|
+
AdvertisingIdClient.getAdvertisingIdInfo(context).isLimitAdTrackingEnabled
|
|
647
|
+
} catch (e: GooglePlayServicesNotAvailableException) {
|
|
648
|
+
// Probably Amazon
|
|
649
|
+
try {
|
|
650
|
+
Settings.Secure.getInt(context.contentResolver, "limit_ad_tracking") != 0
|
|
651
|
+
} catch (snfe: Settings.SettingNotFoundException) {
|
|
652
|
+
null
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
|
|
630
656
|
private inner class InnerIapCallback : IapCallback {
|
|
631
657
|
override fun checkNewPurchasesFinished(result: List<IapPurchase>) {
|
|
632
658
|
// not actually used at the moment
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
<tizen:privilege name="http://developer.samsung.com/privilege/productinfo"/>
|
|
14
14
|
<tizen:privilege name="http://tizen.org/privilege/internet"/>
|
|
15
15
|
<tizen:privilege name="http://tizen.org/privilege/tv.inputdevice"/>
|
|
16
|
+
<tizen:privilege name="http://developer.samsung.com/privilege/adinfo"/>
|
|
16
17
|
<tizen:setting screen-orientation="landscape" context-menu="enable" background-support="disable" encryption="disable" install-location="auto" hwkey-event="enable"/>
|
|
17
18
|
<tizen:metadata key="http://samsung.com/tv/metadata/use.voiceguide" value="false"/>
|
|
18
19
|
</widget>
|
package/package.json
CHANGED