Package-level declarations

Types

Link copied to clipboard

Holds callbacks that will be triggered for specific Application lifecycle events.

Link copied to clipboard

Application's LifecycleObserver that notifies registered AppLifecycleEventCallbacks when the Application is coming to the foreground or going to the background.

Link copied to clipboard
typealias SideEffect = () -> Unit

Type that Represents a SideEffect for particular Transition

Link copied to clipboard
data class State<TState : Enum<TState>>(val valueMap: Map<TState, State<*>>)

The State information on State Machine

Link copied to clipboard

Every StateMachine has a UNIQUE parent State ENUM among it's Peers

Link copied to clipboard
typealias TransitionHandler<TContext, TState, TEvent> = (context: TContext, state: TState, event: TEvent) -> TransitionInfo<TState>?

Type that represents a lambda that processes all the Transitions for a particular StateMachine

Link copied to clipboard
data class TransitionInfo<TState : Enum<TState>>(val value: TState, val sideEffect: SideEffect = EMPTY_SIDE_EFFECT)

Represents the New State and Side Effect pair for any transition

Link copied to clipboard
data class VASTAd(val title: String, val errorURI: String?, val impressionTrackingURLs: List<String>, val videoDuration: String?, val videoMediaFiles: List<VASTMediaFile>, val videoClickThroughURL: String?, val videoClickTrackingURLs: List<String>, val companions: List<VASTCompanion>, val vastAdTagURL: String?)

Representation of VAST document's element.

Link copied to clipboard
Link copied to clipboard
data class VASTCompanion(val companionWidth: Int, val companionHeight: Int, val companionResourceURI: String?, val companionAltText: String?, val companionClickThroughURL: String?, val companionClickTrackingURL: String?, val companionAPIFramework: String?)

Representation of VAST document's element.

Link copied to clipboard
data class VASTMediaFile(val videoWidth: Int, val videoHeight: Int, val videoDeliveryProtocol: String?, val videoMimeType: String?, val videoMediaFileURL: String?)

Representation of VAST document's element.

Link copied to clipboard
data class WebVTTThumbnailMetadata(val thumbnailTimeRange: LongRange, val thumbnailURL: String)

Represents a thumbnail metadata

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
const val TV_DEVICE: String
Link copied to clipboard

Indicates that the VAST document parsing failed.

Link copied to clipboard

Indicates that the network request to fetch VAST document failed.

Link copied to clipboard

Indicates that the network request to fetch WebVTT document failed.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun computeDiskCacheDir(applicationContext: Context, directory: String): File

Creates a subdirectory, under existing platform cache designated directory, that is used for caching data related to a specific usage context(images, http responses etc). The logic tries to use the external storage (sdcard) path but if not mounted, falls back on the internal storage.

Link copied to clipboard

Computes device display dimensions.

Link copied to clipboard
fun <T : Any, R : Any> convertToResult(data: T? = null, error: R? = null): Result<T, R>

Wraps a passed data (or) error into appropriate Result object. Note: Only one param is expected to be passed.

Link copied to clipboard
fun customBinarySearch(positionMs: Long, thumbnails: List<WebVTTThumbnailMetadata>): Int

Searches, using the binary search algorithm, the collection of WebVTTThumbnailMetadata objects to find a thumbnail URL that matches a given time position in a stream.

Link copied to clipboard

Extension to decode a given Base64 String to ByteArray

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun getAttributeValue(xpp: XmlPullParser, attributeName: String): String?

Returns the value of an attribute of the current start tag.

Link copied to clipboard

Returns the value of an attribute of the current start tag. Any raw attribute names in the current start tag have their prefixes stripped before matching.

Link copied to clipboard
fun getCacheQuota(applicationContext: Context, diskCacheDir: File): Long?

Returns the recommended amount of maximum disk space that can be used by the application to perform the caching logic.

Link copied to clipboard

Determines the type of Android device the application is running on.

Link copied to clipboard

Returns the Double value of an attribute of the current start tag.

Link copied to clipboard

Returns the Float value of an attribute of the current start tag.

Link copied to clipboard
fun getIntAttributeValue(xpp: XmlPullParser, attributeName: String): Int

Returns the Int value of an attribute of the current start tag.

Link copied to clipboard
fun getLongAttributeValue(xpp: XmlPullParser, attributeName: String): Long

Returns the Long value of an attribute of the current start tag.

Link copied to clipboard

Returns the character data if the current event matches the TEXT event.

Link copied to clipboard
fun getThumbnailURL(positionMs: Long, thumbnails: List<WebVTTThumbnailMetadata>): String?

Searches the collection of WebVTTThumbnailMetadata objects to find a thumbnail URL that matches a given time position in a stream.

Link copied to clipboard

Returns whether the current event is an end tag.

Returns whether the current event is an end tag with the specified name.

Link copied to clipboard

Returns whether the current event is an end tag with the specified name. If the current event has a raw name then its prefix is stripped before matching.

Link copied to clipboard
Link copied to clipboard

Returns whether the current event is a start tag.

Returns whether the current event is a start tag with the specified name.

Link copied to clipboard

Returns whether the current event is a start tag with the specified name. If the current event has a raw name then its prefix is stripped before matching.

Link copied to clipboard
fun isWebVTTHeaderLine(webVTTThumbnailContent: String): Boolean

Returns whether the given input is the first line of a WebVTT file.

Link copied to clipboard

If the provided XmlPullParser is currently positioned at the start of a tag, skips forward to the end of that tag.

Link copied to clipboard

Returns the Stack-Trace of a Throwable as String

Link copied to clipboard

Extension to encode a given Byte Array to Base64 String

fun String.toBase64(charset: Charset = Charsets.UTF_8): String

Extension to encode a given Charsets.UTF_8 string to Base64