logo
On this page

ZegoMediaPlayerBlockDataHandler

ZegoMediaPlayerBlockDataHandler

Declared in ZegoExpressEventHandler.h

Methods

mediaPlayer:blockBegin

mediaPlayer:blockBegin
- (void)mediaPlayer:(ZegoMediaPlayer *)mediaPlayer blockBegin:(NSString *)path;
The callback triggered when the media player is about to throw the block data of the media resource.
Declared in ZegoExpressEventHandler.h

Parameters

NameTypeDescription
mediaPlayerZegoMediaPlayer *Callback player object.
pathNSString *The path of the media resource.

Details

The callback triggered when the media player is about to throw the block data of the media resource.

  • Trigger: The callback is generated when the media player starts playing.
  • Caution: The callback does not actually take effect until call [setBlockDataHandler] to set.
  • Available since: 3.4.0
  • Restrictions: When playing copyrighted music, this callback will be disabled by default. If necessary, please contact ZEGO technical support.

mediaPlayer:blockData:bufferSize

mediaPlayer:blockData:bufferSize
- (int)mediaPlayer:(ZegoMediaPlayer *)mediaPlayer blockData:(unsigned char *const)buffer bufferSize:(unsigned int)bufferSize;
The callback triggered when the media player throws the block data of the media resource.
Declared in ZegoExpressEventHandler.h

Parameters

NameTypeDescription
mediaPlayerZegoMediaPlayer *Callback player object.
bufferunsigned char *constThe block data of the media resource.
bufferSizeunsigned intLength of media resource block data.

Details

The callback triggered when the media player throws the block data of the media resource.

  • Trigger: This callback will be generated after receiving the [onBlockBegin] callback.
  • Caution: The callback does not actually take effect until call [setBlockDataHandler] to set. The buffer size before and after decryption should be consistent.
  • Available since: 3.4.0
  • Restrictions: When playing copyrighted music, this callback will be disabled by default. If necessary, please contact ZEGO technical support.

Return

The size of the buffer, -1 is returned for failure.

Previous

zegomediaplayer

Next

zegomediaplayermediainfo

On this page

Back to top