duration

abstract val duration: Double

The duration of the source in seconds if it's a VoD or Double.POSITIVE_INFINITY if it's a live stream. Defaults to -1.0 if the duration is not available or not known.

Limitations

While casting to a cast-compatible device, the returned duration for non-active sources is the duration of the source on the local player. This is due to limitations of the cast API. In most cases there is no difference between the duration on the local player and on the cast device.