Skip to content
Last updated

Manage media playback with the Wowza Flowplayer Apple SDK

With the Wowza Flowplayer Apple SDK and integrated API, you can control and manage media playback from the player by using the properties and methods outlined on this page.

Properties allow you to work with events emitted by the player, so you can further manage media playback or configure the player within your iOS or tvOS application. The methods listed here allow you to perform specific actions to change the player and its behavior.

FlowplayerAPI

Applies to: iOS and tvOS

The FlowplayerAPI protocol is platform-agnostic. You can use it to create a custom video player interface while controlling and managing your playback in your iOS and tvOS applications. The protocol provides basic video controls and gives you access to the properties and methods outlined in this section.

Properties

PropertyDescription
audioListArray containing all available audio tracks.
autoPlayBoolean that determines if media playback should start automatically. Set to false by default. If true, enables autoplay.
avPlayerUnderlying AVPlayer instance. Returns nil if no player is available.
bufferLoadedPercentageProgress of the buffer loading, expressed as a percentage. Value of 0.0 indicates no buffer has been loaded. Value of 100.0 indicates that the entire buffer has loaded.
bufferStateCurrent buffer state of the player. Keeps up with playback and indicates if the buffer is empty. You can observe this property using the player(_:didChangeBufferState:) delegate method or .flowplayerDidChangeBufferState property notification.
currentAudioCurrently active audio track. Returns nil if no audio track if active.
currentSubtitleCurrently active subtitle track. Returns nil if no subtitle track is active.
delegateDelegate to receive player events, such as playback state changes, errors, or metadata updates.
durationDuration of the current media. Returns nil if no media is loaded.
dvrWindowCurrent Digital Video Recorder (DVR) window information, including the start and end times of the available playback duration. Represents the portion of the content available for seeking and playback control. If the content is not DVR-enabled or the DVR window is unavailable, the DVRWindow object is nil.
idUnique identifier used to recognize a specific player instance. Can be set programmatically or randomly generated using the UUID format. Helpful when integrating multiple players within a view at the same time.
isMutedBoolean that indicates if the audio is muted.
isReadyIndicates if the player is ready to perform certain actions, like play, pause, seek, etc. Set to true if the player is ready, and false otherwise. Can be used to control UI elements, like enabling or disabling play buttons based on the readiness of the player.
mediaCurrently loaded media. Returns nil if no media is loaded. Use the load(_:) methods to set this value.
mediaHistoryListStores all previously set media items. Doesn't store the current media item.
ovpConfigOptional OVPConfig object representing the current Wowza Video configuration. Returns nil if no Wowza Video configuration is available. To get the correct configuration, check this value after the player has called the ready state.
playbackStateCurrent playback state of the player. Indicates if the playback started, ended, or is idle.
playbackStateListList that stores previously trigger playback states. First position captures the latest playback state change. When the state changes, the first position is updated and the list shifts to the end.
playbackTypeCurrent media playback type of the video player. To get the correct media playback type, check this value after the player has called the ready state.
positionCurrent playback position of the media. Returns nil if no media is loaded.
preferredPeakBitRatePreferred peak bit rate for network playback. Returns nil if not set.
qualityPresentation quality of the current media. Returns nil if no media is loaded.
ratePlayback rate of the player. Ranges from -2.0 (reverse) to 2.0 (double speed).
sourceHistoryListStores all previously requested source URL assets. The current source URL is not included.
sourceURLRepresents the source URL for the media to be played by the player. Should point to a valid AVAsset, such as a video or audio file. If nil, there's no source URL set for the player. Before the player can begin playback, a valid media property must be provided.
stateCurrent state of the player.
stateListList that stores previously triggered player states. First position captures the latest player state change. When the state changes, the first position is updated and the list shifts to the end.
subtitleListArray containing all available subtitle tracks.
volumeCurrent volume of the player, with a range of 0.0 to 1.0.

Methods

