onWTNDataMessageReceived method

FutureOr<void> onWTNDataMessageReceived(
  1. String streamId,
  2. ByteBuffer message,
  3. DataMessageSourceType sourceType
)

@detail callback @valid since 3.60. @author hanchenchen @brief The data information contained in the callback of WTN stream..
After calling subscribeWTNAudioStream{@link #IWTNStream#subscribeWTNAudioStream}/subscribeWTNVideoStream{@link #IWTNStream#subscribeWTNVideoStream}, you can listen to this callback and retrieve SEI messages inserted by Open API calls or audio volume. @param streamId ID of the WTN stream @param message The received data message's content is as follows:

  • Data inserted by calling the OpenAPI.
  • Media volume in JSON, before you can receive which you need to enable it via calling the OpenAPI. Refer to the definition below to parse the JSON string. {
    "Type" : "VolumeIndication", //Specific business type.
    "VolumeInfos" : [ // Business type corresponding information
    {
    "RoomId":"1000001", // Room ID
    "UserId":"1000001", // User ID
    "StreamType":0, // 0:camera stream;1:screen stream
    "LinearVolume":1 // LinearVolume
    }
    @param sourceType Message source. See DataMessageSourceType{@link #DataMessageSourceType}. @note You also need to listen to onWTNSEIMessageReceived{@link #IWTNStreamEventHandler#onWTNSEIMessageReceived} to receive SEI inserted via API by the client SDK. @order 6

Implementation

FutureOr<void> onWTNDataMessageReceived(String streamId, ByteBuffer message,
    DataMessageSourceType sourceType) async {}