Interface IZegoMediaPlayerBlockDataHandler


  • public interface IZegoMediaPlayerBlockDataHandler
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void onBlockBegin​(ZegoMediaPlayer mediaPlayer, java.lang.String path)
      The callback triggered when the media player is about to throw the block data of the media resource.
      int onBlockData​(ZegoMediaPlayer mediaPlayer, java.nio.ByteBuffer buffer)
      The callback triggered when the media player throws the block data of the media resource.
    • Method Detail

      • onBlockBegin

        void onBlockBegin​(ZegoMediaPlayer mediaPlayer,
                          java.lang.String path)
        The callback triggered when the media player is about to throw the block data of the media resource. Available since: 3.4.0 Description: 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. Restrictions: When playing copyrighted music, this callback will be disabled by default. If necessary, please contact ZEGO technical support.
        Parameters:
        mediaPlayer - Callback player object.
        path - The path of the media resource.
      • onBlockData

        int onBlockData​(ZegoMediaPlayer mediaPlayer,
                        java.nio.ByteBuffer buffer)
        The callback triggered when the media player throws the block data of the media resource. Available since: 3.4.0 Description: 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. Restrictions: When playing copyrighted music, this callback will be disabled by default. If necessary, please contact ZEGO technical support.
        Parameters:
        mediaPlayer - Callback player object.
        buffer - The block data of the media resource.
        Returns:
        The size of the buffer, -1 is returned for failure.