VKPlayerCustomIODelegate Protocol Reference

Conforms to NSObject
Declared in VKPlayerControllerBase.h

Overview

Implement this delegate if you want to provide custom I/O data to ffmpeg, it’s very useful when decoding a(n) audio/video stream in memory

– player:ioStreamRead:size: required method

Required delegate method, add this method to your viewcontroller to provide A/V stream data to ffmpeg

- (int)player:(VKPlayerControllerBase *)player ioStreamRead:(uint8_t *)data size:(int)size

Parameters

player

The player object that owns the notification

data

Indicates the data pointer to be filled

size

Indicates the size of the data pointer to be filled

Declared In

VKPlayerControllerBase.h

– player:ioStreamSeek:whence:

Optional delegate method, add this method to your viewcontroller to be able to seek in your A/V stream

- (int64_t)player:(VKPlayerControllerBase *)player ioStreamSeek:(uint64_t)offset whence:(int)whence

Parameters

player

The player object that owns the notification

offset

Indicates the offset bytes of data

whence

Indicates the size of the data pointer to be filled Important : Even if You don’t want to implement A/V stream seeking functionality, this method must be implemented with a “-1” return value

Declared In

VKPlayerControllerBase.h

– ioStreamOpenForPlayer:

Optional delegate method, this method is a helper method and it’s good for including the custom opening socket/file etc. code and this method must return 0 for successful opening

- (VKError)ioStreamOpenForPlayer:(VKPlayerControllerBase *)player

Parameters

player

The player object that owns the notification

Declared In

VKPlayerControllerBase.h

– ioStreamCloseForPlayer:

Optional delegate method, this method is a helper method and it’s good for including the custom closing socket/file etc. code

- (void)ioStreamCloseForPlayer:(VKPlayerControllerBase *)player

Parameters

player

The player object that owns the notification

Declared In

VKPlayerControllerBase.h