AddonSession.Builder

@PublicApi
public interface AddonSession.Builder



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

摘要

公用方法

abstract ListenableFuture<AddonSession>
begin(Context appContext)

啟動外掛程式工作階段。

abstract AddonSession.Builder

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

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

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

abstract AddonSession.Builder

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

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

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

abstract AddonSession.Builder

設定工作階段的 CollaborationStartingState

abstract AddonSession.Builder

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

abstract AddonSession.Builder

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

公用方法

begin

abstract ListenableFuture<AddonSessionbegin(Context appContext)

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

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

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

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

參數
Context appContext

使用 SDK 的應用程式 getApplicationContext

傳回
ListenableFuture<AddonSession>

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

withCoDoing

@CanIgnoreReturnValue
abstract AddonSession.Builder withCoDoing(CoDoingHandler coDoingHandler)

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

參數
CoDoingHandler coDoingHandler

共同活動回呼

傳回
AddonSession.Builder

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

擲回
java.lang.NullPointerException

如果 coDoingHandler 為空值

withCoDoing

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

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

參數
CoDoingHandler coDoingHandler

共同活動回呼

Optional<CoDoingState> initiatorInitialState

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

傳回
AddonSession.Builder

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

擲回
java.lang.NullPointerException

如果 coDoingHandlerinitiatorInitialState 為空值

withCoWatching

@CanIgnoreReturnValue
abstract AddonSession.Builder withCoWatching(CoWatchingHandler coWatchingHandler)

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

參數
CoWatchingHandler coWatchingHandler

共同觀看的回呼

傳回
AddonSession.Builder

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

擲回
java.lang.NullPointerException

如果 coWatchingHandler 為空值

withCoWatching

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

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

參數
CoWatchingHandler coWatchingHandler

共同觀看的回呼

Optional<CoWatchingState> initiatorInitialState

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

傳回
AddonSession.Builder

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

擲回
java.lang.NullPointerException

如果 coWatchingHandlerinitiatorInitialState 為空值

withCollaborationStartingState

@CanIgnoreReturnValue
abstract AddonSession.Builder withCollaborationStartingState(
    CollaborationStartingState collaborationStartingState
)

設定工作階段的 CollaborationStartingState

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

參數
CollaborationStartingState collaborationStartingState

CollaborationStartingState 數據流量

擲回
java.lang.NullPointerException

如果 collaborationStartingState 為空值

withParticipantMetadata

@CanIgnoreReturnValue
abstract AddonSession.Builder withParticipantMetadata(ParticipantMetadataHandler handler)

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

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

參數
ParticipantMetadataHandler handler

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

擲回
java.lang.NullPointerException

如果 handler 為空值

withParticipantMetadata

@CanIgnoreReturnValue
abstract AddonSession.Builder withParticipantMetadata(
    ParticipantMetadataHandler handler,
    byte[] metadata
)

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

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

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

參數
ParticipantMetadataHandler handler

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

byte[] metadata

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

擲回
java.lang.IllegalArgumentException

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

java.lang.NullPointerException

如果 handler 為空值