PlaybackSpeed
public struct PlaybackSpeed: Equatable
Playback speed
Contents
This page displays:
Description
Use predefined constants or define a value with a custom rate. To check whether the playback speed is supported for the current content, call the canSet(playbackSpeed:) method for the YaPlayer object.
Protocol conformance
The structure conforms to the Equatable protocol.
Properties
|
Name |
Type |
Description |
|
|
|
Playback speed factor |
|
|
|
Playback paused. The playback speed is zero |
|
|
|
0.25× playback speed |
|
|
|
0.5× playback speed |
|
|
|
0.75× playback speed |
|
|
|
Normal (1×) speed 1× |
|
|
|
1.25× playback speed |
|
|
|
1.5× playback speed |
|
|
|
1.75× playback speed |
|
|
|
2× playback speed |
|
|
|
All preset playback speed options from 0.25× to 2× |
Initializers
public init(rate: Float)
Defines a playback speed with a custom factor.
Parameters:
rate: Playback speed factor. The valid range depends on the content.
Examples
if player.canSet(playbackSpeed: .x150) {
try? player.set(playbackSpeed: .x150)
}