MapboxReplayer

class MapboxReplayer

This class is similar to a music player. It will include controls like play, pause, seek.

Constructors

MapboxReplayer
Link copied to clipboard
fun MapboxReplayer()

Functions

clearEvents
Link copied to clipboard
fun clearEvents()
Stops the player, seeks to the beginning, and clears all replay events.
durationSeconds
Link copied to clipboard
fun durationSeconds(): Double
The duration of the replay.
equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
eventRealtimeOffset
Link copied to clipboard
fun eventRealtimeOffset(eventTimestamp: Double): Double
Used when the replayer is actively playing and emitting replay events.
eventSeconds
Link copied to clipboard
fun eventSeconds(eventTimestamp: Double): Double
The time of an event, relative to the duration of the replay.
finish
Link copied to clipboard
fun finish()
Convenience function to stop, remove listeners, and clean up the player.
hashCode
Link copied to clipboard
open fun hashCode(): Int
play
Link copied to clipboard
fun play()
This will begin playing the ReplayEventBase and notifying observers registered via registerObserver
playbackSpeed
Link copied to clipboard
fun playbackSpeed(scale: Double)
This determines the speed of event playback.
playFirstLocation
Link copied to clipboard
fun playFirstLocation()
When initializing or testing an app, it is needed and useful to decide a code location to play the first location from GPS.
pushEvents
Link copied to clipboard
fun pushEvents(events: List<ReplayEventBase>): MapboxReplayer
Appends events to be replayed.
pushRealLocation
Link copied to clipboard
@RequiresPermission(anyOf = ["android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION"])
fun pushRealLocation(context: Context, eventTimestamp: Double)
When initializing or testing an app, it is needed and useful to push a device location.
registerObserver
Link copied to clipboard
fun registerObserver(observer: ReplayEventsObserver)
Register replay event observers.
seekTo
Link copied to clipboard
fun seekTo(replayEvent: ReplayEventBase)
Seek to the event you want to play from.
fun seekTo(replayTime: Double)
Seek to a time to play from.
stop
Link copied to clipboard
fun stop()
Stop playing all remaining and incoming events.
toString
Link copied to clipboard
open fun toString(): String
unregisterObserver
Link copied to clipboard
fun unregisterObserver(observer: ReplayEventsObserver)
Remove registered observers.
unregisterObservers
Link copied to clipboard
fun unregisterObservers()
Remove all registered observers.