onPublishPrivilegeTokenWillExpire method

FutureOr<void> onPublishPrivilegeTokenWillExpire(
  1. dynamic rtcRoom
)
override

@detail callback @author qipengxiang @brief Callback triggered 30s before the publishing privilege of the Token expires.
After receiving this callback, you must call updateToken:{@link #ByteRTCRTSRoom#updateToken} to update the publishing privilege Token. @param rtcRoom ByteRTCRoom object. @note Once a user's publishing privilege expires:
- Either during stream publishing or when attempting to publish a stream, the user will get the notification of kPublishStateChangeReasonNoPublishPermission via rtcRoom:onVideoPublishStateChanged:info:state:reason:{@link #ByteRTCRoomDelegate#rtcRoom:onVideoPublishStateChanged:info:state:reason}, rtcRoom:onAudioPublishStateChanged:info:state:reason:{@link #ByteRTCRoomDelegate#rtcRoom:onAudioPublishStateChanged:info:state:reason}. - The publishing streams of the user will be removed, and remote users in the room will get informed via rtcRoom:onUserPublishStreamVideo:info:isPublish:{@link #ByteRTCRoomDelegate#rtcRoom:onUserPublishStreamVideo:info:isPublish}, rtcRoom:onUserPublishStreamAudio:info:isPublish:{@link #ByteRTCRoomDelegate#rtcRoom:onUserPublishStreamAudio:info:isPublish}. @order 15

Implementation

FutureOr<void> onPublishPrivilegeTokenWillExpire(dynamic rtcRoom) async {
  if ($instance == null || $instance is! IRTCRoomEventHandler) {
    return;
  }
  return ($instance as IRTCRoomEventHandler)
      .onPublishPrivilegeTokenWillExpire
      ?.call();
}