WZPlayer
IntroductionWZPlayer is a class used for playing a WOWZ stream from Engine or Cloud. WZPlayer handles decompressing audio and video, playing audio through the device speaker and displaying video frames in a UIView. Methodsplay:callback:- (void) play:(nonnull WowzaConfig *)config callback:(nullable id<WZStatusCallback>)statusCallback; ParametersDiscussionStart playing the video stream. registerDataSink:eventName:- (void) registerDataSink:(nonnull id<WZDataSink>)sink eventName:(nonnull NSString *)eventName; ParametersDiscussionRegisters an object that conforms to the WZDataSink protocol with WZPlayer. The WZDataSink protocol methods will be called when video player is active and a data event is received from the server. stop- (void) stop; DiscussionStop playing the video stream unregisterDataSink:eventName:- (void) unregisterDataSink:(nonnull id<WZDataSink>)sink eventName:(nonnull NSString *)eventName; ParametersDiscussionUnregisters an object that conforms to the WZDataSink protocol with WZPlayer. TypedefsNS_ENUMtypedef NS_ENUM(NSUInteger, WZPlayerViewGravity) { WZPlayerViewGravityResizeAspect = 0, WZPlayerViewGravityResizeAspectFill, WZPlayerViewGravityResize }; Constants
DiscussionDescribes how the video in the player view should fill the view frame. See Also WZPlayerViewGravityResizeAspecttypedef NS_ENUM(NSUInteger, WZPlayerViewGravity) { WZPlayerViewGravityResizeAspect = 0, WZPlayerViewGravityResizeAspectFill, WZPlayerViewGravityResize }; Constants
DiscussionDescribes how the video in the player view should fill the view frame. See Also Properties
avSyncUsesFrameRateAdjustment@property (nonatomic, assign) BOOL avSyncUsesFrameRateAdjustment; DiscussionWhether to attempt to sync audio and video by adjusting the video framerate. Default value is NO. Setting this to YES may cause the video to appear accelerated or slow depending on where and when compensation is needed. currentTime@property (nonatomic, readonly) CMTime currentTime; Discussion* The timecode of the most recent frame displayed by the player, relative to the starting timecode. Returns kCMTimeInvalid if the player is not currently playing, or if no frames have yet been received. metaData@property (nonatomic, readonly, nullable) WZDataMap *metaData; DiscussionThe stream metadata for an actively playing stream muted@property (nonatomic, assign) BOOL muted; DiscussionMute/unmute audio. Default is NO. playerView@property (nonatomic, unsafe_unretained, nonnull) UIView *playerView; DiscussionThe UIView to which the video player will be added. playerViewGravity@property (nonatomic, assign) WZPlayerViewGravity playerViewGravity; DiscussionThe gravity to use for displaying the video in the host view; describes how the prview will fill the given view bounds playing@property (nonatomic, assign, readonly) BOOL playing; DiscussionThe current play state of the WZPlayer instance. prerollDuration@property (nonatomic, assign) Float64 prerollDuration; DiscussionThe amount of time to pre-roll (buffer) the video before playing. The default is 0. readonly for now since this feature is not ready to demo. volume@property (nonatomic, assign) Float32 volume; DiscussionThe volume at which to play the audio. Allowed values are 0.0 (silent) to 1.0 (full volume). Any value outside this range is ignored. Default is 1.0. |