1- /** 0.9 .0 */
1+ /** 1.0 .0 */
22
33export as namespace SendBirdCall ;
44
@@ -9,15 +9,19 @@ export function connectWebSocket(): Promise<void>;
99export function addListener ( id : string , listener : SendBirdCallListener ) : void ;
1010export function removeListener ( id : string ) : void ;
1111export function removeAllListeners ( ) : void ;
12- export function dial ( userId : string , isVideoCall : boolean , callOption : DirectCallOption , callback ?: DialHandler ) : DirectCall ;
1312export function dial ( params : DialParams , callback ?: DialHandler ) : DirectCall ;
1413export function createDirectCallLogListQuery ( params ?: DirectCallLogListQueryParams ) : DirectCallLogListQuery ;
1514export function getCurrentAudioInputDevice ( ) : MediaDeviceInfo ;
16- export function getAvailableAudioInputDevices ( ) : Promise < MediaDeviceInfo [ ] > ;
17- export function selectAudioInputDevice ( mediaDeviceInfo : MediaDeviceInfo ) : Promise < void > ;
15+ export function getAvailableAudioInputDevices ( ) : MediaDeviceInfo [ ] ;
16+ export function selectAudioInputDevice ( mediaDeviceInfo : MediaDeviceInfo ) : void ;
1817export function getCurrentAudioOutputDevice ( ) : MediaDeviceInfo ;
19- export function getAvailableAudioOutputDevices ( ) : Promise < MediaDeviceInfo [ ] > ;
20- export function selectAudioOutputDevice ( mediaDeviceInfo : MediaDeviceInfo ) : Promise < void > ;
18+ export function getAvailableAudioOutputDevices ( ) : MediaDeviceInfo [ ] ;
19+ export function selectAudioOutputDevice ( mediaDeviceInfo : MediaDeviceInfo ) : void ;
20+ export function getCurrentVideoInputDevice ( ) : MediaDeviceInfo ;
21+ export function getAvailableVideoInputDevices ( ) : MediaDeviceInfo [ ] ;
22+ export function selectVideoInputDevice ( mediaDeviceInfo : MediaDeviceInfo ) : void ;
23+ export function updateMediaDevices ( constraints : { audio : boolean ; video : boolean } ) : void ;
24+ export function useMedia ( constraints : { audio : boolean ; video : boolean } ) : MediaAccess ;
2125export function updateCustomItems ( callId : string , customItems : CustomItems , callback ?: CustomItemsHandler ) : Promise < CustomItemsResult > ;
2226export function deleteCustomItems ( callId : string , customItemKeys : string [ ] , callback ?: CustomItemsHandler ) : Promise < CustomItemsResult > ;
2327export function deleteAllCustomItems ( callId : string , callback ?: CustomItemsHandler ) : Promise < CustomItemsResult > ;
@@ -56,15 +60,16 @@ export enum DirectCallEndResult {
5660 COMPLETED = 'completed' ,
5761 CONNECTION_LOST = 'connection_lost' ,
5862 TIMED_OUT = 'timed_out' ,
59- FAILED_TO_DIAL = 'failed_to_dial ' ,
60- FAILED_TO_ACCEPT = 'failed_to_accept ' ,
63+ DIAL_FAILED = 'dial_failed ' ,
64+ ACCEPT_FAILED = 'accept_failed ' ,
6165 UNKNOWN = 'unknown'
6266}
6367
6468export interface SendBirdCallListener {
6569 onRinging : ( ( directCall : DirectCall ) => void ) | null ;
6670 onAudioInputDeviceChanged : ( ( currentAudioInputDevice : MediaDeviceInfo , availableAudioInputDevices : MediaDeviceInfo [ ] ) => void ) | null ;
6771 onAudioOutputDeviceChanged : ( ( currentAudioOutputDevice : MediaDeviceInfo , availableAudioOutputDevices : MediaDeviceInfo [ ] ) => void ) | null ;
72+ onVideoInputDeviceChanged : ( ( currentVideoInputDevice : MediaDeviceInfo , availableVideoInputDevices : MediaDeviceInfo [ ] ) => void ) | null ;
6873}
6974
7075export interface DirectCall {
@@ -73,8 +78,6 @@ export interface DirectCall {
7378 onReconnected : ( ( call : DirectCall ) => void ) | null ;
7479 onReconnecting : ( ( call : DirectCall ) => void ) | null ;
7580
76- //deprecated
77- onRemoteAudioEnabled : ( ( call : DirectCall ) => void ) | null ;
7881 onRemoteAudioSettingsChanged : ( ( call : DirectCall ) => void ) | null ;
7982 onRemoteVideoSettingsChanged : ( ( call : DirectCall ) => void ) | null ;
8083 onCustomItemsUpdated : ( ( call : DirectCall , updatedKeys : string [ ] ) => void ) | null ;
@@ -106,16 +109,9 @@ export interface DirectCall {
106109 startVideo ( ) : void ;
107110
108111 getDuration ( ) : number ;
109- accept ( callOption : DirectCallOption ) : void ;
110112 accept ( params : AcceptParams ) : void ;
111113 end ( ) : void ;
112114
113- //deprecated
114- mute ( ) : void ;
115-
116- //deprecated
117- unmute ( ) : void ;
118-
119115 muteMicrophone ( ) : void ;
120116 unmuteMicrophone ( ) : void ;
121117
@@ -127,8 +123,6 @@ export interface DirectCall {
127123export interface DirectCallOption {
128124 localMediaView ?: HTMLMediaElement ;
129125 remoteMediaView ?: HTMLMediaElement ;
130- localVideoView ?: HTMLMediaElement ;
131- remoteVideoView ?: HTMLMediaElement ;
132126 audioEnabled ?: boolean ;
133127 videoEnabled ?: boolean ;
134128}
@@ -197,3 +191,7 @@ export interface DirectCallLogListQueryParams {
197191export interface CustomItems {
198192 [ key : string ] : string ;
199193}
194+
195+ export interface MediaAccess {
196+ dispose ( ) : void ;
197+ }
0 commit comments