AddonSession.Builder

@PublicApi
interface AddonSession.Builder


AddonSession 的建構工具。查看《newSessionBuilder》。

摘要

公用函式

ListenableFuture<AddonSession!>!
begin(appContext: Context!)

啟動外掛程式工作階段。

AddonSession.Builder!

為初始狀態的外掛程式工作階段新增共同待辦事項功能。

AddonSession.Builder!
@CanIgnoreReturnValue
withCoDoing(
    coDoingHandler: CoDoingHandler!,
    initiatorInitialState: Optional<CoDoingState!>!
)

在外掛程式工作階段新增共同待辦事項。

AddonSession.Builder!

將在外掛程式工作階段加入共同觀看功能。

AddonSession.Builder!
@CanIgnoreReturnValue
withCoWatching(
    coWatchingHandler: CoWatchingHandler!,
    initiatorInitialState: Optional<CoWatchingState!>!
)

在初始狀態的外掛程式工作階段中新增共同觀看功能。

AddonSession.Builder!

設定工作階段的 CollaborationStartingState

AddonSession.Builder!

註冊監聽器以取得其他參與者中繼資料的更新內容。

AddonSession.Builder!

設定這位參與者的中繼資料,並註冊監聽器,以取得其他參與者的更新內容。

公用函式

begin

fun begin(appContext: Context!): ListenableFuture<AddonSession!>!

啟動外掛程式工作階段。只有在使用者確認想參與外掛程式工作階段後,才能呼叫此方法。

連線至會議,無論是建立會議或連線至進行中的會議。注意:

  • 如果建立會議,目前使用者一開始只會有參與者。
  • 你可以在傳回的工作階段透過 getMeetingInfo 存取會議詳細資料。
  • 傳回的網址會向使用者顯示,並手動與指定的外掛程式工作階段群組分享。
共同觀看和共同活動執行個體可以分別透過 getCoWatchinggetCoDoing 存取。

我們不建議在這個情況下呼叫 cancel,而是允許其執行完畢。

參數
appContext: Context!

使用 SDK 的應用程式 getApplicationContext

傳回
ListenableFuture<AddonSession!>!

在成功啟動外掛程式工作階段的情況下,這個 ListenableFuture 可評估為適當類型的 AddonSession 執行個體。否則,如果另一個 AddonSession 仍在執行 (例如未呼叫 endSession),就會評估為 IllegalStateException;如果發生未預期的錯誤,則會評估為 AddonException

withCoDoing

@CanIgnoreReturnValue
fun withCoDoing(coDoingHandler: CoDoingHandler!): AddonSession.Builder!

為初始狀態的外掛程式工作階段新增共同待辦事項功能。

參數
coDoingHandler: CoDoingHandler!

共同活動回呼

傳回
AddonSession.Builder!

另一個用於鏈結的建構工具執行個體

擲回
java.lang.NullPointerException

如果 coDoingHandler 為空值

withCoDoing

@CanIgnoreReturnValue
fun withCoDoing(
    coDoingHandler: CoDoingHandler!,
    initiatorInitialState: Optional<CoDoingState!>!
): AddonSession.Builder!

在外掛程式工作階段新增共同待辦事項。

參數
coDoingHandler: CoDoingHandler!

共同活動回呼

initiatorInitialState: Optional<CoDoingState!>!

啟動者的初始狀態如果使用者加入現有的工作階段,系統會忽略這項設定

傳回
AddonSession.Builder!

另一個用於鏈結的建構工具執行個體

擲回
java.lang.NullPointerException

如果 coDoingHandlerinitiatorInitialState 為空值

withCoWatching

@CanIgnoreReturnValue
fun withCoWatching(coWatchingHandler: CoWatchingHandler!): AddonSession.Builder!

將在外掛程式工作階段加入共同觀看功能。

參數
coWatchingHandler: CoWatchingHandler!

共同觀看的回呼

傳回
AddonSession.Builder!

另一個用於鏈結的建構工具執行個體

擲回
java.lang.NullPointerException

如果 coWatchingHandler 為空值

withCoWatching

@CanIgnoreReturnValue
fun withCoWatching(
    coWatchingHandler: CoWatchingHandler!,
    initiatorInitialState: Optional<CoWatchingState!>!
): AddonSession.Builder!

在初始狀態的外掛程式工作階段中新增共同觀看功能。

參數
coWatchingHandler: CoWatchingHandler!

共同觀看的回呼

initiatorInitialState: Optional<CoWatchingState!>!

啟動者的初始狀態如果使用者加入現有的工作階段,系統會忽略這項設定

傳回
AddonSession.Builder!

另一個用於鏈結的建構工具執行個體

擲回
java.lang.NullPointerException

如果 coWatchingHandlerinitiatorInitialState 為空值

withCollaborationStartingState

@CanIgnoreReturnValue
fun withCollaborationStartingState(
    collaborationStartingState: CollaborationStartingState!
): AddonSession.Builder!

設定工作階段的 CollaborationStartingState

您之後可以呼叫 updateCollaborationStartingStateresetCollaborationStartingState 變更這項設定。

參數
collaborationStartingState: CollaborationStartingState!

CollaborationStartingState 數據流量

擲回
java.lang.NullPointerException

如果 collaborationStartingState 為空值

withParticipantMetadata

@CanIgnoreReturnValue
fun withParticipantMetadata(handler: ParticipantMetadataHandler!): AddonSession.Builder!

註冊監聽器以取得其他參與者中繼資料的更新內容。

本機參與者的中繼資料一開始會設為空白值,但之後可以呼叫 updateParticipantMetadata 進行設定。如要設定初始值,請改為呼叫 withParticipantMetadata

參數
handler: ParticipantMetadataHandler!

會在每次更新時接收最新一組參與者中繼資料的 ParticipantMetadataHandler

擲回
java.lang.NullPointerException

如果 handler 為空值

withParticipantMetadata

@CanIgnoreReturnValue
fun withParticipantMetadata(
    handler: ParticipantMetadataHandler!,
    metadata: ByteArray!
): AddonSession.Builder!

設定這位參與者的中繼資料,並註冊監聽器,以取得其他參與者的更新內容。

您之後可以呼叫 updateParticipantMetadata 變更這個中繼資料。

每位參與者的編碼中繼資料上限為 MAX_INDIVIDUAL_PARTICIPANT_METADATA_SIZE_BYTES 位元組。

參數
handler: ParticipantMetadataHandler!

會在每次更新時接收最新一組參與者中繼資料的 ParticipantMetadataHandler

metadata: ByteArray!

已編碼的中繼資料 blob,用來描述當地參與者的相關中繼資料

擲回
java.lang.IllegalArgumentException

如果提供的中繼資料超過 MAX_INDIVIDUAL_PARTICIPANT_METADATA_SIZE_BYTES 個位元組

java.lang.NullPointerException

如果 handler 為空值