onSubscribePrivilegeTokenWillExpire method

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

@detail callback @author qipengxiang @brief Callback triggered 30s before the subscribing privilege of the Token expires.
After receiving this callback, you must call updateToken:{@link #ByteRTCRTSRoom#updateToken} to update the subscribing privilege Token. @param rtcRoom ByteRTCRoom object. @note After a user's subscribing privilege expires, the user will fail to subscribe to new streams, or the subscribed streams will be removed, and he/she will receive rtcRoom:onVideoSubscribeStateChanged:info:state:reason:{@link #ByteRTCRoomDelegate#rtcRoom:onVideoSubscribeStateChanged:info:state:reason}, rtcRoom:onAudioSubscribeStateChanged:info:state:reason:{@link #ByteRTCRoomDelegate#rtcRoom:onAudioSubscribeStateChanged:info:state:reason}, rtcRoom:onScreenVideoSubscribeStateChanged:userId:state:reason:{@link #ByteRTCGameRoomDelegate#rtcRoom:onScreenVideoSubscribeStateChanged:userId:state:reason}, and/or rtcRoom:onScreenAudioSubscribeStateChanged:userId:state:reason:{@link #ByteRTCGameRoomDelegate#rtcRoom:onScreenAudioSubscribeStateChanged:userId:state:reason} with error code "-1003" indicating no permission to subscribe to streams.

Implementation

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