Instance Methods | Properties | List of all members
CjVideoPlayer Class Reference
Inheritance diagram for CjVideoPlayer:

Instance Methods

(id) - initWithParentView:
 Initialize and specify view to display video. More...
(void) - setNbrFramesToDelay:
 Set the number of frames to delay video by. More...
(void) - updateBounds
 Update video bounds tied to parent view. More...
(void) - displayH264Nalus:
 Display NALU(s)/video frame(s). More...
(void) - deinit
 Deinit video player. More...


id< CjVideoPlayerDelegatedelegate

Method Documentation

◆ deinit()

- (void) deinit

Deinit video player.

Deinit and reinit video player between sessions to avoid old buffered frames to be displayed first.

◆ displayH264Nalus:()

- (void) displayH264Nalus: (NSData *)  nalus

Display NALU(s)/video frame(s).

nalusNALUs to be displayed. This can be a single I-frame, P-frame, SPS, PPS, or a few NALUs together, such as for example a SPS, PPS and I-frame.
For the video player to be able to display a frame it first needs to have received NALUs with both SPS and PPS, as well as an I-frame.

◆ initWithParentView:()

- (id) initWithParentView: (UIView *)  parentView

Initialize and specify view to display video.

parentViewView where the video will be displayed.

◆ setNbrFramesToDelay:()

- (void) setNbrFramesToDelay: (NSInteger)  nbrFramesToDelay

Set the number of frames to delay video by.

nbrFramesToDelayNumber of video frames to delay video by. For example if setting this number to 3 for a video stream at 15 fps, the added delay will be 200 ms.
Ideally on the audio side, chunks of 20 ms of audio are used for streaming, which results in the audio delay being very small and not noticeable compared to video. But some embedded systems are not able to deal with such small audio chunks. As a result the length of chunks needs to be increased, which then makes the audio lag apparent, even while video is near instantaneous. Use this function to delay the video by the number of frames needed to match up with the audio.

◆ updateBounds()

- (void) updateBounds

Update video bounds tied to parent view.

If the parent view is using auto-layout in a way that causes its bounds to change, its bounds may not show correctly until after viewDidAppear. If that is the case call updateBounds in viewDidAppear, and remove animation in your appearing view to avoid the video moving in case it shows up before viewDidAppear got called.

The documentation for this class was generated from the following file: