An object that controls playback of a single audio item.
SDK
- watchOS 2.0+
Framework
- Watch
Kit
Overview
Use a player object to start and stop playback and to control the rate of playback. (The WKAudio subclass extends the basic behavior to support playback of more than one item.)
The value of the player’s presentation-related properties are not valid until the underlying asset is loaded. Use the value of the status property to determine when it is valid to get the values of other properties. Specifically, wait until the status changes to ready to access relevant properties.
The WKAudio class is key-value observing compliant for the current, status, and rate properties. You can use an observer to detect changes to those properties and react accordingly. For information on how to observe properties using key-value observing, see Key-Value Observing Programming Guide.