AddonSessionHandler

@PublicApi
interface AddonSessionHandler


外掛程式應用程式針對工作階段提供的回呼。

摘要

巢狀類型

說明觸發 onSessionEnded 回呼的原因。

說明在外掛程式工作階段中,參與者分配或撤銷的權限。

公用函式

Unit
onCollaborationStartingStateUpdate(
    collaborationStartingState: CollaborationStartingState!
)

接收外掛程式工作階段的協作開始狀態。

Unit

接收最新的權限狀態,以便定義使用者如何參與外掛程式工作階段。

Unit

回應外掛程式工作階段的結束時間。

公用函式

onCollaborationStartingStateUpdate

fun onCollaborationStartingStateUpdate(
    collaborationStartingState: CollaborationStartingState!
): Unit

接收外掛程式工作階段的協作開始狀態。

外掛程式需要具體實作,才能支援協作啟動狀態。

onParticipantPrivilegeChanged

fun onParticipantPrivilegeChanged(
    privileges: (Mutable)List<AddonSessionHandler.Privilege!>!,
    disabledPrivileges: (Mutable)List<AddonSessionHandler.Privilege!>!
): Unit

接收最新的權限狀態,以便定義使用者如何參與外掛程式工作階段。

外掛程式需要具體實作,才能支援主機控制項。

onSessionEnded

fun onSessionEnded(endReason: AddonSessionHandler.EndReason!): Unit

回應外掛程式工作階段的結束時間。

  1. 除非使用這個處理常式例項建構新的 AddonSession,否則這個處理常式不會收到其他呼叫。
  2. SDK 會自行清除。不需要額外呼叫 endSession

導入範例:

if (EndReason.SESSION_ENDED_UNEXPECTEDLY.equals(endReason)) {
  log("Something happened unexpectedly");
  // Display UI to user in case they want to reconnect.
  return;
}

if (EndReason.MEETING_ENDED_BY_USER.equals(endReason)) {
  // The meeting is disconnected because the user left the meeting. Perform some
  // cleanup, then exit.
  this.onMeetingDisconnected();
  return;
}

if (EndReason.SESSION_ENDED_BY_USER.equals(endReason)) {
  // Disconnected because the user left the session from the Meet application. However, the
  // conference is still active in Meet. Perform some cleanup, then listen for a possible
  // rejoin event.
  this.onSessionDisconnected();
  return;
}
參數
endReason: AddonSessionHandler.EndReason!

工作階段結束的原因