-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable ping scheduler only if ping feature is requested.
- Loading branch information
Showing
4 changed files
with
47 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
...lynk/src/main/java/com/theoplayer/android/connector/uplynk/internal/UplynkPingFeatures.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package com.theoplayer.android.connector.uplynk.internal | ||
|
||
import com.theoplayer.android.connector.uplynk.UplynkAssetType | ||
import com.theoplayer.android.connector.uplynk.UplynkSsaiDescription | ||
|
||
enum class UplynkPingFeatures(val pingfValue: Int) { | ||
NO_PING(0), | ||
AD_IMPRESSIONS(1), | ||
FW_VIDEO_VIEWS(2), | ||
AD_IMPRESSIONS_AND_FW_VIDEO_VIEWS(3), | ||
LINEAR_AD_DATA(4); | ||
|
||
companion object { | ||
fun from(ssaiDescription: UplynkSsaiDescription): UplynkPingFeatures { | ||
val isVod = ssaiDescription.assetType == UplynkAssetType.ASSET | ||
with(ssaiDescription.pingConfiguration) { | ||
return when { | ||
isVod && adImpressions && freeWheelVideoViews -> AD_IMPRESSIONS_AND_FW_VIDEO_VIEWS | ||
isVod && adImpressions -> AD_IMPRESSIONS | ||
isVod && freeWheelVideoViews -> FW_VIDEO_VIEWS | ||
!isVod && linearAdData -> LINEAR_AD_DATA | ||
else -> NO_PING | ||
} | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters