AddonSession

@PublicApi
public interface AddonSession



附加会话。

包含所有插件会话通用的方法。如需使用“一起看”和“一起做”功能,请分别调用 getCoWatchinggetCoDoing

摘要

嵌套类型

AddonSession 的构建器。

插件客户端结束插件会话的原因。

公共方法

abstract ListenableFuture<Void>

结束插件会话并断开与 Meet 应用的连接。

abstract ListenableFuture<Void>

结束插件会话并断开与 Meet 应用的连接,并将原因通知 Meet。

abstract void

退出暂停状态。

abstract CoDoingClient

返回 CoDoingClient 实例。

abstract CoWatchingClient

返回 CoWatchingClient 实例。

abstract AddonMeetingInfo

返回已连接的会议的相关信息,例如会议网址。

abstract boolean

如果会话已结束,则返回 true

abstract boolean

指示会话是否已暂停。

abstract void

重置插件的起始状态。

abstract void

暂停插件会话。

abstract void

更新插件的起始状态。

abstract void
updateParticipantMetadata(byte[] metadata)

更新此参与者的元数据。

公共方法

endSession

abstract ListenableFuture<VoidendSession()

结束插件会话并断开与 Meet 应用的连接。此操作不会强制 Meet 结束会议,也不会导致用户退出会议。

如果会话已结束,则为空操作;不会抛出异常。

返回
ListenableFuture<Void>

如果发生意外错误,则为 ListenableFuture,评估为成功,则为 AddonException

endSession

abstract ListenableFuture<VoidendSession(AddonSession.EndReason endReason)

结束插件会话并断开与 Meet 应用的连接,并将原因通知 Meet。此操作不会强制 Meet 结束会议,也不会导致用户退出会议。

Meet 可能会根据原因采取与插件客户端商定的相应操作。

如果会话已结束,则为空操作;不会抛出异常。

仅对有权结束会话并说明原因的插件客户端显示。

此方法将返回与 endSession if the EndReason is UNKNOWN or not valid. 相同的结果

Parameters
AddonSession.EndReason endReason

The reason for the add-onclient to end the add-on session.

Returns
ListenableFuture<Void>

a ListenableFuture which evaluates to success or an AddonException

endSuspension

abstract void endSuspension()

Exits the state of suspended. The add-on app is once again able to send and receive updates.

If the this is not in a state of suspended, this is a no-op.

Throws
java.lang.IllegalStateException

if the session has ended. This could either be an explicit call to endSession or it could be due to an external reason which would be surfaced via onSessionEnded.

getCoDoing

abstract CoDoingClient getCoDoing()

Returns the CoDoingClient instance.

Throws
java.lang.IllegalStateException

if the session was built without calling withCoDoing or if the session has ended

getCoWatching

abstract CoWatchingClient getCoWatching()

Returns the CoWatchingClient instance.

Throws
java.lang.IllegalStateException

if the session was built without calling withCoWatching or if the session has ended

getMeetingInfo

abstract AddonMeetingInfo getMeetingInfo()

Returns information about the connected meeting, such as the meeting URL.

Throws
java.lang.IllegalStateException

if the session has ended. This could either be an explicit call to endSession or it could be due to an external reason which would be surfaced via onSessionEnded.

isSessionEnded

abstract boolean isSessionEnded()

Returns true if the session has ended. This could either be from an explicit call to endSession or it could be due to an external reason which would be surfaced via onSessionEnded.

Throws
java.lang.IllegalStateException

if the session has ended. This could either be an explicit call to endSession or it could be due to an external reason which would be surfaced via onSessionEnded

isSuspended

abstract boolean isSuspended()

Indicates whether the session is suspended. See suspend and endSuspension.

Throws
java.lang.IllegalStateException

if the session has ended. This could either be an explicit call to endSession or it could be due to an external reason which would be surfaced via onSessionEnded.

resetCollaborationStartingState

abstract void resetCollaborationStartingState()

Resets the starting state of the add-on. This will clear the starting state previously received by other participants. The starting state can only be reset by the initiator.

suspend

abstract void suspend()

Suspends the add-on session. This does NOT disconnect from the Meet app. This causes the SDK to avoid sending updates to your CoDoingHandler and CoWatchingHandler, and causes the SDK to ignore calls to notify calls and to ignore calls to update the global state.

If the session is already suspended, this is a no-op.

For example, you may choose to call suspend when a user, but not every user, has playback interrupted to view an ad, when a user backgrounds the application, etc.

Throws
java.lang.IllegalStateException

if the session has ended. This could either be an explicit call to endSession or it could be due to an external reason which would be surfaced via onSessionEnded.

updateCollaborationStartingState

abstract void updateCollaborationStartingState(
    CollaborationStartingState startingState
)

Updates the starting state of the add-on. This is received by other participants when they accept the invitation to collaborate. The starting state can only be updated by the initiator.

Parameters
CollaborationStartingState startingState

the starting state of add-on

updateParticipantMetadata

abstract void updateParticipantMetadata(byte[] metadata)

Updates the metadata for this participant.

To receive metadata from other participants, a handler must be registered by calling withParticipantMetadata while building the AddonSession.

The encoded metadata is capped at MAX_INDIVIDUAL_PARTICIPANT_METADATA_SIZE_BYTES bytes per participant.

Parameters
byte[] metadata

an encoded blob of metadata that describes relevant metadata for the local participant

Throws
java.lang.IllegalArgumentException

if the provided metadata exceeds MAX_INDIVIDUAL_PARTICIPANT_METADATA_SIZE_BYTES bytes

java.lang.IllegalStateException

if the session has ended. This could either be an explicit call to endSession or it could be due to an external reason which would be surfaced via onSessionEnded.