Player
@objc public protocol Player
Player
-
Delegate.
Declaration
Swift
weak var delegate: PlayerDelegate?
-
UIView
used to render the player.Declaration
Swift
var view: UIView
-
Current
PlayingState
Declaration
Swift
var playingState: PlayingState
-
Current
BufferingState
Declaration
Swift
var bufferingState: BufferingState
-
Current
PlaybackState
,Declaration
Swift
var playbackState: PlaybackState
-
Allows playing externally.
Declaration
Swift
var allowsExternalPlayback: Bool
-
Playing on external device.
Declaration
Swift
var isExternalPlaybackActive: Bool
-
Elapsed playback time of the asset.
Declaration
Swift
var streamPosition: Float64
-
Duration of the asset. Will return
.isNan
if stream is live.Declaration
Swift
var streamDuration: Float64
-
End of the seekable window. (
seekableStart
+seekableDuration
)Can be used to get offset in live stream:
let offsetFromlive = Player.seekableEnd - Player.streamPosition print(offsetFromlive)
Declaration
Swift
var seekableEnd: Float64
-
Start of the seekable window.
** Can be used to get position in a live stream:**
let livePosition = Player.streamPosition - Player.seekableStart print(livePosition)
Declaration
Swift
var seekableStart: Float64
-
Duration of the seekable window.
Can be used to get the length of a live stream.
Declaration
Swift
var seekableDuration: Float64
-
The available audio tracks for the current stream
Declaration
Swift
var audioTracks: [TrackOption]?
-
GET current selected audio track SET the track to be played or disabled if nil
Declaration
Swift
var selectedAudioTrack: TrackOption?
-
The available subtitle tracks for the current stream
Declaration
Swift
var subtitleTracks: [TrackOption]?
-
GET current selected subtitle track SET the track to be played or disabled if nil
Declaration
Swift
var selectedSubtitleTrack: TrackOption?
-
GET current output volume SET new output volume
Declaration
Swift
var volume: Float
-
Toggle for playing and pausing the current stream.
Declaration
Swift
func playPause()
-
Resumes playback
Declaration
Swift
func play()
-
Pauses playaback
Declaration
Swift
func pause()
-
Seek to a new position in the current stream.
Declaration
Swift
func seek(toPosition position: Float64)
Parameters
toPosition
The new position to be played from.
-
Cancels pending seek.
Declaration
Swift
func cancelPendingSeeks()
-
Stops playback of the current stream
Declaration
Swift
func stop()
-
Stops playback and releases the player instance
Declaration
Swift
func deinitialize()