diff --git a/app/src/main/java/com/theoplayer/android/connector/Sources.kt b/app/src/main/java/com/theoplayer/android/connector/Sources.kt index 4e8c78eb..31de8c6e 100644 --- a/app/src/main/java/com/theoplayer/android/connector/Sources.kt +++ b/app/src/main/java/com/theoplayer/android/connector/Sources.kt @@ -86,7 +86,7 @@ val sources: List by lazy { sourceDescription = SourceDescription .Builder( TypedSource.Builder( - "https://csm-e-sdk-validation.bln1.yospace.com/csm/extlive/yospace02,hlssample42.m3u8?yo.br=true&yo.av=4" + "https://csm-e-sdk-validation-eb.bln1.yospace.com/csm/extlive/yosdk02,hls-ts-pre.m3u8?yo.av=5" ) .type(SourceType.HLS) .ssai(YospaceSsaiDescription(streamType = YospaceStreamType.LIVE)) @@ -99,7 +99,7 @@ val sources: List by lazy { sourceDescription = SourceDescription .Builder( TypedSource.Builder( - "https://csm-e-sdk-validation.bln1.yospace.com/csm/extlive/yospace02,hlssample42.m3u8?yo.br=true&yo.lp=true&yo.av=4" + "https://csm-e-sdk-validation-eb.bln1.yospace.com/csm/extlive/yosdk02,hls-ts-pre.m3u8?yo.br=false&yo.av=5&yo.lpa=dur" ) .type(SourceType.HLS) .ssai(YospaceSsaiDescription(streamType = YospaceStreamType.LIVEPAUSE)) @@ -125,7 +125,7 @@ val sources: List by lazy { sourceDescription = SourceDescription .Builder( TypedSource.Builder( - "https://csm-e-sdk-validation.bln1.yospace.com/csm/extlive/yosdk01,dash.mpd?yo.br=true&yo.lp=true&yo.jt=1000&yo.av=4" + "https://csm-e-sdk-validation-eb.bln1.yospace.com/csm/extlive/yosdk02,dash-mp4-pre.mpd?yo.br=false&yo.av=5&yo.lpa=dur" ) .type(SourceType.DASH) .ssai(YospaceSsaiDescription(streamType = YospaceStreamType.LIVEPAUSE)) diff --git a/connectors/yospace/src/main/java/com/theoplayer/android/connector/yospace/internal/AdHandler.kt b/connectors/yospace/src/main/java/com/theoplayer/android/connector/yospace/internal/AdHandler.kt index 56e53ad9..ff3ae35e 100644 --- a/connectors/yospace/src/main/java/com/theoplayer/android/connector/yospace/internal/AdHandler.kt +++ b/connectors/yospace/src/main/java/com/theoplayer/android/connector/yospace/internal/AdHandler.kt @@ -62,13 +62,14 @@ internal class AdHandler( } private fun getAdInit(advert: YospaceAdvert): AdInit { - val nonLinearCreative = if (advert.isNonLinear) advert.getNonLinearCreatives(Resource.ResourceType.STATIC).firstOrNull() else null + val isNonLinear = advert.linearCreative == null + val nonLinearCreative = if (isNonLinear) advert.getNonLinearCreatives(Resource.ResourceType.STATIC).firstOrNull() else null return AdInit( - type = if (advert.isNonLinear) "nonlinear" else "linear", + type = if (isNonLinear) "nonlinear" else "linear", skipOffset = if (advert.skipOffset < 0) -1 else (advert.skipOffset / 1000).toInt(), id = advert.identifier, duration = (advert.duration / 1000).toInt(), - clickThrough = if (advert.isNonLinear) nonLinearCreative?.clickThroughUrl else advert.linearCreative?.clickThroughUrl, + clickThrough = if (isNonLinear) nonLinearCreative?.clickThroughUrl else advert.linearCreative?.clickThroughUrl, resourceURI = nonLinearCreative?.getResource(Resource.ResourceType.STATIC)?.stringData ) } diff --git a/connectors/yospace/src/main/java/com/theoplayer/android/connector/yospace/internal/SessionPropertiesUtil.kt b/connectors/yospace/src/main/java/com/theoplayer/android/connector/yospace/internal/SessionPropertiesUtil.kt index 70bb22b4..877c4363 100644 --- a/connectors/yospace/src/main/java/com/theoplayer/android/connector/yospace/internal/SessionPropertiesUtil.kt +++ b/connectors/yospace/src/main/java/com/theoplayer/android/connector/yospace/internal/SessionPropertiesUtil.kt @@ -19,7 +19,7 @@ internal fun Session.SessionProperties.copy( fireHistoricalBeacons: Boolean = this.fireHistoricalBeacons, applyEncryptedTracking: Boolean = this.applyEncryptedTracking, excludedCategories: Int = this.excludedCategories, - consecutiveBreakTolerance: Int = this.consecutiveBreakTolerance, + alignConsecutiveBreaks: Boolean = this.alignConsecutiveBreaks, token: UUID = this.token, customHttpHeaders: Map = this.customHttpHeaders, ) = Session.SessionProperties().apply { @@ -32,7 +32,7 @@ internal fun Session.SessionProperties.copy( this.fireHistoricalBeacons = fireHistoricalBeacons this.applyEncryptedTracking = applyEncryptedTracking this.excludeFromSuppression(excludedCategories) - this.consecutiveBreakTolerance = consecutiveBreakTolerance + this.alignConsecutiveBreaks = alignConsecutiveBreaks this.token = token this.customHttpHeaders = customHttpHeaders } @@ -48,7 +48,7 @@ internal data class SerializedSessionProperties( val fireHistoricalBeacons: Boolean, val applyEncryptedTracking: Boolean, val excludedCategories: Int, - val consecutiveBreakTolerance: Int, + val alignConsecutiveBreaks: Boolean, val token: String, val customHttpHeaders: Map, ) @@ -63,7 +63,7 @@ internal fun Session.SessionProperties.serialize() = SerializedSessionProperties fireHistoricalBeacons = fireHistoricalBeacons, applyEncryptedTracking = applyEncryptedTracking, excludedCategories = excludedCategories, - consecutiveBreakTolerance = consecutiveBreakTolerance, + alignConsecutiveBreaks = alignConsecutiveBreaks, token = token.toString(), customHttpHeaders = customHttpHeaders, ) @@ -80,7 +80,7 @@ internal fun SerializedSessionProperties.deserialize(): Session.SessionPropertie fireHistoricalBeacons = serialized.fireHistoricalBeacons applyEncryptedTracking = serialized.applyEncryptedTracking excludeFromSuppression(serialized.excludedCategories) - consecutiveBreakTolerance = serialized.consecutiveBreakTolerance + alignConsecutiveBreaks = serialized.alignConsecutiveBreaks token = UUID.fromString(serialized.token) customHttpHeaders = serialized.customHttpHeaders } diff --git a/connectors/yospace/src/main/java/com/theoplayer/android/connector/yospace/internal/YospaceAdIntegration.kt b/connectors/yospace/src/main/java/com/theoplayer/android/connector/yospace/internal/YospaceAdIntegration.kt index e4d5590f..54978eb6 100644 --- a/connectors/yospace/src/main/java/com/theoplayer/android/connector/yospace/internal/YospaceAdIntegration.kt +++ b/connectors/yospace/src/main/java/com/theoplayer/android/connector/yospace/internal/YospaceAdIntegration.kt @@ -117,7 +117,7 @@ internal class YospaceAdIntegration( } private fun setupSession(session: Session) { - val isLive = session.playbackMode == Session.PlaybackMode.LIVE + val isLive = session.sessionMode == Session.SessionMode.LIVE this.session = session if (isLive) { // Timed metadata is only used for live playback @@ -186,9 +186,9 @@ internal class YospaceAdIntegration( } private fun removeStreamStartListeners() { - player.addEventListener(PlayerEventTypes.LOADEDMETADATA, onSeekableChange) - player.addEventListener(PlayerEventTypes.DURATIONCHANGE, onSeekableChange) - player.addEventListener(PlayerEventTypes.TIMEUPDATE, onSeekableChange) + player.removeEventListener(PlayerEventTypes.LOADEDMETADATA, onSeekableChange) + player.removeEventListener(PlayerEventTypes.DURATIONCHANGE, onSeekableChange) + player.removeEventListener(PlayerEventTypes.TIMEUPDATE, onSeekableChange) } private val onVolumeChange = EventListener { diff --git a/connectors/yospace/src/test/java/com/theoplayer/android/connector/yospace/internal/YospaceSsaiDescriptionSerializerTests.kt b/connectors/yospace/src/test/java/com/theoplayer/android/connector/yospace/internal/YospaceSsaiDescriptionSerializerTests.kt index 7465b57e..fee51a69 100644 --- a/connectors/yospace/src/test/java/com/theoplayer/android/connector/yospace/internal/YospaceSsaiDescriptionSerializerTests.kt +++ b/connectors/yospace/src/test/java/com/theoplayer/android/connector/yospace/internal/YospaceSsaiDescriptionSerializerTests.kt @@ -32,7 +32,7 @@ class YospaceSsaiDescriptionSerializerTests { "fireHistoricalBeacons", "applyEncryptedTracking", "excludedCategories", - "consecutiveBreakTolerance", + "alignConsecutiveBreaks", "token", "customHttpHeaders" ) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 539bb05b..02937a10 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -31,7 +31,7 @@ robolectric = "4.16.1" conviva = "4.0.43" nielsen = "9.2.0.0" comscore = "6.10.0" -yospace = { strictly = "[3.6, 4.0)", prefer = "3.6.7" } +yospace = { strictly = "[3.10.0, 4.0)", prefer = "3.11.2" } [libraries] androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "androidxAppCompat" }