IPacketObserver
The definition of IPacketObserver.
onReceiveAudioPacket
Occurs when the local user receives an audio packet.
Parameters
- packet
- The received audio packet, see Packet.
Returns
true: The audio packet is received successfully.false: The audio packet is discarded.
onReceiveVideoPacket
Occurs when the local user receives a video packet.
Parameters
- packet
- The received video packet, see Packet.
Returns
true: The video packet is received successfully.false: The video packet is discarded.
onSendAudioPacket
Occurs when the local user sends an audio packet.
Parameters
- packet
- The sent audio packet, see Packet.
Returns
true: The audio packet is sent successfully.false: The audio packet is discarded.
onSendVideoPacket
Occurs when the local user sends a video packet.
Parameters
- packet
- The sent video packet, see Packet.
Returns
true: The video packet is sent successfully.false: The video packet is discarded.
onStreamMessage
Occurs when the local user receives the data stream from the remote user.
public void onStreamMessage(int uid, int streamId, byte[] data) {}
The SDK triggers this callback when the local user receives the stream message that the remote user sends by calling the sendStreamMessage method.
Parameters
- uid
- The ID of the remote user sending the message.
- streamId
- The stream ID of the received message.
- data
- The data received.
onStreamMessageError
Occurs when the local user does not receive the data stream from the remote user.
public void onStreamMessageError(int uid, int streamId, int error, int missed, int cached) {}
The SDK triggers this callback when the local user fails to receive the stream message that the remote user sends by calling the sendStreamMessage method.
Parameters
- uid
- The ID of the remote user sending the message.
- streamId
- The stream ID of the received message.
- error
- Error code.
- missed
- The number of lost messages.
- cached
- Number of incoming cached messages when the data stream is interrupted.
onUplinkNetworkInfoUpdated
Occurs when the uplink network information changes.
public void onUplinkNetworkInfoUpdated(UplinkNetworkInfo info) {}
The SDK triggers this callback when the uplink network information changes.
Parameters
- info
- The uplink network information. See UplinkNetworkInfo.