IZegoMediaPlayerBlockDataHandler
IZegoMediaPlayerBlockDataHandler
Declared in callback/IZegoMediaPlayerBlockDataHandler.java
Methods
onBlockBegin
onBlockBegin
public void onBlockBegin(ZegoMediaPlayer mediaPlayer, String path)The callback triggered when the media player is about to throw the block data of the media resource.
Declared in
callback/IZegoMediaPlayerBlockDataHandler.javaParameters
| Name | Type | Description |
|---|---|---|
| mediaPlayer | ZegoMediaPlayer | Callback player object. |
| path | String | 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.
onBlockData
onBlockData
public int onBlockData(ZegoMediaPlayer mediaPlayer, ByteBuffer buffer)The callback triggered when the media player throws the block data of the media resource.
Declared in
callback/IZegoMediaPlayerBlockDataHandler.javaParameters
| Name | Type | Description |
|---|---|---|
| mediaPlayer | ZegoMediaPlayer | Callback player object. |
| buffer | ByteBuffer | The block data of the media resource. |
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.