load() external media
Description: Loads external media from a URL or file path. Learn more.
func load(external media: MediaExternal)
ParameterDescription
mediaDefines the external media source to load.
load() DAI media
Description: Loads media from a Google Dynamic Ad Insertion (DAI) source. Learn more.
func load(dai media: MediaDAI)
ParameterDescription
mediaDefines the DAI media source to load.
load() Wowza Video media
Description: Loads media from the Wowza Video platform.
func load(ovp media: MediaOVP)
ParameterDescription
mediaDefines the Wowza Video media source to load.
reload()
Description: Reloads current media and returns a boolean indicating success or failure. Allows to reset the playback state or update playback parameters. Returns a boolean value that indicates if the reload was successful.
func reload() -> Bool
pause()
Description: Pauses media playback.
func pause()
play()
Description: Starts or resumes media playback. If the playback is complete, then seeks back to the beginning and starts again.
func play()
stop()
Description: This method stops the currently playing media and allows the loading of new media. It should only be used when you need to abort the playback forcefully. When called, it emits the PlayerState/halted event from the player.
func stop()
seek()
Description: Seeks the player to a specified time within the content that's currently playing.
func seek(_ value: Double)
ParameterDescription
valueDefines the time to seek to, in seconds.
selectTrack(audio)
Description: Selects an audio track by ID.
func selectTrack(audio id: Int)
ParameterDescription
idDefines the ID of the audio track to select.
selectTrack(subtitle)
Description: Selects a subtitle track by ID.
func selectTrack(subtitle id: Int)
ParameterDescription
idDefines the ID of the subtitle track to select.

FlowplayerViewAPI

Applies to: iOS

The FlowplayerViewAPI protocol extends the FlowplayerAPI protocol, providing additional control over the player's appearance and behavior. However, it can only be used with your iOS applications to consume the player as a view. When using this protocol, you can access the following properties and methods.

Properties

PropertyDescription
adDelegateFlowplayerAdDelegate object that should receive all Interactive Media Ad (IMA) events from the player.
controlsConfigConfiguration object for the player's controls. Contains various properties to customize the appearance and behavior of the player controls. If nil, the player uses the default control configuration.
enableBackgroundPlaybackBoolean value indicating if the player should continue playback when the app is in the background. If true, the player continues playing when the app is in the background. When false (default), the player pauses instead. To use this property correctly, make sure you support background playback inside your AppDelegate or SceneDelegate. See Playing Background Audio and Background playback for more.
fullscreenControlsOrientationBoolean value indicating if entering or exiting full-screen mode changes the device orientation. If true, entering full-screen mode changes the device orientation to landscape, while exiting full-screen mode changes the device orientation to portrait. When false, the player's full-screen mode doesn't affect device orientation.
hideControlsBoolean value indicating if the player controls should be hidden (true). If false, the player controls are visible.
isFullscreenBoolean value indicating if the player is in full-screen mode. If true, player is in full-screen mode. If false, the player is in its normal mode.
orientationCurrent orientation of the device.
orientationControlsFullscreenBoolean value indicating if changing the device orientation should control full-screen mode. If true, rotating the device to the landscape orientation enters full-screen mode, while going back to landscape orientation exits full-screen mode. When false, device orientation doesn't affect the player's full-screen mode.
viewDelegateFlowplayerViewDelegate object that should receive view events.

Methods

openFullscreen()
Description: Changes the player to full-screen mode. If fullscreenControlsOrientation is true, the device orientation also changes to landscape.
func openFullscreen()
closeFullscreen()
Description: Exist full-screen mode, changing the player to its normal mode. If fullscreenControlsOrientation is true, the device orientation also changes to portrait.
func closeFullscreen()

FlowplayerManagerAPI

Applies to: tvOS

The FlowplayerManagerAPI protocol extends the FlowplayerAPI protocol, but only applies to the tvOS platform. It provides a player-manager, along with additional control over the player's behavior and support for managing Interactive Media Ad (IMA) content. When using this protocol, you have access to the properties in the following table.

Properties

PropertyDescription
adDelegateFlowplayerAdDelegate object that should receive all Interactive Media Ad (IMA) events from the player.
info

Assign the delegate before playing any IMA ads to ensure that the delegate receives relevant events.