@24i/smartapps-bigscreen-rnv-build-engine 0.17.26 → 0.17.27-alpha.2782
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 +4 -0
- package/dist/templates/platforms/androidtv/project/app/build.gradle +14 -10
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/bridge/BridgeToJavaScript.kt +19 -3
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/global/utils/PlayerFactoryExoPlayerNpaw.kt +63 -16
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/webview/model/MediaEventType.kt +6 -2
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/webview/view/WebViewActivity.kt +0 -2
- package/dist/templates/platforms/androidtv/project/app/src/main/java/com/twentyfouri/tvbridge/webview/viewmodel/WebViewModel.kt +87 -8
- package/dist/templates/platforms/androidtv/project/build.gradle +2 -2
- package/dist/templates/platforms/androidtv/project/gradle/wrapper/gradle-wrapper.properties +3 -3
- package/package.json +1 -1
|
@@ -200,6 +200,7 @@ const configureEntryUrl = (c) => {
|
|
|
200
200
|
|| rnv_1.Common.getConfigProp(c, c.platform, 'theoLicense', '');
|
|
201
201
|
const npawAccountCode = process.env.NPAW_ACCOUNT_CODE
|
|
202
202
|
|| rnv_1.Common.getConfigProp(c, c.platform, 'npawAccountCode', '');
|
|
203
|
+
const enableImaSdk = !!rnv_1.Common.getConfigProp(c, c.platform, 'enableImaSdk', false);
|
|
203
204
|
const injects = [{
|
|
204
205
|
pattern: '{{APP_URL}}',
|
|
205
206
|
override: entryUrl,
|
|
@@ -209,6 +210,9 @@ const configureEntryUrl = (c) => {
|
|
|
209
210
|
}, {
|
|
210
211
|
pattern: '{{NPAW_ACCOUNT_CODE}}',
|
|
211
212
|
override: npawAccountCode,
|
|
213
|
+
}, {
|
|
214
|
+
pattern: '{{ENABLE_IMA_SDK}}',
|
|
215
|
+
override: enableImaSdk,
|
|
212
216
|
}];
|
|
213
217
|
rnv_1.Common.addSystemInjects(c, injects);
|
|
214
218
|
rnv_1.FileUtils.writeCleanFile(buildGradleFilePath, buildGradleFilePath, injects, null, c);
|
|
@@ -6,6 +6,7 @@ def theoLicense = '{{THEO_LICENSE}}'
|
|
|
6
6
|
def useTheoPlayer = theoLicense != ''
|
|
7
7
|
def npawAccountCode = '{{NPAW_ACCOUNT_CODE}}'
|
|
8
8
|
def useNpawPlugin = npawAccountCode != ''
|
|
9
|
+
def useImaSdk = {{ENABLE_IMA_SDK}}
|
|
9
10
|
|
|
10
11
|
android {
|
|
11
12
|
namespace = 'com.twentyfouri.tvbridge'
|
|
@@ -84,7 +85,7 @@ android {
|
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
dependencies {
|
|
87
|
-
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.
|
|
88
|
+
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
|
|
88
89
|
|
|
89
90
|
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
|
90
91
|
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
|
|
@@ -96,20 +97,20 @@ dependencies {
|
|
|
96
97
|
implementation "androidx.appcompat:appcompat:1.7.0"
|
|
97
98
|
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
|
|
98
99
|
|
|
99
|
-
implementation "com.google.dagger:dagger:2.
|
|
100
|
-
kapt "com.google.dagger:dagger-compiler:2.
|
|
100
|
+
implementation "com.google.dagger:dagger:2.56.1"
|
|
101
|
+
kapt "com.google.dagger:dagger-compiler:2.56.1"
|
|
101
102
|
|
|
102
103
|
implementation "com.squareup.retrofit2:retrofit:2.9.0"
|
|
103
104
|
implementation "com.squareup.retrofit2:converter-gson:2.9.0"
|
|
104
|
-
implementation "com.squareup.okhttp3:logging-interceptor:4.
|
|
105
|
-
implementation "com.squareup.okhttp3:okhttp:4.
|
|
105
|
+
implementation "com.squareup.okhttp3:logging-interceptor:4.12.0"
|
|
106
|
+
implementation "com.squareup.okhttp3:okhttp:4.12.0"
|
|
106
107
|
if (useTheoPlayer) {
|
|
107
|
-
compileOnly "com.twentyfouri.player:exoplayer:0.8.0-alpha.
|
|
108
|
-
implementation "com.twentyfouri.player:theoplayer:0.8.0-alpha.
|
|
108
|
+
compileOnly "com.twentyfouri.player:exoplayer:0.8.0-alpha.18"
|
|
109
|
+
implementation "com.twentyfouri.player:theoplayer:0.8.0-alpha.18"
|
|
109
110
|
implementation "com.theoplayer.theoplayer-sdk-android:core:8.2.0"
|
|
110
111
|
} else {
|
|
111
|
-
implementation "com.twentyfouri.player:exoplayer:0.8.0-alpha.
|
|
112
|
-
compileOnly "com.twentyfouri.player:theoplayer:0.8.0-alpha.
|
|
112
|
+
implementation "com.twentyfouri.player:exoplayer:0.8.0-alpha.18"
|
|
113
|
+
compileOnly "com.twentyfouri.player:theoplayer:0.8.0-alpha.18"
|
|
113
114
|
compileOnly "com.theoplayer.theoplayer-sdk-android:core:8.2.0"
|
|
114
115
|
}
|
|
115
116
|
|
|
@@ -123,6 +124,9 @@ dependencies {
|
|
|
123
124
|
compileOnly 'com.google.android.exoplayer:extension-okhttp:2.19.1'
|
|
124
125
|
}
|
|
125
126
|
|
|
127
|
+
if (useImaSdk) {
|
|
128
|
+
implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.36.0'
|
|
129
|
+
}
|
|
130
|
+
|
|
126
131
|
implementation project(':common')
|
|
127
132
|
}
|
|
128
|
-
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
package com.twentyfouri.tvbridge.bridge
|
|
2
2
|
|
|
3
3
|
import android.util.Log
|
|
4
|
+
import com.twentyfouri.player.base.Ad
|
|
5
|
+
import com.twentyfouri.player.base.AdBreak
|
|
4
6
|
import com.twentyfouri.player.base.AudioTrack
|
|
5
7
|
import com.twentyfouri.player.base.DefaultSourceSerializer
|
|
6
8
|
import com.twentyfouri.player.base.TextTrack
|
|
@@ -57,9 +59,23 @@ class BridgeToJavaScript(
|
|
|
57
59
|
textTracks: List<TextTrack>
|
|
58
60
|
) {
|
|
59
61
|
val tracksJson = toJson(audioTracks, textTracks)
|
|
60
|
-
Log.d(LOG_TAG, tracksJson)
|
|
62
|
+
Log.d(LOG_TAG, "bridgeAndroidToJavaScript_MediaTrackEvent $tracksJson")
|
|
61
63
|
val mediaEventString = "javascript:((function dispatchEvent(){var evt = document.createEvent('Events');evt.initEvent('$mediaEventPrefix$mediaEvent',true,true);evt.tracks='$tracksJson';document.dispatchEvent(evt);})())"
|
|
62
|
-
Log.v(LOG_TAG, mediaEventString)
|
|
64
|
+
Log.v(LOG_TAG, "bridgeAndroidToJavaScript_MediaTrackEvent $mediaEventString")
|
|
65
|
+
executeJavaScript(mediaEventString)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
fun bridgeAndroidToJavaScript_MediaAdEvent(
|
|
69
|
+
mediaEvent: String,
|
|
70
|
+
adBreak: AdBreak?,
|
|
71
|
+
ad: Ad?
|
|
72
|
+
) {
|
|
73
|
+
val serializer = DefaultSourceSerializer()
|
|
74
|
+
val adBreakJson = adBreak?.let { serializer.toPersistentMap(it).toString() } ?: ""
|
|
75
|
+
val adJson = ad?.let { serializer.toPersistentMap(it).toString() } ?: ""
|
|
76
|
+
|
|
77
|
+
val mediaEventString = "javascript:((function dispatchEvent(){var evt = document.createEvent('Events');evt.initEvent('$mediaEventPrefix$mediaEvent',true,true);evt.adbreak='$adBreakJson';evt.ad='$adJson';document.dispatchEvent(evt);})())"
|
|
78
|
+
Log.v(LOG_TAG, "bridgeAndroidToJavaScript_MediaAdEvent $mediaEventString")
|
|
63
79
|
executeJavaScript(mediaEventString)
|
|
64
80
|
}
|
|
65
81
|
|
|
@@ -71,7 +87,7 @@ class BridgeToJavaScript(
|
|
|
71
87
|
val adsJson = JSONArray(timeline.map { serializer.toPersistentMap(it) }).toString()
|
|
72
88
|
|
|
73
89
|
val mediaEventString = "javascript:((function dispatchEvent(){var evt = document.createEvent('Events');evt.initEvent('$mediaEventPrefix$mediaEvent',true,true);evt.ads='$adsJson';document.dispatchEvent(evt);})())"
|
|
74
|
-
Log.v(LOG_TAG, mediaEventString)
|
|
90
|
+
Log.v(LOG_TAG, "bridgeAndroidToJavaScript_MediaAdEvent $mediaEventString")
|
|
75
91
|
executeJavaScript(mediaEventString)
|
|
76
92
|
}
|
|
77
93
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
package com.twentyfouri.tvbridge.global.utils
|
|
2
2
|
|
|
3
3
|
import android.annotation.SuppressLint
|
|
4
|
-
import android.app.Application
|
|
5
4
|
import android.content.Context
|
|
6
5
|
import android.content.ContextWrapper
|
|
7
6
|
import android.os.Bundle
|
|
@@ -45,13 +44,16 @@ import com.npaw.analytics.video.VideoOptions
|
|
|
45
44
|
import com.npaw.core.options.AnalyticsOptions
|
|
46
45
|
import com.npaw.exoplayer.ExoPlayerAdapter
|
|
47
46
|
import com.npaw.exoplayer.ExoPlayerBalancer
|
|
47
|
+
import com.twentyfouri.player.base.BackgroundMode
|
|
48
48
|
import com.twentyfouri.player.base.CastingEnded
|
|
49
49
|
import com.twentyfouri.player.base.CastingStarted
|
|
50
|
+
import com.twentyfouri.player.base.CastingType
|
|
50
51
|
import com.twentyfouri.player.base.DrmPlayready
|
|
51
52
|
import com.twentyfouri.player.base.DrmWidevine
|
|
52
53
|
import com.twentyfouri.player.base.EventListenerDispose
|
|
53
54
|
import com.twentyfouri.player.base.PlayerBase
|
|
54
55
|
import com.twentyfouri.player.base.PlayerGesturesTarget
|
|
56
|
+
import com.twentyfouri.player.base.PlayerProxy
|
|
55
57
|
import com.twentyfouri.player.base.PlayerSurface
|
|
56
58
|
import com.twentyfouri.player.base.ResizeEvent
|
|
57
59
|
import com.twentyfouri.player.base.ScaleType
|
|
@@ -71,11 +73,11 @@ import com.twentyfouri.player.exoplayer.DrmSessionManagerProvider
|
|
|
71
73
|
import com.twentyfouri.player.exoplayer.PlayerComponents
|
|
72
74
|
import com.twentyfouri.player.exoplayer.PlayerExoPlayer
|
|
73
75
|
import com.twentyfouri.player.exoplayer.PlayerFactoryExoPlayer
|
|
74
|
-
import com.twentyfouri.player.exoplayer.PlayerProxy
|
|
75
76
|
import com.twentyfouri.player.exoplayer.PlayerViewAdvertisement
|
|
76
77
|
import com.twentyfouri.player.exoplayer.SharedComponents
|
|
77
78
|
import com.twentyfouri.tvbridge.BuildConfig
|
|
78
79
|
import com.twentyfouri.tvbridge.configuration.BridgeConfig
|
|
80
|
+
import java.util.WeakHashMap
|
|
79
81
|
import com.npaw.core.util.extensions.Log as NpawLog
|
|
80
82
|
|
|
81
83
|
class PlayerFactoryExoPlayerNpaw(
|
|
@@ -86,9 +88,11 @@ class PlayerFactoryExoPlayerNpaw(
|
|
|
86
88
|
|
|
87
89
|
override val engineVersion: String = ExoPlayerLibraryInfo.VERSION
|
|
88
90
|
|
|
91
|
+
private val activePlayers = WeakHashMap<PlayerBase, Boolean>()
|
|
92
|
+
|
|
89
93
|
override fun createSharedComponents(context: Context): SharedComponents =
|
|
90
94
|
CustomizedSharedComponents(context)
|
|
91
|
-
|
|
95
|
+
|
|
92
96
|
override fun createView(parent: ViewGroup): View {
|
|
93
97
|
return NpawPlayerView(parent.context).also {
|
|
94
98
|
val basePlayer = createPlayer(parent.context)
|
|
@@ -97,7 +101,7 @@ class PlayerFactoryExoPlayerNpaw(
|
|
|
97
101
|
.sharedComponents as CustomizedSharedComponents
|
|
98
102
|
).npawPlugin
|
|
99
103
|
val npawPlayer = NpawPlayer(basePlayer, npawPlugin)
|
|
100
|
-
|
|
104
|
+
activePlayers[npawPlayer] = true
|
|
101
105
|
it.player = npawPlayer
|
|
102
106
|
}
|
|
103
107
|
}
|
|
@@ -111,10 +115,15 @@ class PlayerFactoryExoPlayerNpaw(
|
|
|
111
115
|
?: throw IllegalStateException("Player was not initialized by PlayerFactory")
|
|
112
116
|
}
|
|
113
117
|
|
|
114
|
-
|
|
118
|
+
override fun release() {
|
|
119
|
+
activePlayers.keys.forEach {
|
|
120
|
+
it.destroy()
|
|
121
|
+
}
|
|
122
|
+
activePlayers.clear()
|
|
123
|
+
super.release()
|
|
124
|
+
}
|
|
115
125
|
|
|
116
|
-
|
|
117
|
-
?: throw IllegalStateException("Missing application")
|
|
126
|
+
private inner class CustomizedSharedComponents(context: Context) : DefaultSharedComponents(context) {
|
|
118
127
|
|
|
119
128
|
val npawPlugin: NpawPlugin = NpawPlugin
|
|
120
129
|
.Builder(application, config.npawAccount)
|
|
@@ -335,6 +344,10 @@ class PlayerFactoryExoPlayerNpaw(
|
|
|
335
344
|
adOverlay.gesturesTarget = value
|
|
336
345
|
}
|
|
337
346
|
|
|
347
|
+
override var supportsPictureInPicture: Boolean
|
|
348
|
+
get() = false
|
|
349
|
+
set(value) {}
|
|
350
|
+
|
|
338
351
|
var player: PlayerBase? = null
|
|
339
352
|
set(value) {
|
|
340
353
|
if (field == value) return
|
|
@@ -474,6 +487,23 @@ class PlayerFactoryExoPlayerNpaw(
|
|
|
474
487
|
}
|
|
475
488
|
}
|
|
476
489
|
|
|
490
|
+
override fun onUserLeaveHint() {
|
|
491
|
+
(player as? PlayerProxy)?.onUserLeaveHint()
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
override fun onPictureInPictureModeChanged(inPictureInPictureMode: Boolean) {
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
fun autoPauseByBackground() {
|
|
498
|
+
val player = this.player ?: return
|
|
499
|
+
if (player.live) {
|
|
500
|
+
player.stop()
|
|
501
|
+
} else {
|
|
502
|
+
player.pause()
|
|
503
|
+
}
|
|
504
|
+
pausedByBackground = true
|
|
505
|
+
}
|
|
506
|
+
|
|
477
507
|
private inner class ComponentListener : TextOutput, Player.Listener,
|
|
478
508
|
DefaultLifecycleObserver {
|
|
479
509
|
override fun onCues(cueGroup: CueGroup) {
|
|
@@ -499,29 +529,46 @@ class PlayerFactoryExoPlayerNpaw(
|
|
|
499
529
|
this@NpawPlayerView.keepScreenOn = isPlaying
|
|
500
530
|
}
|
|
501
531
|
|
|
502
|
-
override fun
|
|
532
|
+
override fun onStop(owner: LifecycleOwner) {
|
|
503
533
|
val player = this@NpawPlayerView.player ?: return
|
|
504
534
|
player.asPlayerExoPlayer()?.also {
|
|
505
535
|
detachSurface(it)
|
|
506
536
|
}
|
|
507
|
-
if (
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
537
|
+
if (
|
|
538
|
+
!player.paused && player.state.source != null &&
|
|
539
|
+
player.castingType == CastingType.NONE
|
|
540
|
+
) {
|
|
541
|
+
val shouldPause = when (player.continueInBackgroundMode) {
|
|
542
|
+
BackgroundMode.PAUSE -> true
|
|
543
|
+
BackgroundMode.PICTURE_IN_PICTURE -> when {
|
|
544
|
+
player.isCastingHost -> false
|
|
545
|
+
player.pictureInPicture -> false
|
|
546
|
+
else -> true // PiP disabled in system settings?
|
|
547
|
+
}
|
|
548
|
+
else -> false
|
|
549
|
+
}
|
|
550
|
+
if (shouldPause) {
|
|
551
|
+
autoPauseByBackground()
|
|
512
552
|
}
|
|
513
|
-
|
|
553
|
+
}
|
|
554
|
+
if (player is PlayerProxy) {
|
|
555
|
+
player.onLifecycleStop()
|
|
514
556
|
}
|
|
515
557
|
}
|
|
516
558
|
|
|
517
|
-
override fun
|
|
559
|
+
override fun onStart(owner: LifecycleOwner) {
|
|
518
560
|
val player = this@NpawPlayerView.player ?: return
|
|
519
561
|
if (pausedByBackground) {
|
|
520
562
|
pausedByBackground = false
|
|
521
563
|
player.play()
|
|
522
564
|
}
|
|
565
|
+
if (player is PlayerProxy) {
|
|
566
|
+
player.onLifecycleStart()
|
|
567
|
+
}
|
|
523
568
|
player.asPlayerExoPlayer()?.also {
|
|
524
|
-
|
|
569
|
+
if (player.castingType == CastingType.NONE) {
|
|
570
|
+
attachSurface(it)
|
|
571
|
+
}
|
|
525
572
|
}
|
|
526
573
|
}
|
|
527
574
|
|
|
@@ -20,7 +20,11 @@ object MediaEventType {
|
|
|
20
20
|
const val KEY_UP = "keyup"
|
|
21
21
|
const val KEY_DOWN = "keydown"
|
|
22
22
|
const val TRACKS_CHANGED = "trackschanged"
|
|
23
|
-
const val AD_BREAK_START = "
|
|
23
|
+
const val AD_BREAK_START = "adbreakbegin"
|
|
24
24
|
const val AD_BREAK_END = "adbreakend"
|
|
25
|
-
const val AD_BREAKS_RESCHEDULED = "
|
|
25
|
+
const val AD_BREAKS_RESCHEDULED = "adcuepointschanged"
|
|
26
|
+
const val AD_STARTED = "adbegin"
|
|
27
|
+
const val AD_ENDED = "adend"
|
|
28
|
+
const val AD_ERROR = "aderror"
|
|
29
|
+
const val AD_SKIPPED = "adskip"
|
|
26
30
|
}
|
|
@@ -17,11 +17,9 @@ import android.view.inputmethod.InputMethodManager
|
|
|
17
17
|
import android.widget.RelativeLayout
|
|
18
18
|
import android.widget.Toast
|
|
19
19
|
import androidx.appcompat.app.AppCompatActivity
|
|
20
|
-
import androidx.databinding.DataBindingUtil
|
|
21
20
|
import androidx.media.AudioAttributesCompat
|
|
22
21
|
import androidx.media.AudioFocusRequestCompat
|
|
23
22
|
import androidx.media.AudioManagerCompat
|
|
24
|
-
import com.twentyfouri.tvbridge.R
|
|
25
23
|
import com.twentyfouri.tvbridge.configuration.BridgeConfig
|
|
26
24
|
import com.twentyfouri.tvbridge.databinding.ActivityWebViewBinding
|
|
27
25
|
import com.twentyfouri.tvbridge.global.BaseApplication
|
|
@@ -59,6 +59,8 @@ class WebViewModel @Inject constructor(
|
|
|
59
59
|
|
|
60
60
|
private var source: Source? = null
|
|
61
61
|
|
|
62
|
+
private var adStarted: Boolean = false
|
|
63
|
+
|
|
62
64
|
val audioTrack: AudioTrack?
|
|
63
65
|
get() = player?.selectedAudioTrack
|
|
64
66
|
val subtitleTrack: TextTrack?
|
|
@@ -283,59 +285,136 @@ class WebViewModel @Inject constructor(
|
|
|
283
285
|
when (event) {
|
|
284
286
|
is ErrorEvent -> {
|
|
285
287
|
Log.e("AndroidPlayer", "Player error", event.error)
|
|
286
|
-
jsBridge.bridgeAndroidToJavaScript_ErrorEvent(
|
|
288
|
+
jsBridge.bridgeAndroidToJavaScript_ErrorEvent(
|
|
289
|
+
MediaEventType.ERROR,
|
|
290
|
+
"${event.error.message} - ${event.error.nativeCode}"
|
|
291
|
+
)
|
|
287
292
|
stopPlayer()
|
|
288
293
|
}
|
|
294
|
+
|
|
289
295
|
is LoadedMetadataEvent -> {
|
|
290
296
|
jsBridge.bridgeAndroidToJavaScript_MediaEvent(MediaEventType.LOADEDMETADATA)
|
|
291
|
-
jsBridge.bridgeAndroidToJavaScript_MediaTrackEvent(
|
|
297
|
+
jsBridge.bridgeAndroidToJavaScript_MediaTrackEvent(
|
|
298
|
+
MediaEventType.TRACKS_CHANGED,
|
|
299
|
+
player.audioTracks,
|
|
300
|
+
player.textTracks
|
|
301
|
+
)
|
|
292
302
|
}
|
|
303
|
+
|
|
293
304
|
is LoadedDataEvent -> {
|
|
294
305
|
jsBridge.bridgeAndroidToJavaScript_MediaEvent(MediaEventType.LOADEDDATA)
|
|
295
306
|
}
|
|
307
|
+
|
|
296
308
|
is CanPlayEvent -> {
|
|
297
309
|
jsBridge.bridgeAndroidToJavaScript_MediaEvent(MediaEventType.CANPLAY)
|
|
298
310
|
}
|
|
311
|
+
|
|
299
312
|
is EndedEvent -> {
|
|
300
313
|
jsBridge.bridgeAndroidToJavaScript_MediaEvent(MediaEventType.ENDED)
|
|
301
314
|
}
|
|
315
|
+
|
|
302
316
|
is WaitingEvent -> {
|
|
303
317
|
jsBridge.bridgeAndroidToJavaScript_MediaEvent(MediaEventType.WAITING)
|
|
304
318
|
}
|
|
319
|
+
|
|
305
320
|
is PlayingEvent -> {
|
|
306
321
|
view?.setBlackCurtainVisibility(View.GONE)
|
|
307
322
|
jsBridge.bridgeAndroidToJavaScript_MediaEvent(MediaEventType.PLAYING)
|
|
308
323
|
}
|
|
324
|
+
|
|
309
325
|
is SeekingEvent -> {
|
|
310
326
|
jsBridge.bridgeAndroidToJavaScript_MediaEvent(MediaEventType.SEEKING)
|
|
311
327
|
}
|
|
328
|
+
|
|
312
329
|
is SeekedEvent -> {
|
|
313
330
|
jsBridge.bridgeAndroidToJavaScript_MediaEvent(MediaEventType.SEEKED)
|
|
314
331
|
}
|
|
332
|
+
|
|
315
333
|
is TimeUpdateEvent -> {
|
|
316
334
|
if (player.playing) {
|
|
317
335
|
jsBridge.bridgeAndroidToJavaScript_MediaEvent(MediaEventType.TIME_UPDATE)
|
|
318
336
|
}
|
|
319
337
|
}
|
|
338
|
+
|
|
320
339
|
is PauseEvent -> {
|
|
321
340
|
if (!player.playing) {
|
|
322
341
|
jsBridge.bridgeAndroidToJavaScript_MediaEvent(MediaEventType.PAUSE)
|
|
323
342
|
}
|
|
324
343
|
}
|
|
344
|
+
|
|
325
345
|
is AddAudioTrackEvent, is AddTextTrackEvent,
|
|
326
346
|
is RemoveAudioTrackEvent, is RemoveTextTrackEvent,
|
|
327
347
|
is ChangeAudioTrackEvent, is ChangeTextTrackEvent -> {
|
|
328
348
|
Log.d("WebViewModel", "onTrackschanged: audio=$audioTrack subtitle=$subtitleTrack")
|
|
329
|
-
jsBridge.bridgeAndroidToJavaScript_MediaTrackEvent(
|
|
349
|
+
jsBridge.bridgeAndroidToJavaScript_MediaTrackEvent(
|
|
350
|
+
MediaEventType.TRACKS_CHANGED,
|
|
351
|
+
player.audioTracks,
|
|
352
|
+
player.textTracks
|
|
353
|
+
)
|
|
330
354
|
}
|
|
355
|
+
|
|
356
|
+
is AdBreaksRescheduledEvent -> {
|
|
357
|
+
jsBridge.bridgeAndroidToJavaScript_MediaAdBreaksEvent(
|
|
358
|
+
MediaEventType.AD_BREAKS_RESCHEDULED,
|
|
359
|
+
player.timeline
|
|
360
|
+
)
|
|
361
|
+
}
|
|
362
|
+
|
|
331
363
|
is AdBreakStartedEvent -> {
|
|
332
|
-
jsBridge.
|
|
364
|
+
jsBridge.bridgeAndroidToJavaScript_MediaAdEvent(
|
|
365
|
+
MediaEventType.AD_BREAK_START,
|
|
366
|
+
player.currentAdBreak,
|
|
367
|
+
player.currentAd
|
|
368
|
+
)
|
|
333
369
|
}
|
|
370
|
+
|
|
334
371
|
is AdBreakEndedEvent -> {
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
372
|
+
if (adStarted) {
|
|
373
|
+
jsBridge.bridgeAndroidToJavaScript_MediaAdEvent(
|
|
374
|
+
MediaEventType.AD_ENDED,
|
|
375
|
+
player.currentAdBreak,
|
|
376
|
+
null
|
|
377
|
+
)
|
|
378
|
+
}
|
|
379
|
+
adStarted = false
|
|
380
|
+
jsBridge.bridgeAndroidToJavaScript_MediaAdEvent(
|
|
381
|
+
MediaEventType.AD_BREAK_END,
|
|
382
|
+
player.currentAdBreak,
|
|
383
|
+
player.currentAd
|
|
384
|
+
)
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
is AdStartedEvent -> {
|
|
388
|
+
if (adStarted) {
|
|
389
|
+
jsBridge.bridgeAndroidToJavaScript_MediaAdEvent(
|
|
390
|
+
MediaEventType.AD_ENDED,
|
|
391
|
+
player.currentAdBreak,
|
|
392
|
+
null
|
|
393
|
+
)
|
|
394
|
+
} else {
|
|
395
|
+
adStarted = true
|
|
396
|
+
}
|
|
397
|
+
jsBridge.bridgeAndroidToJavaScript_MediaAdEvent(
|
|
398
|
+
MediaEventType.AD_STARTED,
|
|
399
|
+
player.currentAdBreak,
|
|
400
|
+
player.currentAd
|
|
401
|
+
)
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
is AdErrorEvent -> {
|
|
405
|
+
jsBridge.bridgeAndroidToJavaScript_MediaAdEvent(
|
|
406
|
+
MediaEventType.AD_ERROR,
|
|
407
|
+
player.currentAdBreak,
|
|
408
|
+
player.currentAd
|
|
409
|
+
)
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
is AdSkippedEvent -> {
|
|
413
|
+
jsBridge.bridgeAndroidToJavaScript_MediaAdEvent(
|
|
414
|
+
MediaEventType.AD_SKIPPED,
|
|
415
|
+
player.currentAdBreak,
|
|
416
|
+
player.currentAd
|
|
417
|
+
)
|
|
339
418
|
}
|
|
340
419
|
}
|
|
341
420
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
buildscript {
|
|
2
|
-
ext.kotlin_version = '1.
|
|
2
|
+
ext.kotlin_version = '2.1.20'
|
|
3
3
|
|
|
4
4
|
repositories {
|
|
5
5
|
google()
|
|
6
6
|
mavenCentral()
|
|
7
7
|
}
|
|
8
8
|
dependencies {
|
|
9
|
-
classpath 'com.android.tools.build:gradle:8.
|
|
9
|
+
classpath 'com.android.tools.build:gradle:8.9.1'
|
|
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'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
#Tue Apr 08 16:51:49 CEST 2025
|
|
2
2
|
distributionBase=GRADLE_USER_HOME
|
|
3
|
-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
|
4
3
|
distributionPath=wrapper/dists
|
|
5
|
-
|
|
4
|
+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
|
|
6
5
|
zipStoreBase=GRADLE_USER_HOME
|
|
6
|
+
zipStorePath=wrapper/dists
|
package/package.json
CHANGED