WOWZPlayer
IntroductionUse the WOWZPlayer class to play streams from Wowza Streaming Engine or Wowza Streaming Cloud over the WOWZ protocol, as well as to play ultra low latency streams from Wowza Streaming Cloud. WOWZPlayer decompresses audio and video, plays audio through the device speaker, and displays video frames in a UIView. Methods
pauseHLSPlayback-(void)pauseHLSPlayback; DiscussionPauses the HLS fallback stream. play:callback:- (void) play:(nonnull WowzaConfig *)config callback:(nullable id<WOWZStatusCallback>)statusCallback; ParametersDiscussionStarts playing the stream. registerDataSink:eventName:- (void) registerDataSink:(nonnull id<WOWZDataSink>)sink eventName:(nonnull NSString *)eventName; ParametersDiscussionRegisters a WOWZDataSink object with WOWZPlayer. WOWZDataSink protocol methods are called when the player is active and a data event is received from the server. resetPlaybackErrorCount-(void)resetPlaybackErrorCount; DiscussionResets the playback error count to zero. setupHLSWithView:-(void)setupHLSWithView:(UIView *_Nullable)viewToAttachTo; DiscussionSets up the HLS fallback stream. Can be used with ultra low latency streams from Wowza Streaming Cloud; note, however, that Apple HLS streams experience greater latency than WebSocket streams. startHLSPlayback-(void)startHLSPlayback; DiscussionStarts playing the HLS fallback stream. stop- (void) stop; DiscussionStops playing the stream. stopHLSPlayback-(void)stopHLSPlayback; DiscussionStops playing the HLS fallback stream. unregisterDataSink:eventName:- (void) unregisterDataSink:(nonnull id<WOWZDataSink>)sink eventName:(nonnull NSString *)eventName; ParametersDiscussionUnregisters a WOWZDataSink object from WOWZPlayer. TypedefsNS_ENUMtypedef NS_ENUM(NSUInteger, WOWZPlayerViewGravity) { WOWZPlayerViewGravityResizeAspect = 0, WOWZPlayerViewGravityResizeAspectFill }; Constants
DiscussionDescribes how the video is displayed in the player's available screen area. See Also WOWZPlayerViewGravityResizeAspecttypedef NS_ENUM(NSUInteger, WOWZPlayerViewGravity) { WOWZPlayerViewGravityResizeAspect = 0, WOWZPlayerViewGravityResizeAspectFill }; Constants
DiscussionDescribes how the video is displayed in the player's available screen area. See Also Properties
clientCallback@property (nonatomic, unsafe_unretained) NSObject<WOWZStatusCallback> *clientCallback; DiscussionAccess to the client callback incase the order of deinit/dealloc needs to be manually controlled on the delegate callback. currentTime@property (nonatomic, readonly) CMTime currentTime; DiscussionThe timecode of the most recent frame displayed by the player, relative to the starting timecode. Returns kCMTimeInvalid if a stream isn't playing or if the player hasn't received any frames. metaData@property (nonatomic, readonly, nullable) WOWZDataMap *metaData; DiscussionThe stream metadata for the stream that's playing. muted@property (nonatomic, assign) BOOL muted; DiscussionMute or unmute the audio. The default is no, or unmuted. playerView@property (nonatomic, unsafe_unretained, nonnull) UIView *playerView; DiscussionThe UIView to which the player should be added. playerViewGravity@property (nonatomic, assign) WOWZPlayerViewGravity playerViewGravity; DiscussionThe gravity to use to display the video in the host view. Gravity describes how the video frame fills the available screen area. playing@property (nonatomic, assign, readonly) BOOL playing; DiscussionThe playing state of the WOWZPlayer instance. prerollDuration@property (nonatomic, assign) Float64 prerollDuration; DiscussionThe amount of time to buffer the video before playing. The default is 0 seconds; the maximum is 60 seconds. syncOffset@property (nonatomic, assign) Float32 syncOffset; DiscussionThe sync offset to scrub video to sync. Specify a value between -1.0 and 3.0 seconds; any value outside of this range will be ignored. The default is 1.0. useHLSFallback@property (nonatomic, assign) BOOL useHLSFallback; DiscussionPlay an Apple HLS stream as a fallback if the primary WOWZ-based conection is unsuccessful. Can be used with ultra low latency streams from Wowza Streaming Cloud; note, however, that Apple HLS streams experience greater latency than WebSocket streams. volume@property (nonatomic, assign) Float32 volume; DiscussionThe volume to play the audio. Specify a value between 0.0 (silent) and 1.0 (full volume); any value outside of this range will be ignored. The default is 1.0. |