import { Event } from '@skyway-sdk/common'; import { Codec, ContentType, EncodingParameters, LocalAudioStream, LocalCustomVideoStream, LocalStream, LocalVideoStream, Publication, PublicationState, ReplaceStreamOptions, TransportConnectionState, WebRTCStats } from '../imports/core'; import { RTCPeerConnection } from '../imports/mediasoup'; import { RoomMember, RoomMemberImpl } from '../member'; import { Encoding } from '@skyway-sdk/model'; import { RoomImpl } from '../room/base'; import { StreamSubscribedEvent, StreamUnsubscribedEvent } from '../room/event'; import { RoomSubscription } from '../subscription'; export interface RoomPublication { readonly id: string; readonly contentType: ContentType; metadata?: string; readonly publisher: RoomMember; /** * @description [japanese] このPublicationをSubscribeしているSubscriptionの一覧 */ subscriptions: RoomSubscription[]; readonly codecCapabilities: Codec[]; /** * @description [japanese] Encode設定 */ encodings: EncodingParameters[]; /** * @description [japanese] Publicationの状態 * - enabled : 配信中 * - disabled : 配信停止中 * - canceled : 配信終了 */ state: RoomPublicationState; /** * @description [japanese] publishしたstreamの実体。 * ローカルで作られたPublicationでなければundefinedとなる */ readonly stream?: T; /** * @deprecated * @use {@link LocalPerson.onStreamUnpublished} or {@link Channel.onStreamUnpublished} * @description [japanese] このPublicationがUnPublishされたときに発火するイベント */ readonly onCanceled: Event; /**@description [japanese] このPublicationがSubscribeされたときに発火するイベント */ readonly onSubscribed: Event; /**@description [japanese] このPublicationがUnsubscribeされたときに発火するイベント */ readonly onUnsubscribed: Event; /**@description [japanese] このPublicationをSubscribeするSubscriptionの数が変わったときに発火するイベント */ readonly onSubscriptionListChanged: Event; /**@description [japanese] このPublicationのMetadataが変更された時に発火するイベント */ readonly onMetadataUpdated: Event<{ metadata: string; }>; /**@description [japanese] このPublicationが有効化されたときに発火するイベント */ readonly onEnabled: Event; /**@description [japanese] このPublicationが無効化されたときに発火するイベント */ readonly onDisabled: Event; /**@description [japanese] このPublicationの有効化状態が変化したときに発火するイベント */ readonly onStateChanged: Event; /** * @description [japanese] メディア通信の状態が変化した時に発火するイベント * SFURoomの場合、remoteMemberはundefinedになる * SFURoomの場合、memberがルームを離れたときのみ発火する */ readonly onConnectionStateChanged: Event<{ remoteMember?: RoomMember; state: TransportConnectionState; }>; /** * @description [japanese] Metadataの更新 */ updateMetadata: (metadata: string) => Promise; /** * @deprecated * @use {@link LocalPerson.unpublish} * @description [japanese] unpublishする */ cancel: () => Promise; /** * @description [japanese] Video|Audio Streamの場合、encoding設定を更新する */ updateEncodings: (encodings: EncodingParameters[]) => void; /**@description [japanese] publicationを有効化する */ enable: () => Promise; /**@description [japanese] publicationを無効化する */ disable: () => Promise; /** * @description [japanese] Publicationのstreamを同じContentTypeの別のStreamに入れ替える。 * dataStreamを入れ替えることはできない。 * RemoteのPublication(streamがnull)では利用不可。 */ replaceStream: (stream: LocalAudioStream | LocalVideoStream | LocalCustomVideoStream, options?: ReplaceStreamOptions) => void; /** * @experimental * @description [japanese] 試験的なAPIです。今後インターフェースや仕様が変更される可能性があります * @description [japanese] StreamをSubscribeしているMemberとの通信の統計情報を取得する */ getStats(selector: RoomMember | string): Promise; /** * @experimental * @description [japanese] 試験的なAPIです。今後インターフェースや仕様が変更される可能性があります * @description [japanese] 対象のMemberとのRTCPeerConnectionを取得する。RTCPeerConnectionを直接操作すると SDK は正しく動作しなくなる可能性があります。 */ getRTCPeerConnection(selector: RoomMember | string): RTCPeerConnection | undefined; /** * @description [japanese] メディア通信の状態を取得する * @param selector [japanese] 接続相手 */ getConnectionState(selector: RoomMember | string): TransportConnectionState; } /**@internal */ export declare class RoomPublicationImpl implements RoomPublication { _publication: Publication; private _room; readonly id: string; readonly contentType: ContentType; readonly publisher: RoomMemberImpl; private readonly _origin?; private readonly _disposer; private readonly _events; readonly onCanceled: Event; readonly onSubscribed: Event; readonly onUnsubscribed: Event; readonly onSubscriptionListChanged: Event; readonly onMetadataUpdated: Event<{ metadata: string; }>; readonly onEnabled: Event; readonly onDisabled: Event; readonly onStateChanged: Event; readonly onConnectionStateChanged: Event<{ remoteMember?: RoomMember; state: TransportConnectionState; }>; constructor(_publication: Publication, _room: RoomImpl); private _setEvents; get subscriptions(): import("../subscription").RoomSubscriptionImpl[]; private get _preferredPublication(); get codecCapabilities(): Codec[]; get encodings(): Encoding[]; get stream(): StreamType; get state(): PublicationState; get metadata(): string; /** * @deprecated * @use {@link LocalPerson.unpublish} * @description [japanese] unpublishする */ cancel(): Promise; updateMetadata(metadata: string): Promise; updateEncodings(encodings: EncodingParameters[]): void; readonly enable: () => Promise; readonly disable: () => Promise; readonly replaceStream: (stream: LocalAudioStream | LocalVideoStream | LocalCustomVideoStream, options?: ReplaceStreamOptions) => void; private _dispose; getStats(selector: string | RoomMember): Promise; getRTCPeerConnection(selector: string | RoomMember): RTCPeerConnection | undefined; getConnectionState(selector: string | RoomMember): TransportConnectionState; toJSON(): { id: string; contentType: ContentType; metadata: string; publisher: RoomMemberImpl; subscriptions: import("../subscription").RoomSubscriptionImpl[]; codecCapabilities: Codec[]; encodings: Encoding[]; state: PublicationState; }; } /** * @description [japanese] Publicationの状態 * - enabled : 配信中 * - disabled : 配信停止中 * - canceled : 配信終了 * */ export declare type RoomPublicationState = PublicationState; //# sourceMappingURL=index.d.ts.map