fetchLocatorAsRange

abstract fun fetchLocatorAsRange(start: Int, end: Int, onSuccess: (SimpleLocatorData) -> Unit, onError: (ColibrioException) -> Unit)

Fetches a locator as a range that most closely matches the given start and end timeline positions.

The returned locator will contain the content up-to but not including the end timeline position. For example, if the timeline has WORDS as unit of measurement, calling fetchLocatorAsRange(0, 20) will fetch a locator starting at the beginning of word 0 up to the end of word 19.

Parameters

start

An integer value that will be clamped between 0 and the timeline length.

end

An integer value that will be clamped between start and timeline length.

onSuccess

Called with the locator that most closely matches the given start and end timeline positions.

onError

Called if an error occurs when the operation is performed.


abstract suspend fun fetchLocatorAsRange(start: Int, end: Int): ColibrioResult<SimpleLocatorData>

Fetches a locator as a range that most closely matches the given start and end timeline positions.

The returned locator will contain the content up-to but not including the end timeline position. For example, if the timeline has WORDS as unit of measurement, calling fetchLocatorAsRange(0, 20) will fetch a locator starting at the beginning of word 0 up to the end of word 19.

Return

Either ColibrioResult.Success containing the locator that most closely matches the given start and end timeline positions, or ColibrioResult.Error containing the error.

Parameters

start

An integer value that will be clamped between 0 and the timeline length.

end

An integer value that will be clamped between start and timeline length.