@flashphoner/websdk 2.0.212 → 2.0.217
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docTemplate/README.md +1 -1
- package/examples/demo/streaming/conference/conference.html +4 -0
- package/examples/demo/streaming/conference/conference.js +203 -62
- package/examples/demo/streaming/video-chat/video-chat.html +5 -0
- package/flashphoner-no-flash.js +1128 -818
- package/flashphoner-no-flash.min.js +2 -2
- package/flashphoner-no-webrtc.js +1122 -812
- package/flashphoner-no-webrtc.min.js +2 -2
- package/flashphoner-no-wsplayer.js +1128 -818
- package/flashphoner-no-wsplayer.min.js +2 -2
- package/flashphoner-room-api.js +1112 -908
- package/flashphoner-room-api.min.js +2 -2
- package/flashphoner-temasys-flash-websocket-without-adapterjs.js +1129 -814
- package/flashphoner-temasys-flash-websocket.js +1127 -812
- package/flashphoner-temasys-flash-websocket.min.js +1 -1
- package/flashphoner-webrtc-only.js +1122 -817
- package/flashphoner-webrtc-only.min.js +1 -1
- package/flashphoner.js +1134 -819
- package/flashphoner.min.js +2 -2
- package/package.json +1 -1
- package/src/constants.d.ts +792 -1
- package/src/constants.js +790 -704
- package/src/flash-media-provider.js +5 -0
- package/src/flashphoner-core.d.ts +359 -209
- package/src/flashphoner-core.js +98 -29
- package/src/room-module.d.ts +2 -2
- package/src/room-module.js +9 -2
- package/src/temasys-media-provider.js +5 -0
- package/src/util.js +207 -185
- package/src/webrtc-media-provider.js +12 -7
- package/src/websocket-media-provider.js +5 -0
|
@@ -10851,717 +10851,926 @@ exports['WSPlayer'] = WSPlayer;
|
|
|
10851
10851
|
* @see Session
|
|
10852
10852
|
*/
|
|
10853
10853
|
|
|
10854
|
-
var
|
|
10855
|
-
/**
|
|
10856
|
-
|
|
10857
|
-
|
|
10858
|
-
|
|
10859
|
-
|
|
10854
|
+
var SESSION_STATUS = Object.freeze({
|
|
10855
|
+
/**
|
|
10856
|
+
* Fires when {@link Session} ws socket opens.
|
|
10857
|
+
* @event CONNECTED
|
|
10858
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
10859
|
+
*/
|
|
10860
|
+
CONNECTED: 'CONNECTED',
|
|
10860
10861
|
|
|
10861
|
-
|
|
10862
|
-
|
|
10863
|
-
|
|
10864
|
-
|
|
10865
|
-
|
|
10866
|
-
|
|
10862
|
+
/**
|
|
10863
|
+
* Fires when {@link Session} receives connect ack from REST App.
|
|
10864
|
+
* @event ESTABLISHED
|
|
10865
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
10866
|
+
*/
|
|
10867
|
+
ESTABLISHED: 'ESTABLISHED',
|
|
10867
10868
|
|
|
10868
|
-
|
|
10869
|
-
|
|
10870
|
-
|
|
10871
|
-
|
|
10872
|
-
|
|
10873
|
-
|
|
10869
|
+
/**
|
|
10870
|
+
* Fires when {@link Session} disconnects.
|
|
10871
|
+
* @event DISCONNECTED
|
|
10872
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
10873
|
+
*/
|
|
10874
|
+
DISCONNECTED: 'DISCONNECTED',
|
|
10874
10875
|
|
|
10875
|
-
|
|
10876
|
-
|
|
10877
|
-
|
|
10878
|
-
|
|
10879
|
-
|
|
10880
|
-
|
|
10876
|
+
/**
|
|
10877
|
+
* Fires if {@link Session} call of rest method error.
|
|
10878
|
+
* @event WARN
|
|
10879
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
10880
|
+
*/
|
|
10881
|
+
WARN: 'WARN',
|
|
10881
10882
|
|
|
10882
|
-
|
|
10883
|
-
|
|
10884
|
-
|
|
10885
|
-
|
|
10886
|
-
|
|
10887
|
-
|
|
10888
|
-
|
|
10883
|
+
/**
|
|
10884
|
+
* Fires if {@link Session} connection failed.
|
|
10885
|
+
* Some of the reasons can be network connection failed, REST App failed
|
|
10886
|
+
* @event FAILED
|
|
10887
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
10888
|
+
*/
|
|
10889
|
+
FAILED: 'FAILED',
|
|
10889
10890
|
|
|
10890
|
-
|
|
10891
|
-
|
|
10892
|
-
|
|
10893
|
-
|
|
10894
|
-
|
|
10895
|
-
|
|
10891
|
+
/**
|
|
10892
|
+
* Fires wneh {@link Session} receives debug event
|
|
10893
|
+
* @event DEBUG
|
|
10894
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
10895
|
+
*/
|
|
10896
|
+
DEBUG: 'DEBUG',
|
|
10896
10897
|
|
|
10897
|
-
|
|
10898
|
-
|
|
10899
|
-
|
|
10900
|
-
|
|
10901
|
-
|
|
10902
|
-
|
|
10903
|
-
|
|
10898
|
+
/**
|
|
10899
|
+
* Fires when {@link Session} receives custom REST App message.
|
|
10900
|
+
*
|
|
10901
|
+
* @event APP_DATA
|
|
10902
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
10903
|
+
*/
|
|
10904
|
+
APP_DATA: 'APP_DATA',
|
|
10904
10905
|
|
|
10905
|
-
|
|
10906
|
-
|
|
10907
|
-
|
|
10908
|
-
|
|
10909
|
-
|
|
10910
|
-
|
|
10911
|
-
|
|
10906
|
+
/**
|
|
10907
|
+
* Fires when {@link Session} receives status of sendData operation.
|
|
10908
|
+
*
|
|
10909
|
+
* @event SEND_DATA_STATUS
|
|
10910
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
10911
|
+
*/
|
|
10912
|
+
SEND_DATA_STATUS: 'SEND_DATA_STATUS',
|
|
10912
10913
|
|
|
10913
|
-
|
|
10914
|
+
/**
|
|
10915
|
+
* State of newly created {@link Session}.
|
|
10916
|
+
*
|
|
10917
|
+
* @event PENDING
|
|
10918
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
10919
|
+
*/
|
|
10920
|
+
PENDING: 'PENDING',
|
|
10914
10921
|
|
|
10915
|
-
|
|
10916
|
-
|
|
10917
|
-
|
|
10918
|
-
|
|
10919
|
-
|
|
10920
|
-
|
|
10921
|
-
|
|
10922
|
+
/**
|
|
10923
|
+
* Fires when {@link Session} registers as sip client.
|
|
10924
|
+
*
|
|
10925
|
+
* @event REGISTERED
|
|
10926
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
10927
|
+
*/
|
|
10928
|
+
REGISTERED: 'REGISTERED',
|
|
10922
10929
|
|
|
10923
|
-
|
|
10924
|
-
|
|
10925
|
-
|
|
10926
|
-
|
|
10927
|
-
|
|
10928
|
-
|
|
10929
|
-
|
|
10930
|
+
/**
|
|
10931
|
+
* Fires when {@link Session} unregisters as sip client.
|
|
10932
|
+
*
|
|
10933
|
+
* @event UNREGISTERED
|
|
10934
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
10935
|
+
*/
|
|
10936
|
+
UNREGISTERED: 'UNREGISTERED',
|
|
10930
10937
|
|
|
10931
|
-
|
|
10932
|
-
|
|
10938
|
+
/**
|
|
10939
|
+
* Fires when {@link Session} receives an incoming call.
|
|
10940
|
+
*
|
|
10941
|
+
* @event INCOMING_CALL
|
|
10942
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
10943
|
+
*/
|
|
10944
|
+
INCOMING_CALL: 'INCOMING_CALL'
|
|
10945
|
+
});
|
|
10933
10946
|
/**
|
|
10934
10947
|
* @namespace Flashphoner.constants.STREAM_STATUS
|
|
10935
10948
|
* @see Stream
|
|
10936
10949
|
*/
|
|
10937
10950
|
|
|
10938
|
-
var
|
|
10939
|
-
|
|
10940
|
-
|
|
10951
|
+
var STREAM_STATUS = Object.freeze({
|
|
10952
|
+
/**
|
|
10953
|
+
* State of newly created {@link Stream}.
|
|
10954
|
+
*
|
|
10955
|
+
* @event NEW
|
|
10956
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
10957
|
+
*/
|
|
10958
|
+
NEW: 'NEW',
|
|
10941
10959
|
|
|
10942
|
-
|
|
10943
|
-
|
|
10944
|
-
|
|
10945
|
-
|
|
10946
|
-
|
|
10947
|
-
|
|
10960
|
+
/**
|
|
10961
|
+
* State before {@link Stream} publishing/playing.
|
|
10962
|
+
*
|
|
10963
|
+
* @event PENDING
|
|
10964
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
10965
|
+
*/
|
|
10966
|
+
PENDING: 'PENDING',
|
|
10948
10967
|
|
|
10949
|
-
|
|
10950
|
-
|
|
10951
|
-
|
|
10952
|
-
|
|
10953
|
-
|
|
10954
|
-
|
|
10968
|
+
/**
|
|
10969
|
+
* Fires when {@link Stream} starts publishing.
|
|
10970
|
+
* @event PUBLISHING
|
|
10971
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
10972
|
+
*/
|
|
10973
|
+
PUBLISHING: 'PUBLISHING',
|
|
10955
10974
|
|
|
10956
|
-
|
|
10957
|
-
|
|
10958
|
-
|
|
10959
|
-
|
|
10960
|
-
|
|
10961
|
-
|
|
10975
|
+
/**
|
|
10976
|
+
* Fires when {@link Stream} starts playing.
|
|
10977
|
+
* @event PLAYING
|
|
10978
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
10979
|
+
*/
|
|
10980
|
+
PLAYING: 'PLAYING',
|
|
10962
10981
|
|
|
10963
|
-
|
|
10964
|
-
|
|
10965
|
-
|
|
10966
|
-
|
|
10967
|
-
|
|
10968
|
-
|
|
10982
|
+
/**
|
|
10983
|
+
* Fires if {@link Stream} paused.
|
|
10984
|
+
* @event PAUSED
|
|
10985
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
10986
|
+
*/
|
|
10987
|
+
PAUSED: 'PAUSED',
|
|
10969
10988
|
|
|
10970
|
-
|
|
10971
|
-
|
|
10972
|
-
|
|
10973
|
-
|
|
10974
|
-
|
|
10975
|
-
|
|
10989
|
+
/**
|
|
10990
|
+
* Fires if {@link Stream} was unpublished.
|
|
10991
|
+
* @event UNPUBLISHED
|
|
10992
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
10993
|
+
*/
|
|
10994
|
+
UNPUBLISHED: 'UNPUBLISHED',
|
|
10976
10995
|
|
|
10977
|
-
|
|
10978
|
-
|
|
10979
|
-
|
|
10980
|
-
|
|
10981
|
-
|
|
10982
|
-
|
|
10996
|
+
/**
|
|
10997
|
+
* Fires if playing {@link Stream} was stopped.
|
|
10998
|
+
* @event STOPPED
|
|
10999
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
11000
|
+
*/
|
|
11001
|
+
STOPPED: 'STOPPED',
|
|
10983
11002
|
|
|
10984
|
-
|
|
10985
|
-
|
|
10986
|
-
|
|
10987
|
-
|
|
10988
|
-
|
|
10989
|
-
|
|
11003
|
+
/**
|
|
11004
|
+
* Fires if {@link Stream} failed.
|
|
11005
|
+
* @event FAILED
|
|
11006
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
11007
|
+
*/
|
|
11008
|
+
FAILED: 'FAILED',
|
|
10990
11009
|
|
|
10991
|
-
|
|
10992
|
-
|
|
10993
|
-
|
|
10994
|
-
|
|
10995
|
-
|
|
10996
|
-
|
|
11010
|
+
/**
|
|
11011
|
+
* Fires if {@link Stream} playback problem.
|
|
11012
|
+
* @event PLAYBACK_PROBLEM
|
|
11013
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
11014
|
+
*/
|
|
11015
|
+
PLAYBACK_PROBLEM: 'PLAYBACK_PROBLEM',
|
|
10997
11016
|
|
|
10998
|
-
|
|
10999
|
-
|
|
11000
|
-
|
|
11001
|
-
|
|
11002
|
-
|
|
11003
|
-
|
|
11004
|
-
*/
|
|
11017
|
+
/**
|
|
11018
|
+
* Fires if playing {@link Stream} picture resizing.
|
|
11019
|
+
* @event RESIZE
|
|
11020
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
11021
|
+
*/
|
|
11022
|
+
RESIZE: 'RESIZE',
|
|
11005
11023
|
|
|
11006
|
-
|
|
11007
|
-
|
|
11008
|
-
|
|
11009
|
-
|
|
11010
|
-
|
|
11011
|
-
|
|
11024
|
+
/**
|
|
11025
|
+
* Fires when {@link Stream} snapshot becomes available.
|
|
11026
|
+
* Snapshot is base64 encoded png available through {@link Stream.getInfo}
|
|
11027
|
+
* @event SNAPSHOT_COMPLETE
|
|
11028
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
11029
|
+
*/
|
|
11030
|
+
SNAPSHOT_COMPLETE: 'SNAPSHOT_COMPLETE',
|
|
11012
11031
|
|
|
11013
|
-
|
|
11032
|
+
/**
|
|
11033
|
+
* Fires on playing {@link Stream} if bitrate is higher than available network bandwidth.
|
|
11034
|
+
* @event NOT_ENOUGH_BANDWIDTH
|
|
11035
|
+
* @memberof Flashphoner.constants.NOT_ENOUGH_BANDWIDTH
|
|
11036
|
+
*/
|
|
11037
|
+
NOT_ENOUGH_BANDWIDTH: 'NOT_ENOUGH_BANDWIDTH'
|
|
11038
|
+
});
|
|
11014
11039
|
/**
|
|
11015
11040
|
* @namespace Flashphoner.constants.CALL_STATUS
|
|
11016
11041
|
* @see Call
|
|
11017
11042
|
*/
|
|
11018
11043
|
|
|
11019
|
-
var
|
|
11020
|
-
|
|
11021
|
-
|
|
11022
|
-
|
|
11023
|
-
|
|
11024
|
-
|
|
11025
|
-
|
|
11026
|
-
|
|
11027
|
-
|
|
11028
|
-
|
|
11029
|
-
|
|
11030
|
-
|
|
11031
|
-
|
|
11044
|
+
var CALL_STATUS = Object.freeze({
|
|
11045
|
+
/**
|
|
11046
|
+
* State of newly created {@link Call}
|
|
11047
|
+
* @event NEW
|
|
11048
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
11049
|
+
*/
|
|
11050
|
+
NEW: 'NEW',
|
|
11051
|
+
|
|
11052
|
+
/**
|
|
11053
|
+
* The server is ringing to the callee
|
|
11054
|
+
* @event RING
|
|
11055
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
11056
|
+
*/
|
|
11057
|
+
RING: 'RING',
|
|
11058
|
+
RING_MEDIA: 'RING_MEDIA',
|
|
11059
|
+
|
|
11060
|
+
/**
|
|
11061
|
+
* The {@link Call} was put on hold
|
|
11062
|
+
* @event HOLD
|
|
11063
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
11064
|
+
*/
|
|
11065
|
+
HOLD: 'HOLD',
|
|
11066
|
+
|
|
11067
|
+
/**
|
|
11068
|
+
* The {@link Call} is established
|
|
11069
|
+
* @event ESTABLISHED
|
|
11070
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
11071
|
+
*/
|
|
11072
|
+
ESTABLISHED: 'ESTABLISHED',
|
|
11073
|
+
|
|
11074
|
+
/**
|
|
11075
|
+
* The {@link Call} is finished
|
|
11076
|
+
* @event FINISH
|
|
11077
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
11078
|
+
*/
|
|
11079
|
+
FINISH: 'FINISH',
|
|
11080
|
+
|
|
11081
|
+
/**
|
|
11082
|
+
* Callee is busy
|
|
11083
|
+
* @event BUSY
|
|
11084
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
11085
|
+
*/
|
|
11086
|
+
BUSY: 'BUSY',
|
|
11087
|
+
|
|
11088
|
+
/**
|
|
11089
|
+
* SIP session is in progress
|
|
11090
|
+
* @event SESSION_PROGRESS
|
|
11091
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
11092
|
+
*/
|
|
11093
|
+
SESSION_PROGRESS: 'SESSION_PROGRESS',
|
|
11094
|
+
|
|
11095
|
+
/**
|
|
11096
|
+
* The {@link Call} is failed
|
|
11097
|
+
* @event FAILED
|
|
11098
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
11099
|
+
*/
|
|
11100
|
+
FAILED: 'FAILED',
|
|
11101
|
+
|
|
11102
|
+
/**
|
|
11103
|
+
* The {@link Call} state before ringing
|
|
11104
|
+
* @event PENDING
|
|
11105
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
11106
|
+
*/
|
|
11107
|
+
PENDING: 'PENDING',
|
|
11108
|
+
|
|
11109
|
+
/**
|
|
11110
|
+
* The server trying to establish {@link Call}
|
|
11111
|
+
* @event TRYING
|
|
11112
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
11113
|
+
*/
|
|
11114
|
+
TRYING: 'TRYING'
|
|
11115
|
+
});
|
|
11032
11116
|
/**
|
|
11033
11117
|
* @namespace Flashphoner.constants.STREAM_STATUS_INFO
|
|
11034
11118
|
* @see Stream
|
|
11035
11119
|
*/
|
|
11036
11120
|
|
|
11037
|
-
var
|
|
11038
|
-
/**
|
|
11039
|
-
|
|
11040
|
-
|
|
11041
|
-
|
|
11042
|
-
|
|
11043
|
-
|
|
11044
|
-
define(streamStatusInfo, 'FAILED_BY_ICE_ERROR', 'Failed by ICE error');
|
|
11045
|
-
/**
|
|
11046
|
-
* Timeout has been reached during ICE establishment.
|
|
11047
|
-
* @event FAILED_BY_ICE_TIMEOUT
|
|
11048
|
-
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11049
|
-
*/
|
|
11121
|
+
var STREAM_STATUS_INFO = Object.freeze({
|
|
11122
|
+
/**
|
|
11123
|
+
* Indicates general error during ICE negotiation. Usually occurs if client is behind some exotic nat/firewall.
|
|
11124
|
+
* @event FAILED_BY_ICE_ERROR
|
|
11125
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11126
|
+
*/
|
|
11127
|
+
FAILED_BY_ICE_ERROR: 'Failed by ICE error',
|
|
11050
11128
|
|
|
11051
|
-
|
|
11052
|
-
|
|
11053
|
-
|
|
11054
|
-
|
|
11055
|
-
|
|
11056
|
-
|
|
11129
|
+
/**
|
|
11130
|
+
* Timeout has been reached during ICE establishment.
|
|
11131
|
+
* @event FAILED_BY_ICE_TIMEOUT
|
|
11132
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11133
|
+
*/
|
|
11134
|
+
FAILED_BY_ICE_TIMEOUT: 'Failed by ICE timeout',
|
|
11057
11135
|
|
|
11058
|
-
|
|
11059
|
-
|
|
11060
|
-
|
|
11061
|
-
|
|
11062
|
-
|
|
11063
|
-
|
|
11136
|
+
/**
|
|
11137
|
+
* ICE refresh failed on session.
|
|
11138
|
+
* @event FAILED_BY_KEEP_ALIVE
|
|
11139
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11140
|
+
*/
|
|
11141
|
+
FAILED_BY_KEEP_ALIVE: 'Failed by ICE keep alive',
|
|
11064
11142
|
|
|
11065
|
-
|
|
11066
|
-
|
|
11067
|
-
|
|
11068
|
-
|
|
11069
|
-
|
|
11070
|
-
|
|
11143
|
+
/**
|
|
11144
|
+
* DTLS has wrong fingerprint.
|
|
11145
|
+
* @event FAILED_BY_DTLS_FINGERPRINT_ERROR
|
|
11146
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11147
|
+
*/
|
|
11148
|
+
FAILED_BY_DTLS_FINGERPRINT_ERROR: 'Failed by DTLS fingerprint error',
|
|
11071
11149
|
|
|
11072
|
-
|
|
11073
|
-
|
|
11074
|
-
|
|
11075
|
-
|
|
11076
|
-
|
|
11077
|
-
|
|
11150
|
+
/**
|
|
11151
|
+
* Client did not send DTLS packets or packets were lost/corrupted during transmission.
|
|
11152
|
+
* @event FAILED_BY_DTLS_ERROR
|
|
11153
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11154
|
+
*/
|
|
11155
|
+
FAILED_BY_DTLS_ERROR: 'Failed by DTLS error',
|
|
11078
11156
|
|
|
11079
|
-
|
|
11080
|
-
|
|
11081
|
-
|
|
11082
|
-
|
|
11083
|
-
|
|
11084
|
-
|
|
11157
|
+
/**
|
|
11158
|
+
* Indicates general HLS packetizer error, can occur during initialization or packetization (wrong input or out of disk space).
|
|
11159
|
+
* @event FAILED_BY_HLS_WRITER_ERROR
|
|
11160
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11161
|
+
*/
|
|
11162
|
+
FAILED_BY_HLS_WRITER_ERROR: 'Failed by HLS writer error',
|
|
11085
11163
|
|
|
11086
|
-
|
|
11087
|
-
|
|
11088
|
-
|
|
11089
|
-
|
|
11090
|
-
|
|
11091
|
-
|
|
11164
|
+
/**
|
|
11165
|
+
* Indicates general RTMP republishing error, can occur during initialization or rtmp packetization.
|
|
11166
|
+
* @event FAILED_BY_RTMP_WRITER_ERROR
|
|
11167
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11168
|
+
*/
|
|
11169
|
+
FAILED_BY_RTMP_WRITER_ERROR: 'Failed by RTMP writer error',
|
|
11092
11170
|
|
|
11093
|
-
|
|
11094
|
-
|
|
11095
|
-
|
|
11096
|
-
|
|
11097
|
-
|
|
11098
|
-
|
|
11171
|
+
/**
|
|
11172
|
+
* RTP session failed by RTP activity timer.
|
|
11173
|
+
* @event FAILED_BY_RTP_ACTIVITY
|
|
11174
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11175
|
+
*/
|
|
11176
|
+
FAILED_BY_RTP_ACTIVITY: 'Failed by RTP activity',
|
|
11099
11177
|
|
|
11100
|
-
|
|
11101
|
-
|
|
11102
|
-
|
|
11103
|
-
|
|
11104
|
-
|
|
11105
|
-
|
|
11178
|
+
/**
|
|
11179
|
+
* Related session was disconnected.
|
|
11180
|
+
* @event STOPPED_BY_SESSION_DISCONNECT
|
|
11181
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11182
|
+
*/
|
|
11183
|
+
STOPPED_BY_SESSION_DISCONNECT: 'Stopped by session disconnect',
|
|
11106
11184
|
|
|
11107
|
-
|
|
11108
|
-
|
|
11109
|
-
|
|
11110
|
-
|
|
11111
|
-
|
|
11112
|
-
|
|
11185
|
+
/**
|
|
11186
|
+
* Stream was stopped by rest terminate request.
|
|
11187
|
+
* @event STOPPED_BY_REST_TERMINATE
|
|
11188
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11189
|
+
*/
|
|
11190
|
+
STOPPED_BY_REST_TERMINATE: 'Stopped by rest /terminate',
|
|
11113
11191
|
|
|
11114
|
-
|
|
11115
|
-
|
|
11116
|
-
|
|
11117
|
-
|
|
11118
|
-
|
|
11119
|
-
|
|
11192
|
+
/**
|
|
11193
|
+
* Related publisher stopped its stream or lost connection.
|
|
11194
|
+
* @event STOPPED_BY_PUBLISHER_STOP
|
|
11195
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11196
|
+
*/
|
|
11197
|
+
STOPPED_BY_PUBLISHER_STOP: 'Stopped by publisher stop',
|
|
11120
11198
|
|
|
11121
|
-
|
|
11122
|
-
|
|
11123
|
-
|
|
11124
|
-
|
|
11125
|
-
|
|
11126
|
-
|
|
11199
|
+
/**
|
|
11200
|
+
* Stop the media session by user after call was finished or unpublish stream.
|
|
11201
|
+
* @event STOPPED_BY_USER
|
|
11202
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11203
|
+
*/
|
|
11204
|
+
STOPPED_BY_USER: 'Stopped by user',
|
|
11127
11205
|
|
|
11128
|
-
|
|
11129
|
-
|
|
11130
|
-
|
|
11131
|
-
|
|
11132
|
-
|
|
11133
|
-
|
|
11206
|
+
/**
|
|
11207
|
+
* Error occurred on the stream.
|
|
11208
|
+
* @event FAILED_BY_ERROR
|
|
11209
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11210
|
+
*/
|
|
11211
|
+
FAILED_BY_ERROR: 'Failed by error',
|
|
11134
11212
|
|
|
11135
|
-
|
|
11136
|
-
|
|
11137
|
-
|
|
11138
|
-
|
|
11139
|
-
|
|
11140
|
-
|
|
11213
|
+
/**
|
|
11214
|
+
* Indicates that error occurred during media session creation. This might be SDP parsing error, all ports are busy, wrong session related config etc.
|
|
11215
|
+
* @event FAILED_TO_ADD_STREAM_TO_PROXY
|
|
11216
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11217
|
+
*/
|
|
11218
|
+
FAILED_TO_ADD_STREAM_TO_PROXY: 'Failed to add stream to proxy',
|
|
11141
11219
|
|
|
11142
|
-
|
|
11143
|
-
|
|
11144
|
-
|
|
11145
|
-
|
|
11146
|
-
|
|
11147
|
-
|
|
11220
|
+
/**
|
|
11221
|
+
* Stopped shapshot distributor.
|
|
11222
|
+
* @event DISTRIBUTOR_STOPPED
|
|
11223
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11224
|
+
*/
|
|
11225
|
+
DISTRIBUTOR_STOPPED: 'Distributor stopped',
|
|
11148
11226
|
|
|
11149
|
-
|
|
11150
|
-
|
|
11151
|
-
|
|
11152
|
-
|
|
11153
|
-
|
|
11154
|
-
|
|
11227
|
+
/**
|
|
11228
|
+
* Publish stream is not ready, try again later.
|
|
11229
|
+
* @event PUBLISH_STREAM_IS_NOT_READY
|
|
11230
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11231
|
+
*/
|
|
11232
|
+
PUBLISH_STREAM_IS_NOT_READY: 'Publish stream is not ready',
|
|
11155
11233
|
|
|
11156
|
-
|
|
11157
|
-
|
|
11158
|
-
|
|
11159
|
-
|
|
11160
|
-
|
|
11161
|
-
|
|
11234
|
+
/**
|
|
11235
|
+
* Stream with this name is not found, check the correct of the name.
|
|
11236
|
+
* @event STREAM_NOT_FOUND
|
|
11237
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11238
|
+
*/
|
|
11239
|
+
STREAM_NOT_FOUND: 'Stream not found',
|
|
11162
11240
|
|
|
11163
|
-
|
|
11164
|
-
|
|
11165
|
-
|
|
11166
|
-
|
|
11167
|
-
|
|
11168
|
-
|
|
11241
|
+
/**
|
|
11242
|
+
* Server already has a publish stream with the same name, try using different one.
|
|
11243
|
+
* @event STREAM_NAME_ALREADY_IN_USE
|
|
11244
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11245
|
+
*/
|
|
11246
|
+
STREAM_NAME_ALREADY_IN_USE: 'Stream name is already in use',
|
|
11169
11247
|
|
|
11170
|
-
|
|
11171
|
-
|
|
11172
|
-
|
|
11173
|
-
|
|
11174
|
-
|
|
11175
|
-
|
|
11248
|
+
/**
|
|
11249
|
+
* Error indicates that stream object received by server has empty mediaSessionId field.
|
|
11250
|
+
* @event MEDIASESSION_ID_NULL
|
|
11251
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11252
|
+
*/
|
|
11253
|
+
MEDIASESSION_ID_NULL: 'MediaSessionId is null',
|
|
11176
11254
|
|
|
11177
|
-
|
|
11178
|
-
|
|
11179
|
-
|
|
11180
|
-
|
|
11181
|
-
|
|
11182
|
-
|
|
11255
|
+
/**
|
|
11256
|
+
* Published or subscribed sessions used this MediaSessionId.
|
|
11257
|
+
* @event MEDIASESSION_ID_ALREADY_IN_USE
|
|
11258
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11259
|
+
*/
|
|
11260
|
+
MEDIASESSION_ID_ALREADY_IN_USE: 'MediaSessionId is already in use',
|
|
11183
11261
|
|
|
11184
|
-
|
|
11185
|
-
|
|
11186
|
-
|
|
11187
|
-
|
|
11188
|
-
|
|
11189
|
-
|
|
11262
|
+
/**
|
|
11263
|
+
* Session is not initialized or terminated on play ordinary stream.
|
|
11264
|
+
* @event SESSION_NOT_READY
|
|
11265
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11266
|
+
*/
|
|
11267
|
+
SESSION_NOT_READY: 'Session not ready',
|
|
11190
11268
|
|
|
11191
|
-
|
|
11192
|
-
|
|
11193
|
-
|
|
11194
|
-
|
|
11195
|
-
|
|
11196
|
-
|
|
11269
|
+
/**
|
|
11270
|
+
* Actual session does not exist.
|
|
11271
|
+
* @event SESSION_DOES_NOT_EXIST
|
|
11272
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11273
|
+
*/
|
|
11274
|
+
SESSION_DOES_NOT_EXIST: 'Session does not exist',
|
|
11197
11275
|
|
|
11198
|
-
|
|
11199
|
-
|
|
11200
|
-
|
|
11201
|
-
|
|
11202
|
-
|
|
11203
|
-
|
|
11276
|
+
/**
|
|
11277
|
+
* RTSP has wrong format on play stream, check the RTSP url validity.
|
|
11278
|
+
* @event RTSP_HAS_WRONG_FORMAT
|
|
11279
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11280
|
+
*/
|
|
11281
|
+
RTSP_HAS_WRONG_FORMAT: 'Rtsp has wrong format',
|
|
11204
11282
|
|
|
11205
|
-
|
|
11206
|
-
|
|
11207
|
-
|
|
11208
|
-
|
|
11209
|
-
|
|
11210
|
-
|
|
11283
|
+
/**
|
|
11284
|
+
* Failed to play vod stream, this format is not supported.
|
|
11285
|
+
* @event FILE_HAS_WRONG_FORMAT
|
|
11286
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11287
|
+
*/
|
|
11288
|
+
FILE_HAS_WRONG_FORMAT: 'File has wrong format',
|
|
11211
11289
|
|
|
11212
|
-
|
|
11213
|
-
|
|
11214
|
-
|
|
11215
|
-
|
|
11216
|
-
|
|
11217
|
-
|
|
11290
|
+
/**
|
|
11291
|
+
* Failed to connect to rtsp stream.
|
|
11292
|
+
* @event FAILED_TO_CONNECT_TO_RTSP_STREAM
|
|
11293
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11294
|
+
*/
|
|
11295
|
+
FAILED_TO_CONNECT_TO_RTSP_STREAM: 'Failed to connect to rtsp stream',
|
|
11218
11296
|
|
|
11219
|
-
|
|
11220
|
-
|
|
11221
|
-
|
|
11222
|
-
|
|
11223
|
-
|
|
11224
|
-
|
|
11297
|
+
/**
|
|
11298
|
+
* Rtsp stream is not found, agent received "404-Not Found".
|
|
11299
|
+
* @event RTSP_STREAM_NOT_FOUND
|
|
11300
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11301
|
+
*/
|
|
11302
|
+
RTSP_STREAM_NOT_FOUND: 'Rtsp stream not found',
|
|
11225
11303
|
|
|
11226
|
-
|
|
11227
|
-
|
|
11228
|
-
|
|
11229
|
-
|
|
11230
|
-
|
|
11231
|
-
|
|
11304
|
+
/**
|
|
11305
|
+
* On shutdown RTSP agent.
|
|
11306
|
+
* @event RTSPAGENT_SHUTDOWN
|
|
11307
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11308
|
+
*/
|
|
11309
|
+
RTSPAGENT_SHUTDOWN: 'RtspAgent shutdown',
|
|
11232
11310
|
|
|
11233
|
-
|
|
11234
|
-
|
|
11235
|
-
|
|
11236
|
-
|
|
11237
|
-
|
|
11238
|
-
|
|
11311
|
+
/**
|
|
11312
|
+
* Stream failed
|
|
11313
|
+
* @event STREAM_FAILED
|
|
11314
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11315
|
+
*/
|
|
11316
|
+
STREAM_FAILED: 'Stream failed',
|
|
11239
11317
|
|
|
11240
|
-
|
|
11241
|
-
|
|
11242
|
-
|
|
11243
|
-
|
|
11244
|
-
|
|
11245
|
-
|
|
11318
|
+
/**
|
|
11319
|
+
* No common codecs on setup track, did not found corresponding trackId->mediaPort.
|
|
11320
|
+
* @event NO_COMMON_CODECS
|
|
11321
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11322
|
+
*/
|
|
11323
|
+
NO_COMMON_CODECS: 'No common codecs',
|
|
11246
11324
|
|
|
11247
|
-
|
|
11248
|
-
|
|
11249
|
-
|
|
11250
|
-
|
|
11251
|
-
|
|
11252
|
-
|
|
11325
|
+
/**
|
|
11326
|
+
* Bad referenced rtsp link, check for correct, example: rtsp://user:b@d_password@127.0.0.1/stream.
|
|
11327
|
+
* @event BAD_URI
|
|
11328
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11329
|
+
*/
|
|
11330
|
+
BAD_URI: 'Bad URI',
|
|
11253
11331
|
|
|
11254
|
-
|
|
11255
|
-
|
|
11256
|
-
|
|
11257
|
-
|
|
11258
|
-
|
|
11259
|
-
|
|
11332
|
+
/**
|
|
11333
|
+
* General VOD error, indicates that Exception occurred while reading/processing media file.
|
|
11334
|
+
* @event GOT_EXCEPTION_WHILE_STREAMING_FILE
|
|
11335
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11336
|
+
*/
|
|
11337
|
+
GOT_EXCEPTION_WHILE_STREAMING_FILE: 'Got exception while streaming file',
|
|
11260
11338
|
|
|
11261
|
-
|
|
11262
|
-
|
|
11263
|
-
|
|
11264
|
-
|
|
11265
|
-
|
|
11266
|
-
|
|
11339
|
+
/**
|
|
11340
|
+
* Requested stream shutdown.
|
|
11341
|
+
* @event REQUESTED_STREAM_SHUTDOWN
|
|
11342
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11343
|
+
*/
|
|
11344
|
+
REQUESTED_STREAM_SHUTDOWN: 'Requested stream shutdown',
|
|
11267
11345
|
|
|
11268
|
-
|
|
11269
|
-
|
|
11270
|
-
|
|
11271
|
-
|
|
11272
|
-
|
|
11273
|
-
|
|
11346
|
+
/**
|
|
11347
|
+
* Failed to create movie, file can not be read.
|
|
11348
|
+
* @event FAILED_TO_READ_FILE
|
|
11349
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11350
|
+
*/
|
|
11351
|
+
FAILED_TO_READ_FILE: 'Failed to read file',
|
|
11274
11352
|
|
|
11275
|
-
|
|
11276
|
-
|
|
11277
|
-
|
|
11278
|
-
|
|
11279
|
-
|
|
11280
|
-
|
|
11353
|
+
/**
|
|
11354
|
+
* File does not exist, check filename.
|
|
11355
|
+
* @event FILE_NOT_FOUND
|
|
11356
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11357
|
+
*/
|
|
11358
|
+
FILE_NOT_FOUND: 'File not found',
|
|
11281
11359
|
|
|
11282
|
-
|
|
11283
|
-
|
|
11284
|
-
|
|
11285
|
-
|
|
11286
|
-
|
|
11287
|
-
|
|
11360
|
+
/**
|
|
11361
|
+
* Server failed to establish websocket connection with origin server.
|
|
11362
|
+
* @event FAILED_TO_CONNECT_TO_ORIGIN_STREAM
|
|
11363
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11364
|
+
*/
|
|
11365
|
+
FAILED_TO_CONNECT_TO_ORIGIN_STREAM: 'Failed to connect to origin stream',
|
|
11288
11366
|
|
|
11289
|
-
|
|
11290
|
-
|
|
11291
|
-
|
|
11292
|
-
|
|
11293
|
-
|
|
11294
|
-
|
|
11295
|
-
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11296
|
-
*/
|
|
11367
|
+
/**
|
|
11368
|
+
* CDN stream not found.
|
|
11369
|
+
* @event CDN_STREAM_NOT_FOUND
|
|
11370
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11371
|
+
*/
|
|
11372
|
+
CDN_STREAM_NOT_FOUND: 'CDN stream not found',
|
|
11297
11373
|
|
|
11298
|
-
|
|
11299
|
-
|
|
11300
|
-
|
|
11301
|
-
|
|
11302
|
-
|
|
11303
|
-
|
|
11374
|
+
/**
|
|
11375
|
+
* Indicates that provided URL protocol in stream name is invalid.
|
|
11376
|
+
* Valid: vod://file.mp4
|
|
11377
|
+
* Invalid: dov://file.mp4
|
|
11378
|
+
* @event FAILED_TO_GET_AGENT_STORAGE
|
|
11379
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11380
|
+
*/
|
|
11381
|
+
FAILED_TO_GET_AGENT_STORAGE: 'Failed to get agent storage',
|
|
11304
11382
|
|
|
11305
|
-
|
|
11306
|
-
|
|
11307
|
-
|
|
11308
|
-
|
|
11309
|
-
|
|
11310
|
-
|
|
11383
|
+
/**
|
|
11384
|
+
* Shutdown agent servicing origin stream.
|
|
11385
|
+
* @event AGENT_SERVICING_ORIGIN_STREAM_IS_SHUTTING_DOWN
|
|
11386
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11387
|
+
*/
|
|
11388
|
+
AGENT_SERVICING_ORIGIN_STREAM_IS_SHUTTING_DOWN: 'Agent servicing origin stream is shutting down',
|
|
11311
11389
|
|
|
11312
|
-
|
|
11313
|
-
|
|
11314
|
-
|
|
11315
|
-
|
|
11316
|
-
|
|
11317
|
-
|
|
11390
|
+
/**
|
|
11391
|
+
* Terminated by keep-alive on walk through subscribers.
|
|
11392
|
+
* @event TERMINATED_BY_KEEP_ALIVE
|
|
11393
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11394
|
+
*/
|
|
11395
|
+
TERMINATED_BY_KEEP_ALIVE: 'Terminated by keep-alive',
|
|
11318
11396
|
|
|
11319
|
-
|
|
11320
|
-
|
|
11321
|
-
|
|
11322
|
-
|
|
11323
|
-
|
|
11324
|
-
|
|
11397
|
+
/**
|
|
11398
|
+
* Transcoding required, but disabled in server settings
|
|
11399
|
+
* @event TRANSCODING_REQUIRED_BUT_DISABLED
|
|
11400
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11401
|
+
*/
|
|
11402
|
+
TRANSCODING_REQUIRED_BUT_DISABLED: 'Transcoding required, but disabled',
|
|
11325
11403
|
|
|
11326
|
-
|
|
11327
|
-
|
|
11328
|
-
|
|
11329
|
-
|
|
11330
|
-
|
|
11331
|
-
|
|
11404
|
+
/**
|
|
11405
|
+
* Access restricted by access list
|
|
11406
|
+
* @event RESTRICTED_ACCESS
|
|
11407
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11408
|
+
*/
|
|
11409
|
+
RESTRICTED_ACCESS: 'Restricted access',
|
|
11332
11410
|
|
|
11333
|
-
|
|
11411
|
+
/**
|
|
11412
|
+
* No available transcoders for stream
|
|
11413
|
+
* @event NO_AVAILABLE_TRANSCODERS
|
|
11414
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
11415
|
+
*/
|
|
11416
|
+
NO_AVAILABLE_TRANSCODERS: 'No available transcoders'
|
|
11417
|
+
});
|
|
11334
11418
|
/**
|
|
11335
11419
|
* @namespace Flashphoner.constants.CALL_STATUS_INFO
|
|
11336
11420
|
* @see Call
|
|
11337
11421
|
*/
|
|
11338
11422
|
|
|
11339
|
-
var
|
|
11340
|
-
/**
|
|
11341
|
-
|
|
11342
|
-
|
|
11343
|
-
|
|
11344
|
-
|
|
11423
|
+
var CALL_STATUS_INFO = Object.freeze({
|
|
11424
|
+
/**
|
|
11425
|
+
* Normal call hangup.
|
|
11426
|
+
* @event NORMAL_CALL_CLEARING
|
|
11427
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
11428
|
+
*/
|
|
11429
|
+
NORMAL_CALL_CLEARING: 'Normal call clearing',
|
|
11345
11430
|
|
|
11346
|
-
|
|
11347
|
-
|
|
11348
|
-
|
|
11349
|
-
|
|
11350
|
-
|
|
11351
|
-
|
|
11431
|
+
/**
|
|
11432
|
+
* Error occurred while creating a session
|
|
11433
|
+
* @event FAILED_BY_SESSION_CREATION
|
|
11434
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
11435
|
+
*/
|
|
11436
|
+
FAILED_BY_SESSION_CREATION: 'Failed by session creation',
|
|
11352
11437
|
|
|
11353
|
-
|
|
11354
|
-
|
|
11355
|
-
|
|
11356
|
-
|
|
11357
|
-
|
|
11358
|
-
|
|
11438
|
+
/**
|
|
11439
|
+
* Failed by error during ICE establishment.
|
|
11440
|
+
* @event FAILED_BY_ICE_ERROR
|
|
11441
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
11442
|
+
*/
|
|
11443
|
+
FAILED_BY_ICE_ERROR: 'Failed by ICE error',
|
|
11359
11444
|
|
|
11360
|
-
|
|
11361
|
-
|
|
11362
|
-
|
|
11363
|
-
|
|
11364
|
-
|
|
11365
|
-
|
|
11445
|
+
/**
|
|
11446
|
+
* RTP session failed by RTP activity timer.
|
|
11447
|
+
* @event FAILED_BY_RTP_ACTIVITY
|
|
11448
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
11449
|
+
*/
|
|
11450
|
+
FAILED_BY_RTP_ACTIVITY: 'Failed by RTP activity',
|
|
11366
11451
|
|
|
11367
|
-
|
|
11368
|
-
|
|
11369
|
-
|
|
11370
|
-
|
|
11371
|
-
|
|
11372
|
-
|
|
11452
|
+
/**
|
|
11453
|
+
* FF writer was failed on RTMP.
|
|
11454
|
+
* @event FAILED_BY_RTMP_WRITER_ERROR
|
|
11455
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
11456
|
+
*/
|
|
11457
|
+
FAILED_BY_RTMP_WRITER_ERROR: 'Failed by RTMP writer error',
|
|
11373
11458
|
|
|
11374
|
-
|
|
11375
|
-
|
|
11376
|
-
|
|
11377
|
-
|
|
11378
|
-
|
|
11379
|
-
|
|
11459
|
+
/**
|
|
11460
|
+
* DTLS wrong fingerprint.
|
|
11461
|
+
* @event FAILED_BY_DTLS_FINGERPRINT_ERROR
|
|
11462
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
11463
|
+
*/
|
|
11464
|
+
FAILED_BY_DTLS_FINGERPRINT_ERROR: 'Failed by DTLS fingerprint error',
|
|
11380
11465
|
|
|
11381
|
-
|
|
11382
|
-
|
|
11383
|
-
|
|
11384
|
-
|
|
11385
|
-
|
|
11386
|
-
|
|
11466
|
+
/**
|
|
11467
|
+
* No common codecs in sdp
|
|
11468
|
+
* @event NO_COMMON_CODECS
|
|
11469
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
11470
|
+
*/
|
|
11471
|
+
NO_COMMON_CODECS: 'No common codecs',
|
|
11387
11472
|
|
|
11388
|
-
|
|
11389
|
-
|
|
11390
|
-
|
|
11391
|
-
|
|
11392
|
-
|
|
11393
|
-
|
|
11473
|
+
/**
|
|
11474
|
+
* Client did not send DTLS packets or packets were lost/corrupted during transmission.
|
|
11475
|
+
* @event FAILED_BY_DTLS_ERROR
|
|
11476
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
11477
|
+
*/
|
|
11478
|
+
FAILED_BY_DTLS_ERROR: 'Failed by DTLS error',
|
|
11394
11479
|
|
|
11395
|
-
|
|
11396
|
-
|
|
11397
|
-
|
|
11398
|
-
|
|
11399
|
-
|
|
11400
|
-
|
|
11480
|
+
/**
|
|
11481
|
+
* Error occurred during the call
|
|
11482
|
+
* @event FAILED_BY_ERROR
|
|
11483
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
11484
|
+
*/
|
|
11485
|
+
FAILED_BY_ERROR: 'Failed by error',
|
|
11401
11486
|
|
|
11402
|
-
|
|
11487
|
+
/**
|
|
11488
|
+
* Call failed by request timeout
|
|
11489
|
+
* @event FAILED_BY_REQUEST_TIMEOUT
|
|
11490
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
11491
|
+
*/
|
|
11492
|
+
FAILED_BY_REQUEST_TIMEOUT: 'Failed by request timeout',
|
|
11493
|
+
|
|
11494
|
+
/**
|
|
11495
|
+
* Transcoding required, but disabled in settings
|
|
11496
|
+
* @event TRANSCODING_REQUIRED_BUT_DISABLED
|
|
11497
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
11498
|
+
*/
|
|
11499
|
+
TRANSCODING_REQUIRED_BUT_DISABLED: 'Transcoding required, but disabled'
|
|
11500
|
+
});
|
|
11403
11501
|
/**
|
|
11404
|
-
|
|
11405
|
-
|
|
11406
|
-
|
|
11407
|
-
|
|
11502
|
+
* @namespace Flashphoner.constants.ERROR_INFO
|
|
11503
|
+
*/
|
|
11504
|
+
|
|
11505
|
+
var ERROR_INFO = Object.freeze({
|
|
11506
|
+
/**
|
|
11507
|
+
* Error if none of MediaProviders available
|
|
11508
|
+
* @event NONE_OF_MEDIAPROVIDERS_AVAILABLE
|
|
11509
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
11510
|
+
*/
|
|
11511
|
+
NONE_OF_MEDIAPROVIDERS_AVAILABLE: 'None of MediaProviders available',
|
|
11512
|
+
|
|
11513
|
+
/**
|
|
11514
|
+
* Error if none of preferred MediaProviders available
|
|
11515
|
+
* @event NONE_OF_PREFERRED_MEDIAPROVIDERS_AVAILABLE
|
|
11516
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
11517
|
+
*/
|
|
11518
|
+
NONE_OF_PREFERRED_MEDIAPROVIDERS_AVAILABLE: 'None of preferred MediaProviders available',
|
|
11519
|
+
|
|
11520
|
+
/**
|
|
11521
|
+
* Error if API is not initialized
|
|
11522
|
+
* @event FLASHPHONER_API_NOT_INITIALIZED
|
|
11523
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
11524
|
+
*/
|
|
11525
|
+
FLASHPHONER_API_NOT_INITIALIZED: 'Flashphoner API is not initialized',
|
|
11526
|
+
|
|
11527
|
+
/**
|
|
11528
|
+
* Error if options.urlServer is not specified
|
|
11529
|
+
* @event OPTIONS_URLSERVER_MUST_BE_PROVIDED
|
|
11530
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
11531
|
+
*/
|
|
11532
|
+
OPTIONS_URLSERVER_MUST_BE_PROVIDED: 'options.urlServer must be provided',
|
|
11533
|
+
|
|
11534
|
+
/**
|
|
11535
|
+
* Error if session state is not valid
|
|
11536
|
+
* @event INVALID_SESSION_STATE
|
|
11537
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
11538
|
+
*/
|
|
11539
|
+
INVALID_SESSION_STATE: 'Invalid session state',
|
|
11540
|
+
|
|
11541
|
+
/**
|
|
11542
|
+
* Error if no options provided
|
|
11543
|
+
* @event OPTIONS_MUST_BE_PROVIDED
|
|
11544
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
11545
|
+
*/
|
|
11546
|
+
OPTIONS_MUST_BE_PROVIDED: 'options must be provided',
|
|
11547
|
+
|
|
11548
|
+
/**
|
|
11549
|
+
* Error if call status is not {@link Flashphoner.constants.CALL_STATUS.NEW}
|
|
11550
|
+
* @event INVALID_CALL_STATE
|
|
11551
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
11552
|
+
*/
|
|
11553
|
+
INVALID_CALL_STATE: 'Invalid call state',
|
|
11554
|
+
|
|
11555
|
+
/**
|
|
11556
|
+
* Error if event is not specified
|
|
11557
|
+
* @event EVENT_CANT_BE_NULL
|
|
11558
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
11559
|
+
*/
|
|
11560
|
+
EVENT_CANT_BE_NULL: 'Event can\'t be null',
|
|
11561
|
+
|
|
11562
|
+
/**
|
|
11563
|
+
* Error if callback is not a valid function
|
|
11564
|
+
* @event CALLBACK_NEEDS_TO_BE_A_VALID_FUNCTION
|
|
11565
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
11566
|
+
*/
|
|
11567
|
+
CALLBACK_NEEDS_TO_BE_A_VALID_FUNCTION: 'Callback needs to be a valid function',
|
|
11568
|
+
|
|
11569
|
+
/**
|
|
11570
|
+
* Error if options.name is not specified
|
|
11571
|
+
* @event OPTIONS_NAME_MUST_BE_PROVIDED
|
|
11572
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
11573
|
+
*/
|
|
11574
|
+
OPTIONS_NAME_MUST_BE_PROVIDED: 'options.name must be provided',
|
|
11408
11575
|
|
|
11409
|
-
|
|
11576
|
+
/**
|
|
11577
|
+
* Error if number of cams is less than 2 or camera is already used by other application
|
|
11578
|
+
* @event CAN_NOT_SWITCH_CAM
|
|
11579
|
+
* @memberOf Flashphoner.constants.ERROR_INFO
|
|
11580
|
+
*/
|
|
11581
|
+
CAN_NOT_SWITCH_CAM: 'Number of cams is less than 2 or camera is already used by other application',
|
|
11582
|
+
|
|
11583
|
+
/**
|
|
11584
|
+
* Error if number of mics is less than 2 or microphone is already used by other application
|
|
11585
|
+
* @event CAN_NOT_SWITCH_MIC
|
|
11586
|
+
* @memberOf Flashphoner.constants.ERROR_INFO
|
|
11587
|
+
*/
|
|
11588
|
+
CAN_NOT_SWITCH_MIC: 'Number of mics is less than 2 or microphone is already used by other application',
|
|
11589
|
+
|
|
11590
|
+
/**
|
|
11591
|
+
* Local browser error detected
|
|
11592
|
+
* @event LOCAL_ERROR
|
|
11593
|
+
* @memberOf Flashphoner.constants.ERROR_INFO
|
|
11594
|
+
*/
|
|
11595
|
+
LOCAL_ERROR: 'Local error'
|
|
11596
|
+
});
|
|
11410
11597
|
/**
|
|
11411
|
-
*
|
|
11412
|
-
* @
|
|
11413
|
-
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
11598
|
+
* Local media devices type
|
|
11599
|
+
* @namespace Flashphoner.constants.MEDIA_DEVICE_KIND
|
|
11414
11600
|
*/
|
|
11415
11601
|
|
|
11416
|
-
|
|
11417
|
-
/**
|
|
11418
|
-
*
|
|
11419
|
-
|
|
11602
|
+
var MEDIA_DEVICE_KIND = Object.freeze({
|
|
11603
|
+
/**
|
|
11604
|
+
* List local media output devices
|
|
11605
|
+
* @see Flashphoner.getMediaDevices
|
|
11606
|
+
* @memberOf Flashphoner.constants.MEDIA_DEVICE_KIND
|
|
11607
|
+
*/
|
|
11608
|
+
OUTPUT: 'output',
|
|
11609
|
+
|
|
11610
|
+
/**
|
|
11611
|
+
* List local media input devices
|
|
11612
|
+
* @see Flashphoner.getMediaDevices
|
|
11613
|
+
* @memberOf Flashphoner.constants.MEDIA_DEVICE_KIND
|
|
11614
|
+
*/
|
|
11615
|
+
INPUT: 'input',
|
|
11420
11616
|
|
|
11421
|
-
|
|
11617
|
+
/**
|
|
11618
|
+
* List local media devices
|
|
11619
|
+
* @see Flashphoner.getMediaDevices
|
|
11620
|
+
* @memberOf Flashphoner.constants.MEDIA_DEVICE_KIND
|
|
11621
|
+
*/
|
|
11622
|
+
ALL: 'all'
|
|
11623
|
+
});
|
|
11422
11624
|
/**
|
|
11423
|
-
*
|
|
11424
|
-
* @
|
|
11425
|
-
* @memberof Flashphoner.constants.ERROR_INFO
|
|
11625
|
+
* WebRTC transport type
|
|
11626
|
+
* @namespace Flashphoner.constants.TRANSPORT_TYPE
|
|
11426
11627
|
*/
|
|
11427
11628
|
|
|
11428
|
-
|
|
11629
|
+
var TRANSPORT_TYPE = Object.freeze({
|
|
11630
|
+
/**
|
|
11631
|
+
* WebRTC RTP traffic goes over UDP (default)
|
|
11632
|
+
* @see Stream
|
|
11633
|
+
* @memberOf Flashphoner.constants.TRANSPORT_TYPE
|
|
11634
|
+
*/
|
|
11635
|
+
UDP: 'UDP',
|
|
11636
|
+
|
|
11637
|
+
/**
|
|
11638
|
+
* WebRTC RTP traffic goes over TCP
|
|
11639
|
+
* @see Stream
|
|
11640
|
+
* @memberOf Flashphoner.constants.TRANSPORT_TYPE
|
|
11641
|
+
*/
|
|
11642
|
+
TCP: 'TCP'
|
|
11643
|
+
});
|
|
11429
11644
|
/**
|
|
11430
|
-
*
|
|
11431
|
-
* @
|
|
11432
|
-
* @memberof Flashphoner.constants.ERROR_INFO
|
|
11645
|
+
* WebRTC connection quality type
|
|
11646
|
+
* @namespace Flashphoner.constants.CONNECTION_QUALITY
|
|
11433
11647
|
*/
|
|
11434
11648
|
|
|
11435
|
-
|
|
11436
|
-
/**
|
|
11437
|
-
|
|
11438
|
-
|
|
11439
|
-
|
|
11440
|
-
|
|
11649
|
+
var CONNECTION_QUALITY = Object.freeze({
|
|
11650
|
+
/**
|
|
11651
|
+
* Channel bandwidth is perfect
|
|
11652
|
+
* @see Stream
|
|
11653
|
+
* @memberOf Flashphoner.constants.CONNECTION_QUALITY
|
|
11654
|
+
*/
|
|
11655
|
+
PERFECT: 'PERFECT',
|
|
11441
11656
|
|
|
11442
|
-
|
|
11443
|
-
|
|
11444
|
-
|
|
11445
|
-
|
|
11446
|
-
|
|
11447
|
-
|
|
11657
|
+
/**
|
|
11658
|
+
* Channel bandwidth is good
|
|
11659
|
+
* @see Stream
|
|
11660
|
+
* @memberOf Flashphoner.constants.CONNECTION_QUALITY
|
|
11661
|
+
*/
|
|
11662
|
+
GOOD: 'GOOD',
|
|
11448
11663
|
|
|
11449
|
-
|
|
11450
|
-
|
|
11451
|
-
|
|
11452
|
-
|
|
11453
|
-
|
|
11454
|
-
|
|
11664
|
+
/**
|
|
11665
|
+
* Channel bandwidth is bad
|
|
11666
|
+
* @see Stream
|
|
11667
|
+
* @memberOf Flashphoner.constants.CONNECTION_QUALITY
|
|
11668
|
+
*/
|
|
11669
|
+
BAD: 'BAD',
|
|
11455
11670
|
|
|
11456
|
-
|
|
11457
|
-
|
|
11458
|
-
|
|
11459
|
-
|
|
11460
|
-
|
|
11461
|
-
|
|
11671
|
+
/**
|
|
11672
|
+
* Channel bandwidth is unknown (initial state)
|
|
11673
|
+
* @see Stream
|
|
11674
|
+
* @memberOf Flashphoner.constants.CONNECTION_QUALITY
|
|
11675
|
+
*/
|
|
11676
|
+
UNKNOWN: 'UNKNOWN',
|
|
11462
11677
|
|
|
11463
|
-
|
|
11678
|
+
/**
|
|
11679
|
+
* Channel bandwidth is updating
|
|
11680
|
+
* @see Stream
|
|
11681
|
+
* @memberOf Flashphoner.constants.CONNECTION_QUALITY
|
|
11682
|
+
*/
|
|
11683
|
+
UPDATE: 'UPDATE'
|
|
11684
|
+
});
|
|
11464
11685
|
/**
|
|
11465
|
-
*
|
|
11466
|
-
* @
|
|
11467
|
-
* @
|
|
11686
|
+
* Websocket signaling stream event
|
|
11687
|
+
* @see Stream
|
|
11688
|
+
* @memberOf Flashphoner.constants
|
|
11468
11689
|
*/
|
|
11469
11690
|
|
|
11470
|
-
|
|
11691
|
+
var STREAM_EVENT = 'STREAM_EVENT';
|
|
11471
11692
|
/**
|
|
11472
|
-
*
|
|
11473
|
-
* @
|
|
11474
|
-
* @memberof Flashphoner.constants.ERROR_INFO
|
|
11693
|
+
* Websocket signaling stream event type
|
|
11694
|
+
* @namespace Flashphoner.constants.STREAM_EVENT_TYPE
|
|
11475
11695
|
*/
|
|
11476
11696
|
|
|
11477
|
-
|
|
11478
|
-
/**
|
|
11479
|
-
|
|
11480
|
-
|
|
11481
|
-
|
|
11482
|
-
|
|
11697
|
+
var STREAM_EVENT_TYPE = Object.freeze({
|
|
11698
|
+
/**
|
|
11699
|
+
* Stream audio is muted
|
|
11700
|
+
* @see Stream
|
|
11701
|
+
* @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
|
|
11702
|
+
*/
|
|
11703
|
+
AUDIO_MUTED: 'audioMuted',
|
|
11483
11704
|
|
|
11484
|
-
|
|
11485
|
-
|
|
11486
|
-
|
|
11487
|
-
|
|
11488
|
-
|
|
11489
|
-
|
|
11705
|
+
/**
|
|
11706
|
+
* Stream audio is unmuted
|
|
11707
|
+
* @see Stream
|
|
11708
|
+
* @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
|
|
11709
|
+
*/
|
|
11710
|
+
AUDIO_UNMUTED: 'audioUnmuted',
|
|
11490
11711
|
|
|
11491
|
-
|
|
11492
|
-
|
|
11493
|
-
|
|
11494
|
-
|
|
11495
|
-
|
|
11496
|
-
|
|
11712
|
+
/**
|
|
11713
|
+
* Stream video is muted
|
|
11714
|
+
* @see Stream
|
|
11715
|
+
* @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
|
|
11716
|
+
*/
|
|
11717
|
+
VIDEO_MUTED: 'videoMuted',
|
|
11497
11718
|
|
|
11498
|
-
|
|
11499
|
-
|
|
11500
|
-
|
|
11501
|
-
|
|
11502
|
-
|
|
11503
|
-
|
|
11719
|
+
/**
|
|
11720
|
+
* Stream videoo is unmuted
|
|
11721
|
+
* @see Stream
|
|
11722
|
+
* @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
|
|
11723
|
+
*/
|
|
11724
|
+
VIDEO_UNMUTED: 'videoUnmuted',
|
|
11504
11725
|
|
|
11505
|
-
|
|
11726
|
+
/**
|
|
11727
|
+
* Data bound to the stream are received
|
|
11728
|
+
* @see Stream
|
|
11729
|
+
* @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
|
|
11730
|
+
*/
|
|
11731
|
+
DATA: 'data'
|
|
11732
|
+
});
|
|
11506
11733
|
/**
|
|
11507
|
-
*
|
|
11508
|
-
* @
|
|
11509
|
-
* @memberOf Flashphoner.constants.ERROR_INFO
|
|
11734
|
+
* WebRTC video content hint type
|
|
11735
|
+
* @namespace Flashphoner.constants.CONTENT_HINT_TYPE
|
|
11510
11736
|
*/
|
|
11511
11737
|
|
|
11512
|
-
|
|
11513
|
-
/**
|
|
11514
|
-
|
|
11515
|
-
|
|
11516
|
-
|
|
11517
|
-
|
|
11738
|
+
var CONTENT_HINT_TYPE = Object.freeze({
|
|
11739
|
+
/**
|
|
11740
|
+
* Video content is motion (webcam case): keep FPS, resolution and bitrate may change
|
|
11741
|
+
* @see Stream
|
|
11742
|
+
* @memberOf Flashphoner.constants.CONTENT_HINT_TYPE
|
|
11743
|
+
*/
|
|
11744
|
+
MOTION: 'motion',
|
|
11518
11745
|
|
|
11519
|
-
|
|
11520
|
-
|
|
11521
|
-
|
|
11522
|
-
|
|
11523
|
-
|
|
11524
|
-
|
|
11525
|
-
define(transportType, 'UDP', 'UDP');
|
|
11526
|
-
define(transportType, 'TCP', 'TCP');
|
|
11527
|
-
var connectionQuality = {};
|
|
11528
|
-
define(connectionQuality, 'PERFECT', 'PERFECT');
|
|
11529
|
-
define(connectionQuality, 'GOOD', 'GOOD');
|
|
11530
|
-
define(connectionQuality, 'BAD', 'BAD');
|
|
11531
|
-
define(connectionQuality, 'UNKNOWN', 'UNKNOWN');
|
|
11532
|
-
define(connectionQuality, 'UPDATE', 'UPDATE');
|
|
11533
|
-
var streamEventType = {};
|
|
11534
|
-
define(streamEventType, 'AUDIO_MUTED', 'audioMuted');
|
|
11535
|
-
define(streamEventType, 'AUDIO_UNMUTED', 'audioUnmuted');
|
|
11536
|
-
define(streamEventType, 'VIDEO_MUTED', 'videoMuted');
|
|
11537
|
-
define(streamEventType, 'VIDEO_UNMUTED', 'videoUnmuted');
|
|
11538
|
-
define(streamEventType, 'DATA', 'data');
|
|
11539
|
-
var contentHintType = {};
|
|
11540
|
-
define(contentHintType, 'MOTION', 'motion');
|
|
11541
|
-
define(contentHintType, 'DETAIL', 'detail');
|
|
11542
|
-
define(contentHintType, 'TEXT', 'text');
|
|
11543
|
-
var constants = {};
|
|
11544
|
-
define(constants, 'SESSION_STATUS', sessionStatus);
|
|
11545
|
-
define(constants, 'STREAM_EVENT_TYPE', streamEventType);
|
|
11546
|
-
define(constants, 'STREAM_EVENT', 'STREAM_EVENT');
|
|
11547
|
-
define(constants, 'STREAM_STATUS', streamStatus);
|
|
11548
|
-
define(constants, 'CALL_STATUS', callStatus);
|
|
11549
|
-
define(constants, 'STREAM_STATUS_INFO', streamStatusInfo);
|
|
11550
|
-
define(constants, 'CALL_STATUS_INFO', callStatusInfo);
|
|
11551
|
-
define(constants, 'ERROR_INFO', errorInfo);
|
|
11552
|
-
define(constants, 'MEDIA_DEVICE_KIND', mediaDeviceKind);
|
|
11553
|
-
define(constants, 'TRANSPORT_TYPE', transportType);
|
|
11554
|
-
define(constants, 'CONNECTION_QUALITY', connectionQuality);
|
|
11555
|
-
define(constants, 'CONTENT_HINT_TYPE', contentHintType); //define helper
|
|
11556
|
-
|
|
11557
|
-
function define(obj, name, value) {
|
|
11558
|
-
Object.defineProperty(obj, name, {
|
|
11559
|
-
value: value,
|
|
11560
|
-
enumerable: true
|
|
11561
|
-
});
|
|
11562
|
-
}
|
|
11746
|
+
/**
|
|
11747
|
+
* Video content is detail (sreen sharing case): keep resolution, bitrate may change, FPS may drop
|
|
11748
|
+
* @see Stream
|
|
11749
|
+
* @memberOf Flashphoner.constants.CONTENT_HINT_TYPE
|
|
11750
|
+
*/
|
|
11751
|
+
DETAIL: 'detail',
|
|
11563
11752
|
|
|
11564
|
-
|
|
11753
|
+
/**
|
|
11754
|
+
* Video content is text (sreen sharing case): keep resolution and bitrate, FPS may drop
|
|
11755
|
+
* @see Stream
|
|
11756
|
+
* @memberOf Flashphoner.constants.CONTENT_HINT_TYPE
|
|
11757
|
+
*/
|
|
11758
|
+
TEXT: 'text'
|
|
11759
|
+
});
|
|
11760
|
+
module.exports = {
|
|
11761
|
+
SESSION_STATUS: SESSION_STATUS,
|
|
11762
|
+
STREAM_STATUS: STREAM_STATUS,
|
|
11763
|
+
CALL_STATUS: CALL_STATUS,
|
|
11764
|
+
STREAM_STATUS_INFO: STREAM_STATUS_INFO,
|
|
11765
|
+
CALL_STATUS_INFO: CALL_STATUS_INFO,
|
|
11766
|
+
ERROR_INFO: ERROR_INFO,
|
|
11767
|
+
MEDIA_DEVICE_KIND: MEDIA_DEVICE_KIND,
|
|
11768
|
+
TRANSPORT_TYPE: TRANSPORT_TYPE,
|
|
11769
|
+
CONNECTION_QUALITY: CONNECTION_QUALITY,
|
|
11770
|
+
STREAM_EVENT: STREAM_EVENT,
|
|
11771
|
+
STREAM_EVENT_TYPE: STREAM_EVENT_TYPE,
|
|
11772
|
+
CONTENT_HINT_TYPE: CONTENT_HINT_TYPE
|
|
11773
|
+
};
|
|
11565
11774
|
|
|
11566
11775
|
},{}],42:[function(require,module,exports){
|
|
11567
11776
|
'use strict';
|
|
@@ -11589,7 +11798,12 @@ var createConnection = function createConnection(options) {
|
|
|
11589
11798
|
var id = options.id;
|
|
11590
11799
|
var authToken = options.authToken;
|
|
11591
11800
|
var display = options.display || options.localDisplay;
|
|
11592
|
-
var flashBufferTime = options.flashBufferTime || 0;
|
|
11801
|
+
var flashBufferTime = options.flashBufferTime || 0; // Set connection logger #WCS-2434
|
|
11802
|
+
|
|
11803
|
+
if (options.logger) {
|
|
11804
|
+
logger = options.logger;
|
|
11805
|
+
}
|
|
11806
|
+
|
|
11593
11807
|
var url = getConnectionUrl(options.mainUrl, options.flashProto, options.flashPort); //todo state from flash instance
|
|
11594
11808
|
|
|
11595
11809
|
var state = function state() {
|
|
@@ -12210,8 +12424,9 @@ var constants = require("./constants");
|
|
|
12210
12424
|
|
|
12211
12425
|
var util = require('./util');
|
|
12212
12426
|
|
|
12213
|
-
var
|
|
12427
|
+
var LoggerObject = require('./util').logger;
|
|
12214
12428
|
|
|
12429
|
+
var coreLogger;
|
|
12215
12430
|
var loggerConf = {
|
|
12216
12431
|
push: false,
|
|
12217
12432
|
severity: "INFO"
|
|
@@ -12259,7 +12474,7 @@ var disableConnectionQualityCalculation;
|
|
|
12259
12474
|
* @param {String=} options.decoderLocation Location of video-worker2.js file
|
|
12260
12475
|
* @param {String=} options.screenSharingExtensionId Chrome screen sharing extension id
|
|
12261
12476
|
* @param {Object=} options.constraints Default local media constraints
|
|
12262
|
-
* @param {Object=} options.logger
|
|
12477
|
+
* @param {Object=} options.logger Core logger options
|
|
12263
12478
|
* @throws {Error} Error if none of MediaProviders available
|
|
12264
12479
|
* @memberof Flashphoner
|
|
12265
12480
|
*/
|
|
@@ -12268,16 +12483,10 @@ var init = function init(options) {
|
|
|
12268
12483
|
if (!initialized) {
|
|
12269
12484
|
if (!options) {
|
|
12270
12485
|
options = {};
|
|
12271
|
-
}
|
|
12272
|
-
|
|
12273
|
-
loggerConf = options.logger || loggerConf;
|
|
12486
|
+
} // init global logger
|
|
12274
12487
|
|
|
12275
|
-
if (options.logger !== null) {
|
|
12276
|
-
loggerConf.enableLogs = true;
|
|
12277
|
-
} // init logger
|
|
12278
12488
|
|
|
12279
|
-
|
|
12280
|
-
logger.init(loggerConf.severity || "INFO", loggerConf.push || false, loggerConf.customLogger, loggerConf.enableLogs);
|
|
12489
|
+
coreLogger = createLogger(options.logger);
|
|
12281
12490
|
var waitingTemasys = false;
|
|
12282
12491
|
|
|
12283
12492
|
try {
|
|
@@ -12298,7 +12507,7 @@ var init = function init(options) {
|
|
|
12298
12507
|
constraints: options.constraints || getDefaultMediaConstraints(),
|
|
12299
12508
|
extensionId: options.screenSharingExtensionId,
|
|
12300
12509
|
audioContext: audioContext,
|
|
12301
|
-
logger:
|
|
12510
|
+
logger: coreLogger,
|
|
12302
12511
|
createMicGainNode: enableGainNode
|
|
12303
12512
|
};
|
|
12304
12513
|
webRtcProvider.configure(webRtcConf);
|
|
@@ -12315,7 +12524,7 @@ var init = function init(options) {
|
|
|
12315
12524
|
var webRtcConf = {
|
|
12316
12525
|
constraints: options.constraints || getDefaultMediaConstraints(),
|
|
12317
12526
|
extensionId: options.screenSharingExtensionId,
|
|
12318
|
-
logger:
|
|
12527
|
+
logger: coreLogger
|
|
12319
12528
|
};
|
|
12320
12529
|
webRtcProvider.configure(webRtcConf); // Just reorder media provider list
|
|
12321
12530
|
|
|
@@ -12343,7 +12552,7 @@ var init = function init(options) {
|
|
|
12343
12552
|
var flashConf = {
|
|
12344
12553
|
constraints: options.constraints || getDefaultMediaConstraints(),
|
|
12345
12554
|
flashMediaProviderSwfLocation: options.flashMediaProviderSwfLocation,
|
|
12346
|
-
logger:
|
|
12555
|
+
logger: coreLogger
|
|
12347
12556
|
};
|
|
12348
12557
|
flashProvider.configure(flashConf);
|
|
12349
12558
|
}
|
|
@@ -12367,7 +12576,7 @@ var init = function init(options) {
|
|
|
12367
12576
|
receiverLocation: options.receiverLocation,
|
|
12368
12577
|
decoderLocation: options.decoderLocation,
|
|
12369
12578
|
audioContext: audioContext,
|
|
12370
|
-
logger:
|
|
12579
|
+
logger: coreLogger
|
|
12371
12580
|
};
|
|
12372
12581
|
websocketProvider.configure(wsConf);
|
|
12373
12582
|
} //check at least 1 provider available
|
|
@@ -12389,7 +12598,7 @@ var init = function init(options) {
|
|
|
12389
12598
|
MediaProvider = _MediaProvider;
|
|
12390
12599
|
}
|
|
12391
12600
|
} else {
|
|
12392
|
-
|
|
12601
|
+
corelogger.warn(LOG_PREFIX, "Preferred media provider is not available.");
|
|
12393
12602
|
}
|
|
12394
12603
|
}
|
|
12395
12604
|
|
|
@@ -12417,7 +12626,7 @@ var init = function init(options) {
|
|
|
12417
12626
|
options.mediaProvidersReadyCallback(Object.keys(MediaProvider));
|
|
12418
12627
|
}
|
|
12419
12628
|
|
|
12420
|
-
|
|
12629
|
+
coreLogger.info(LOG_PREFIX, "Initialized");
|
|
12421
12630
|
initialized = true;
|
|
12422
12631
|
}
|
|
12423
12632
|
};
|
|
@@ -12456,7 +12665,7 @@ var playFirstVideo = function playFirstVideo(display, isLocal, src) {
|
|
|
12456
12665
|
}
|
|
12457
12666
|
};
|
|
12458
12667
|
/**
|
|
12459
|
-
* Get logger
|
|
12668
|
+
* Get core logger
|
|
12460
12669
|
*
|
|
12461
12670
|
* @returns {Object} Logger
|
|
12462
12671
|
* @memberof Flashphoner
|
|
@@ -12467,7 +12676,7 @@ var getLogger = function getLogger() {
|
|
|
12467
12676
|
if (!initialized) {
|
|
12468
12677
|
console.warn("Initialize API first.");
|
|
12469
12678
|
} else {
|
|
12470
|
-
return
|
|
12679
|
+
return coreLogger;
|
|
12471
12680
|
}
|
|
12472
12681
|
};
|
|
12473
12682
|
/**
|
|
@@ -12640,6 +12849,31 @@ var getSessions = function getSessions() {
|
|
|
12640
12849
|
|
|
12641
12850
|
var getSession = function getSession(id) {
|
|
12642
12851
|
return sessions[id];
|
|
12852
|
+
}; // Get logger configuration from options
|
|
12853
|
+
|
|
12854
|
+
|
|
12855
|
+
var getLoggerConf = function getLoggerConf(loggerOptions) {
|
|
12856
|
+
var conf = loggerOptions || loggerConf;
|
|
12857
|
+
|
|
12858
|
+
if (loggerOptions !== null) {
|
|
12859
|
+
conf.enableLogs = true;
|
|
12860
|
+
}
|
|
12861
|
+
|
|
12862
|
+
return conf;
|
|
12863
|
+
}; // Create a new logger object
|
|
12864
|
+
|
|
12865
|
+
|
|
12866
|
+
var createLogger = function createLogger(loggerOptions) {
|
|
12867
|
+
var parentLogger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : coreLogger;
|
|
12868
|
+
var newLogger = parentLogger;
|
|
12869
|
+
|
|
12870
|
+
if (newLogger === undefined || loggerOptions != undefined) {
|
|
12871
|
+
var loggerConf = getLoggerConf(loggerOptions);
|
|
12872
|
+
newLogger = new LoggerObject();
|
|
12873
|
+
newLogger.init(loggerConf.severity || "INFO", loggerConf.push || false, loggerConf.customLogger, loggerConf.enableLogs);
|
|
12874
|
+
}
|
|
12875
|
+
|
|
12876
|
+
return newLogger;
|
|
12643
12877
|
};
|
|
12644
12878
|
/**
|
|
12645
12879
|
* Create new session and connect to server.
|
|
@@ -12659,6 +12893,7 @@ var getSession = function getSession(id) {
|
|
|
12659
12893
|
* @param {Integer=} options.pingInterval Server ping interval in milliseconds [0]
|
|
12660
12894
|
* @param {Integer=} options.receiveProbes A maximum subsequental pings received missing count [0]
|
|
12661
12895
|
* @param {Integer=} options.probesInterval Interval to check subsequental pings received [0]
|
|
12896
|
+
* @param {Object=} options.logger Session logger options
|
|
12662
12897
|
* @returns {Session} Created session
|
|
12663
12898
|
* @throws {Error} Error if API is not initialized
|
|
12664
12899
|
* @throws {TypeError} Error if options.urlServer is not specified
|
|
@@ -12673,8 +12908,12 @@ var createSession = function createSession(options) {
|
|
|
12673
12908
|
|
|
12674
12909
|
if (!options || !options.urlServer) {
|
|
12675
12910
|
throw new TypeError("options.urlServer must be provided");
|
|
12676
|
-
}
|
|
12911
|
+
} // Set session logger #WCS-2434
|
|
12912
|
+
|
|
12677
12913
|
|
|
12914
|
+
var sessionLogger = createLogger(options.logger); // Override logger for all low level operations
|
|
12915
|
+
|
|
12916
|
+
var logger = sessionLogger;
|
|
12678
12917
|
var id_ = uuid_v1();
|
|
12679
12918
|
var sessionStatus = SESSION_STATUS.PENDING;
|
|
12680
12919
|
var urlServer = options.urlServer;
|
|
@@ -12780,7 +13019,7 @@ var createSession = function createSession(options) {
|
|
|
12780
13019
|
if (timeout != undefined && timeout > 0) {
|
|
12781
13020
|
connectionTimeout = setTimeout(function () {
|
|
12782
13021
|
if (wsConnection.readyState == 0) {
|
|
12783
|
-
|
|
13022
|
+
logger.warn(LOG_PREFIX, "WS connection timeout");
|
|
12784
13023
|
wsConnection.close();
|
|
12785
13024
|
}
|
|
12786
13025
|
}, timeout);
|
|
@@ -12804,7 +13043,7 @@ var createSession = function createSession(options) {
|
|
|
12804
13043
|
mediaProviders: Object.keys(MediaProvider),
|
|
12805
13044
|
keepAlive: keepAlive,
|
|
12806
13045
|
authToken: authToken,
|
|
12807
|
-
clientVersion: "2.0.
|
|
13046
|
+
clientVersion: "2.0.217",
|
|
12808
13047
|
clientOSVersion: window.navigator.appVersion,
|
|
12809
13048
|
clientBrowserVersion: window.navigator.userAgent,
|
|
12810
13049
|
msePacketizationVersion: 2,
|
|
@@ -13110,6 +13349,7 @@ var createSession = function createSession(options) {
|
|
|
13110
13349
|
* @param {Array<string>=} options.sipSDP Array of custom SDP params (ex. bandwidth (b=))
|
|
13111
13350
|
* @param {Array<string>=} options.sipHeaders Array of custom SIP headers
|
|
13112
13351
|
* @param {string=} options.videoContentHint Video content hint for browser ('detail' by default to maintain resolution), {@link Flashphoner.constants.CONTENT_HINT_TYPE}
|
|
13352
|
+
* @param {Object=} options.logger Call logger options
|
|
13113
13353
|
* @param {sdpHook} sdpHook The callback that handles sdp from the server
|
|
13114
13354
|
* @returns {Call} Call
|
|
13115
13355
|
* @throws {TypeError} Error if no options provided
|
|
@@ -13122,15 +13362,18 @@ var createSession = function createSession(options) {
|
|
|
13122
13362
|
var createCall = function createCall(options) {
|
|
13123
13363
|
//check session state
|
|
13124
13364
|
if (sessionStatus !== SESSION_STATUS.REGISTERED && sessionStatus !== SESSION_STATUS.ESTABLISHED) {
|
|
13125
|
-
|
|
13126
|
-
throw new Error('Invalid session state');
|
|
13365
|
+
throw new Error('Invalid session state ' + sessionStatus);
|
|
13127
13366
|
} //check options
|
|
13128
13367
|
|
|
13129
13368
|
|
|
13130
13369
|
if (!options) {
|
|
13131
13370
|
throw new TypeError("options must be provided");
|
|
13132
|
-
}
|
|
13371
|
+
} // Set call logger #WCS-2434
|
|
13133
13372
|
|
|
13373
|
+
|
|
13374
|
+
var callLogger = createLogger(options.logger, sessionLogger); // Override logger for all low level operations
|
|
13375
|
+
|
|
13376
|
+
var logger = callLogger;
|
|
13134
13377
|
var login = appKey == 'clickToCallApp' ? '' : cConfig.sipLogin;
|
|
13135
13378
|
var caller_ = options.incoming ? options.caller : login;
|
|
13136
13379
|
var callee_ = options.callee;
|
|
@@ -13276,7 +13519,8 @@ var createSession = function createSession(options) {
|
|
|
13276
13519
|
constraints: constraints,
|
|
13277
13520
|
connectionConfig: mediaOptions,
|
|
13278
13521
|
audioOutputId: audioOutputId,
|
|
13279
|
-
videoContentHint: videoContentHint
|
|
13522
|
+
videoContentHint: videoContentHint,
|
|
13523
|
+
logger: logger
|
|
13280
13524
|
}).then(function (newConnection) {
|
|
13281
13525
|
mediaConnection = newConnection;
|
|
13282
13526
|
return mediaConnection.createOffer({
|
|
@@ -13862,7 +14106,7 @@ var createSession = function createSession(options) {
|
|
|
13862
14106
|
/**
|
|
13863
14107
|
* Get call info
|
|
13864
14108
|
* @returns {string} Info
|
|
13865
|
-
* @memberof
|
|
14109
|
+
* @memberof Call
|
|
13866
14110
|
* @inner
|
|
13867
14111
|
*/
|
|
13868
14112
|
|
|
@@ -13873,7 +14117,7 @@ var createSession = function createSession(options) {
|
|
|
13873
14117
|
/**
|
|
13874
14118
|
* Get stream error info
|
|
13875
14119
|
* @returns {string} Error info
|
|
13876
|
-
* @memberof
|
|
14120
|
+
* @memberof Call
|
|
13877
14121
|
* @inner
|
|
13878
14122
|
*/
|
|
13879
14123
|
|
|
@@ -13881,6 +14125,17 @@ var createSession = function createSession(options) {
|
|
|
13881
14125
|
var getErrorInfo = function getErrorInfo() {
|
|
13882
14126
|
return errorInfo_;
|
|
13883
14127
|
};
|
|
14128
|
+
/**
|
|
14129
|
+
* Get call logger
|
|
14130
|
+
*
|
|
14131
|
+
* @returns {Object} Logger
|
|
14132
|
+
* @memberof Call
|
|
14133
|
+
*/
|
|
14134
|
+
|
|
14135
|
+
|
|
14136
|
+
var getLogger = function getLogger() {
|
|
14137
|
+
return callLogger;
|
|
14138
|
+
};
|
|
13884
14139
|
|
|
13885
14140
|
call.call = call_;
|
|
13886
14141
|
call.answer = answer;
|
|
@@ -13912,6 +14167,7 @@ var createSession = function createSession(options) {
|
|
|
13912
14167
|
call.switchMic = switchMic;
|
|
13913
14168
|
call.switchToScreen = switchToScreen;
|
|
13914
14169
|
call.switchToCam = switchToCam;
|
|
14170
|
+
call.getLogger = getLogger;
|
|
13915
14171
|
calls[id_] = call;
|
|
13916
14172
|
return call;
|
|
13917
14173
|
};
|
|
@@ -13958,6 +14214,7 @@ var createSession = function createSession(options) {
|
|
|
13958
14214
|
* @param {string=} options.useCanvasMediaStream EXPERIMENTAL: when publish bind browser's media stream to the canvas. It can be useful for image filtering
|
|
13959
14215
|
* @param {string=} options.videoContentHint Video content hint for browser ('detail' by default to maintain resolution), {@link Flashphoner.constants.CONTENT_HINT_TYPE}
|
|
13960
14216
|
* @param {Boolean=} options.unmutePlayOnStart Unmute playback on start. May be used after user gesture only, so set 'unmutePlayOnStart: false' for autoplay
|
|
14217
|
+
* @param {Object=} options.logger Stream logger options
|
|
13961
14218
|
* @param {sdpHook} sdpHook The callback that handles sdp from the server
|
|
13962
14219
|
* @returns {Stream} Stream
|
|
13963
14220
|
* @throws {TypeError} Error if no options provided
|
|
@@ -13973,7 +14230,7 @@ var createSession = function createSession(options) {
|
|
|
13973
14230
|
var availableCallbacks = []; //check session state
|
|
13974
14231
|
|
|
13975
14232
|
if (sessionStatus !== SESSION_STATUS.ESTABLISHED) {
|
|
13976
|
-
throw new Error('Invalid session state');
|
|
14233
|
+
throw new Error('Invalid session state ' + sessionStatus);
|
|
13977
14234
|
} //check options
|
|
13978
14235
|
|
|
13979
14236
|
|
|
@@ -13983,8 +14240,12 @@ var createSession = function createSession(options) {
|
|
|
13983
14240
|
|
|
13984
14241
|
if (!options.name) {
|
|
13985
14242
|
throw new TypeError("options.name must be provided");
|
|
13986
|
-
}
|
|
14243
|
+
} // Set stream logger #WCS-2434
|
|
14244
|
+
|
|
14245
|
+
|
|
14246
|
+
var streamLogger = createLogger(options.logger, sessionLogger); // Override logger for all low level operations
|
|
13987
14247
|
|
|
14248
|
+
var logger = streamLogger;
|
|
13988
14249
|
var clientKf = new KalmanFilter();
|
|
13989
14250
|
var serverKf = new KalmanFilter();
|
|
13990
14251
|
var id_ = uuid_v1();
|
|
@@ -14228,7 +14489,7 @@ var createSession = function createSession(options) {
|
|
|
14228
14489
|
logger.debug(LOG_PREFIX, "Play stream " + name_);
|
|
14229
14490
|
|
|
14230
14491
|
if (status_ !== STREAM_STATUS.NEW) {
|
|
14231
|
-
throw new Error("Invalid stream state");
|
|
14492
|
+
throw new Error("Invalid stream state " + status_);
|
|
14232
14493
|
}
|
|
14233
14494
|
|
|
14234
14495
|
status_ = STREAM_STATUS.PENDING; //create mediaProvider connection
|
|
@@ -14247,7 +14508,8 @@ var createSession = function createSession(options) {
|
|
|
14247
14508
|
audioOutputId: audioOutputId,
|
|
14248
14509
|
remoteVideo: remoteVideo,
|
|
14249
14510
|
playoutDelay: playoutDelay,
|
|
14250
|
-
unmutePlayOnStart: unmutePlayOnStart
|
|
14511
|
+
unmutePlayOnStart: unmutePlayOnStart,
|
|
14512
|
+
logger: logger
|
|
14251
14513
|
}, streamRefreshHandlers[id_]).then(function (newConnection) {
|
|
14252
14514
|
mediaConnection = newConnection;
|
|
14253
14515
|
|
|
@@ -14311,7 +14573,7 @@ var createSession = function createSession(options) {
|
|
|
14311
14573
|
logger.debug(LOG_PREFIX, "Publish stream " + name_);
|
|
14312
14574
|
|
|
14313
14575
|
if (status_ !== STREAM_STATUS.NEW) {
|
|
14314
|
-
throw new Error("Invalid stream state");
|
|
14576
|
+
throw new Error("Invalid stream state " + status_);
|
|
14315
14577
|
}
|
|
14316
14578
|
|
|
14317
14579
|
status_ = STREAM_STATUS.PENDING;
|
|
@@ -14345,7 +14607,8 @@ var createSession = function createSession(options) {
|
|
|
14345
14607
|
connectionConfig: mediaOptions,
|
|
14346
14608
|
connectionConstraints: mediaConnectionConstraints,
|
|
14347
14609
|
customStream: constraints && constraints.customStream ? constraints.customStream : false,
|
|
14348
|
-
videoContentHint: videoContentHint
|
|
14610
|
+
videoContentHint: videoContentHint,
|
|
14611
|
+
logger: logger
|
|
14349
14612
|
}).then(function (newConnection) {
|
|
14350
14613
|
mediaConnection = newConnection;
|
|
14351
14614
|
return mediaConnection.createOffer({
|
|
@@ -14975,6 +15238,17 @@ var createSession = function createSession(options) {
|
|
|
14975
15238
|
availableCallbacks.push(promise);
|
|
14976
15239
|
});
|
|
14977
15240
|
};
|
|
15241
|
+
/**
|
|
15242
|
+
* Get stream logger
|
|
15243
|
+
*
|
|
15244
|
+
* @returns {Object} Logger
|
|
15245
|
+
* @memberof Stream
|
|
15246
|
+
*/
|
|
15247
|
+
|
|
15248
|
+
|
|
15249
|
+
var getLogger = function getLogger() {
|
|
15250
|
+
return streamLogger;
|
|
15251
|
+
};
|
|
14978
15252
|
|
|
14979
15253
|
stream.play = play;
|
|
14980
15254
|
stream.publish = publish;
|
|
@@ -15014,6 +15288,7 @@ var createSession = function createSession(options) {
|
|
|
15014
15288
|
stream.switchToScreen = switchToScreen;
|
|
15015
15289
|
stream.switchToCam = switchToCam;
|
|
15016
15290
|
stream.sendData = sendData;
|
|
15291
|
+
stream.getLogger = getLogger;
|
|
15017
15292
|
streams[id_] = stream;
|
|
15018
15293
|
return stream;
|
|
15019
15294
|
};
|
|
@@ -15222,6 +15497,17 @@ var createSession = function createSession(options) {
|
|
|
15222
15497
|
}
|
|
15223
15498
|
|
|
15224
15499
|
return sdp;
|
|
15500
|
+
};
|
|
15501
|
+
/**
|
|
15502
|
+
* Get session logger
|
|
15503
|
+
*
|
|
15504
|
+
* @returns {Object} Logger
|
|
15505
|
+
* @memberof Session
|
|
15506
|
+
*/
|
|
15507
|
+
|
|
15508
|
+
|
|
15509
|
+
var getLogger = function getLogger() {
|
|
15510
|
+
return sessionLogger;
|
|
15225
15511
|
}; //export Session
|
|
15226
15512
|
|
|
15227
15513
|
|
|
@@ -15237,7 +15523,8 @@ var createSession = function createSession(options) {
|
|
|
15237
15523
|
session.submitBugReport = submitBugReport;
|
|
15238
15524
|
session.startDebug = startDebug;
|
|
15239
15525
|
session.stopDebug = stopDebug;
|
|
15240
|
-
session.on = on;
|
|
15526
|
+
session.on = on;
|
|
15527
|
+
session.getLogger = getLogger; //save interface to global map
|
|
15241
15528
|
|
|
15242
15529
|
sessions[id_] = session;
|
|
15243
15530
|
return session;
|
|
@@ -15303,6 +15590,11 @@ var Promise = require('es6-promise').Promise;
|
|
|
15303
15590
|
|
|
15304
15591
|
var createConnection = function createConnection(options) {
|
|
15305
15592
|
return new Promise(function (resolve, reject) {
|
|
15593
|
+
// Set connection logger #WCS-2434
|
|
15594
|
+
if (options.logger) {
|
|
15595
|
+
logger = options.logger;
|
|
15596
|
+
}
|
|
15597
|
+
|
|
15306
15598
|
var id = options.id;
|
|
15307
15599
|
var connectionConfig = options.connectionConfig || {
|
|
15308
15600
|
"iceServers": []
|
|
@@ -15938,165 +16230,171 @@ module.exports = {
|
|
|
15938
16230
|
},{"./util":46,"es6-promise":2,"uuid":10,"webrtc-adapter":25}],46:[function(require,module,exports){
|
|
15939
16231
|
'use strict';
|
|
15940
16232
|
|
|
15941
|
-
|
|
15942
|
-
|
|
15943
|
-
|
|
15944
|
-
|
|
15945
|
-
}
|
|
16233
|
+
var isEmptyObject = function isEmptyObject(obj) {
|
|
16234
|
+
for (var name in obj) {
|
|
16235
|
+
return false;
|
|
16236
|
+
}
|
|
15946
16237
|
|
|
15947
|
-
|
|
15948
|
-
|
|
16238
|
+
return true;
|
|
16239
|
+
};
|
|
16240
|
+
/**
|
|
16241
|
+
* Copy values of object own properties to array.
|
|
16242
|
+
*
|
|
16243
|
+
* @param obj
|
|
16244
|
+
* @returns {Array}
|
|
16245
|
+
*/
|
|
15949
16246
|
|
|
15950
|
-
/**
|
|
15951
|
-
* Copy values of object own properties to array.
|
|
15952
|
-
*
|
|
15953
|
-
* @param obj
|
|
15954
|
-
* @returns {Array}
|
|
15955
|
-
*/
|
|
15956
|
-
copyObjectToArray: function copyObjectToArray(obj) {
|
|
15957
|
-
var ret = [];
|
|
15958
16247
|
|
|
15959
|
-
|
|
15960
|
-
|
|
15961
|
-
|
|
15962
|
-
|
|
16248
|
+
var copyObjectToArray = function copyObjectToArray(obj) {
|
|
16249
|
+
var ret = [];
|
|
16250
|
+
|
|
16251
|
+
for (var prop in obj) {
|
|
16252
|
+
if (obj.hasOwnProperty(prop)) {
|
|
16253
|
+
ret.push(obj[prop]);
|
|
15963
16254
|
}
|
|
16255
|
+
}
|
|
15964
16256
|
|
|
15965
|
-
|
|
15966
|
-
|
|
16257
|
+
return ret;
|
|
16258
|
+
};
|
|
16259
|
+
/**
|
|
16260
|
+
* Copy src properties to dst object.
|
|
16261
|
+
* Will overwrite dst prop with src prop in case of dst prop exist.
|
|
16262
|
+
*/
|
|
15967
16263
|
|
|
15968
|
-
|
|
15969
|
-
|
|
15970
|
-
|
|
15971
|
-
|
|
15972
|
-
|
|
15973
|
-
for (var prop in src) {
|
|
15974
|
-
if (src.hasOwnProperty(prop)) {
|
|
15975
|
-
dst[prop] = src[prop];
|
|
15976
|
-
}
|
|
16264
|
+
|
|
16265
|
+
var copyObjectPropsToAnotherObject = function copyObjectPropsToAnotherObject(src, dst) {
|
|
16266
|
+
for (var prop in src) {
|
|
16267
|
+
if (src.hasOwnProperty(prop)) {
|
|
16268
|
+
dst[prop] = src[prop];
|
|
15977
16269
|
}
|
|
15978
|
-
}
|
|
15979
|
-
|
|
15980
|
-
|
|
15981
|
-
|
|
15982
|
-
|
|
15983
|
-
|
|
15984
|
-
|
|
15985
|
-
|
|
15986
|
-
|
|
15987
|
-
|
|
15988
|
-
|
|
15989
|
-
//check if this is active pair
|
|
15990
|
-
if (report.googActiveConnection == "true") {
|
|
15991
|
-
gotResult = true;
|
|
15992
|
-
}
|
|
15993
|
-
}
|
|
16270
|
+
}
|
|
16271
|
+
};
|
|
16272
|
+
|
|
16273
|
+
var processRtcStatsReport = function processRtcStatsReport(browser, report) {
|
|
16274
|
+
var result = {};
|
|
16275
|
+
|
|
16276
|
+
if (browser == "chrome") {
|
|
16277
|
+
/**
|
|
16278
|
+
* Report types: googComponent, googCandidatePair, googCertificate, googLibjingleSession, googTrack, ssrc
|
|
16279
|
+
*/
|
|
16280
|
+
var gotResult = false;
|
|
15994
16281
|
|
|
15995
|
-
|
|
16282
|
+
if (report.type && report.type == "googCandidatePair") {
|
|
16283
|
+
//check if this is active pair
|
|
16284
|
+
if (report.googActiveConnection == "true") {
|
|
15996
16285
|
gotResult = true;
|
|
15997
16286
|
}
|
|
16287
|
+
}
|
|
15998
16288
|
|
|
15999
|
-
|
|
16000
|
-
|
|
16001
|
-
|
|
16002
|
-
|
|
16003
|
-
|
|
16289
|
+
if (report.type && report.type == "ssrc") {
|
|
16290
|
+
gotResult = true;
|
|
16291
|
+
}
|
|
16292
|
+
|
|
16293
|
+
if (gotResult) {
|
|
16294
|
+
for (var k in report) {
|
|
16295
|
+
if (report.hasOwnProperty(k)) {
|
|
16296
|
+
result[k] = report[k];
|
|
16004
16297
|
}
|
|
16005
16298
|
}
|
|
16299
|
+
}
|
|
16006
16300
|
|
|
16007
|
-
|
|
16008
|
-
|
|
16009
|
-
|
|
16010
|
-
|
|
16011
|
-
|
|
16012
|
-
|
|
16013
|
-
|
|
16301
|
+
return result;
|
|
16302
|
+
} else if (browser == "firefox") {
|
|
16303
|
+
/**
|
|
16304
|
+
* RTCStatsReport http://mxr.mozilla.org/mozilla-central/source/dom/webidl/RTCStatsReport.webidl
|
|
16305
|
+
*/
|
|
16306
|
+
if (report.type && (report.type == "outboundrtp" || report.type == "inboundrtp") && report.id.indexOf("rtcp") == -1) {
|
|
16307
|
+
result = {};
|
|
16014
16308
|
|
|
16015
|
-
|
|
16016
|
-
|
|
16017
|
-
|
|
16018
|
-
}
|
|
16309
|
+
for (var k in report) {
|
|
16310
|
+
if (report.hasOwnProperty(k)) {
|
|
16311
|
+
result[k] = report[k];
|
|
16019
16312
|
}
|
|
16020
16313
|
}
|
|
16021
|
-
|
|
16022
|
-
return result;
|
|
16023
|
-
} else {
|
|
16024
|
-
return result;
|
|
16025
16314
|
}
|
|
16026
16315
|
|
|
16027
|
-
;
|
|
16316
|
+
return result;
|
|
16317
|
+
} else {
|
|
16318
|
+
return result;
|
|
16319
|
+
}
|
|
16320
|
+
};
|
|
16321
|
+
|
|
16322
|
+
var Browser = {
|
|
16323
|
+
isIE: function isIE() {
|
|
16324
|
+
return (
|
|
16325
|
+
/*@cc_on!@*/
|
|
16326
|
+
false || !!document.documentMode
|
|
16327
|
+
);
|
|
16028
16328
|
},
|
|
16029
|
-
|
|
16030
|
-
|
|
16031
|
-
return (
|
|
16032
|
-
/*@cc_on!@*/
|
|
16033
|
-
false || !!document.documentMode
|
|
16034
|
-
);
|
|
16035
|
-
},
|
|
16036
|
-
isFirefox: function isFirefox() {
|
|
16037
|
-
return typeof InstallTrigger !== 'undefined';
|
|
16038
|
-
},
|
|
16039
|
-
isChrome: function isChrome() {
|
|
16040
|
-
return !!window.chrome && /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor) && !/OPR/.test(navigator.userAgent);
|
|
16041
|
-
},
|
|
16042
|
-
isEdge: function isEdge() {
|
|
16043
|
-
return !isIE && !!window.StyleMedia;
|
|
16044
|
-
},
|
|
16045
|
-
isOpera: function isOpera() {
|
|
16046
|
-
return !!window.opr && !!opr.addons || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
|
|
16047
|
-
},
|
|
16048
|
-
isiOS: function isiOS() {
|
|
16049
|
-
return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
|
16050
|
-
},
|
|
16051
|
-
isSafari: function isSafari() {
|
|
16052
|
-
var userAgent = navigator.userAgent.toLowerCase();
|
|
16053
|
-
return /(safari|applewebkit)/i.test(userAgent) && !userAgent.includes("chrome") && !userAgent.includes("android");
|
|
16054
|
-
},
|
|
16055
|
-
isAndroid: function isAndroid() {
|
|
16056
|
-
return navigator.userAgent.toLowerCase().indexOf("android") > -1;
|
|
16057
|
-
},
|
|
16058
|
-
isSafariWebRTC: function isSafariWebRTC() {
|
|
16059
|
-
return navigator.mediaDevices && this.isSafari();
|
|
16060
|
-
},
|
|
16061
|
-
isSamsungBrowser: function isSamsungBrowser() {
|
|
16062
|
-
return /SamsungBrowser/i.test(navigator.userAgent);
|
|
16063
|
-
},
|
|
16064
|
-
isAndroidFirefox: function isAndroidFirefox() {
|
|
16065
|
-
return this.isAndroid() && /Firefox/i.test(navigator.userAgent);
|
|
16066
|
-
}
|
|
16329
|
+
isFirefox: function isFirefox() {
|
|
16330
|
+
return typeof InstallTrigger !== 'undefined';
|
|
16067
16331
|
},
|
|
16068
|
-
|
|
16069
|
-
|
|
16070
|
-
|
|
16071
|
-
|
|
16072
|
-
|
|
16073
|
-
|
|
16074
|
-
|
|
16075
|
-
|
|
16076
|
-
|
|
16077
|
-
|
|
16078
|
-
|
|
16079
|
-
|
|
16332
|
+
isChrome: function isChrome() {
|
|
16333
|
+
return !!window.chrome && /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor) && !/OPR/.test(navigator.userAgent);
|
|
16334
|
+
},
|
|
16335
|
+
isEdge: function isEdge() {
|
|
16336
|
+
return !isIE && !!window.StyleMedia;
|
|
16337
|
+
},
|
|
16338
|
+
isOpera: function isOpera() {
|
|
16339
|
+
return !!window.opr && !!opr.addons || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
|
|
16340
|
+
},
|
|
16341
|
+
isiOS: function isiOS() {
|
|
16342
|
+
return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
|
16343
|
+
},
|
|
16344
|
+
isSafari: function isSafari() {
|
|
16345
|
+
var userAgent = navigator.userAgent.toLowerCase();
|
|
16346
|
+
return /(safari|applewebkit)/i.test(userAgent) && !userAgent.includes("chrome") && !userAgent.includes("android");
|
|
16347
|
+
},
|
|
16348
|
+
isAndroid: function isAndroid() {
|
|
16349
|
+
return navigator.userAgent.toLowerCase().indexOf("android") > -1;
|
|
16350
|
+
},
|
|
16351
|
+
isSafariWebRTC: function isSafariWebRTC() {
|
|
16352
|
+
return navigator.mediaDevices && this.isSafari();
|
|
16353
|
+
},
|
|
16354
|
+
isSamsungBrowser: function isSamsungBrowser() {
|
|
16355
|
+
return /SamsungBrowser/i.test(navigator.userAgent);
|
|
16356
|
+
},
|
|
16357
|
+
isAndroidFirefox: function isAndroidFirefox() {
|
|
16358
|
+
return this.isAndroid() && /Firefox/i.test(navigator.userAgent);
|
|
16359
|
+
},
|
|
16360
|
+
isChromiumEdge: function isChromiumEdge() {
|
|
16361
|
+
return /Chrome/i.test(navigator.userAgent) && /Edg/i.test(navigator.userAgent);
|
|
16362
|
+
}
|
|
16363
|
+
};
|
|
16364
|
+
var SDP = {
|
|
16365
|
+
matchPrefix: function matchPrefix(sdp, prefix) {
|
|
16366
|
+
var parts = sdp.trim().split('\n').map(function (line) {
|
|
16367
|
+
return line.trim();
|
|
16368
|
+
});
|
|
16369
|
+
return parts.filter(function (line) {
|
|
16370
|
+
return line.indexOf(prefix) === 0;
|
|
16371
|
+
});
|
|
16372
|
+
},
|
|
16373
|
+
writeFmtp: function writeFmtp(sdp, param, codec) {
|
|
16374
|
+
var sdpArray = sdp.split("\n");
|
|
16375
|
+
var i;
|
|
16080
16376
|
|
|
16081
|
-
|
|
16082
|
-
|
|
16083
|
-
|
|
16084
|
-
|
|
16085
|
-
|
|
16377
|
+
for (i = 0; i < sdpArray.length; i++) {
|
|
16378
|
+
if (sdpArray[i].search(codec) != -1 && sdpArray[i].indexOf("a=rtpmap") == 0) {
|
|
16379
|
+
sdpArray[i] += "\na=fmtp:" + sdpArray[i].match(/[0-9]+/)[0] + " " + param + "\r";
|
|
16380
|
+
}
|
|
16381
|
+
} //normalize sdp after modifications
|
|
16086
16382
|
|
|
16087
16383
|
|
|
16088
|
-
|
|
16384
|
+
var result = "";
|
|
16089
16385
|
|
|
16090
|
-
|
|
16091
|
-
|
|
16092
|
-
|
|
16093
|
-
}
|
|
16386
|
+
for (i = 0; i < sdpArray.length; i++) {
|
|
16387
|
+
if (sdpArray[i] != "") {
|
|
16388
|
+
result += sdpArray[i] + "\n";
|
|
16094
16389
|
}
|
|
16095
|
-
|
|
16096
|
-
return result;
|
|
16097
16390
|
}
|
|
16098
|
-
|
|
16099
|
-
|
|
16391
|
+
|
|
16392
|
+
return result;
|
|
16393
|
+
}
|
|
16394
|
+
};
|
|
16395
|
+
|
|
16396
|
+
var logger = function logger() {
|
|
16397
|
+
return {
|
|
16100
16398
|
init: function init(verbosity, enablePushLogs, customLogger, enableLogs) {
|
|
16101
16399
|
switch (verbosity.toUpperCase()) {
|
|
16102
16400
|
case "DEBUG":
|
|
@@ -16277,92 +16575,104 @@ module.exports = {
|
|
|
16277
16575
|
default:
|
|
16278
16576
|
this.verbosity = 2;
|
|
16279
16577
|
}
|
|
16280
|
-
|
|
16281
|
-
;
|
|
16282
16578
|
}
|
|
16283
|
-
}
|
|
16284
|
-
|
|
16285
|
-
if (!codecs.length) return sdp;
|
|
16286
|
-
var sdpArray = sdp.split("\n");
|
|
16287
|
-
var codecsArray = codecs.split(","); //search and delete codecs line
|
|
16579
|
+
};
|
|
16580
|
+
};
|
|
16288
16581
|
|
|
16289
|
-
|
|
16290
|
-
|
|
16582
|
+
var stripCodecs = function stripCodecs(sdp, codecs) {
|
|
16583
|
+
if (!codecs.length) return sdp;
|
|
16584
|
+
var sdpArray = sdp.split("\n");
|
|
16585
|
+
var codecsArray = codecs.split(","); //search and delete codecs line
|
|
16291
16586
|
|
|
16292
|
-
|
|
16293
|
-
|
|
16587
|
+
var pt = [];
|
|
16588
|
+
var i;
|
|
16294
16589
|
|
|
16295
|
-
|
|
16296
|
-
|
|
16297
|
-
|
|
16298
|
-
|
|
16299
|
-
|
|
16300
|
-
|
|
16590
|
+
for (var p = 0; p < codecsArray.length; p++) {
|
|
16591
|
+
console.log("Searching for codec " + codecsArray[p]);
|
|
16592
|
+
|
|
16593
|
+
for (i = 0; i < sdpArray.length; i++) {
|
|
16594
|
+
if (sdpArray[i].search(new RegExp(codecsArray[p], 'i')) != -1 && sdpArray[i].indexOf("a=rtpmap") == 0) {
|
|
16595
|
+
console.log(codecsArray[p] + " detected");
|
|
16596
|
+
pt.push(sdpArray[i].match(/[0-9]+/)[0]);
|
|
16597
|
+
sdpArray[i] = "";
|
|
16301
16598
|
}
|
|
16302
16599
|
}
|
|
16600
|
+
}
|
|
16303
16601
|
|
|
16304
|
-
|
|
16305
|
-
|
|
16306
|
-
|
|
16307
|
-
|
|
16308
|
-
|
|
16309
|
-
|
|
16310
|
-
}
|
|
16602
|
+
if (pt.length) {
|
|
16603
|
+
//searching for fmtp
|
|
16604
|
+
for (p = 0; p < pt.length; p++) {
|
|
16605
|
+
for (i = 0; i < sdpArray.length; i++) {
|
|
16606
|
+
if (sdpArray[i].search("a=fmtp:" + pt[p]) != -1 || sdpArray[i].search("a=rtcp-fb:" + pt[p]) != -1) {
|
|
16607
|
+
sdpArray[i] = "";
|
|
16311
16608
|
}
|
|
16312
|
-
}
|
|
16609
|
+
}
|
|
16610
|
+
} //delete entries from m= line
|
|
16313
16611
|
|
|
16314
16612
|
|
|
16315
|
-
|
|
16316
|
-
|
|
16317
|
-
|
|
16318
|
-
|
|
16613
|
+
for (i = 0; i < sdpArray.length; i++) {
|
|
16614
|
+
if (sdpArray[i].search("m=audio") != -1 || sdpArray[i].search("m=video") != -1) {
|
|
16615
|
+
var mLineSplitted = sdpArray[i].split(" ");
|
|
16616
|
+
var newMLine = "";
|
|
16319
16617
|
|
|
16320
|
-
|
|
16321
|
-
|
|
16322
|
-
|
|
16618
|
+
for (var m = 0; m < mLineSplitted.length; m++) {
|
|
16619
|
+
if (pt.indexOf(mLineSplitted[m].trim()) == -1 || m <= 2) {
|
|
16620
|
+
newMLine += mLineSplitted[m];
|
|
16323
16621
|
|
|
16324
|
-
|
|
16325
|
-
|
|
16326
|
-
}
|
|
16622
|
+
if (m < mLineSplitted.length - 1) {
|
|
16623
|
+
newMLine = newMLine + " ";
|
|
16327
16624
|
}
|
|
16328
16625
|
}
|
|
16329
|
-
|
|
16330
|
-
sdpArray[i] = newMLine;
|
|
16331
16626
|
}
|
|
16627
|
+
|
|
16628
|
+
sdpArray[i] = newMLine;
|
|
16332
16629
|
}
|
|
16333
|
-
}
|
|
16630
|
+
}
|
|
16631
|
+
} //normalize sdp after modifications
|
|
16334
16632
|
|
|
16335
16633
|
|
|
16336
|
-
|
|
16634
|
+
var result = "";
|
|
16337
16635
|
|
|
16338
|
-
|
|
16339
|
-
|
|
16340
|
-
|
|
16341
|
-
}
|
|
16636
|
+
for (i = 0; i < sdpArray.length; i++) {
|
|
16637
|
+
if (sdpArray[i] != "") {
|
|
16638
|
+
result += sdpArray[i] + "\n";
|
|
16342
16639
|
}
|
|
16640
|
+
}
|
|
16343
16641
|
|
|
16344
|
-
|
|
16345
|
-
|
|
16346
|
-
getCurrentCodecAndSampleRate: function getCurrentCodecAndSampleRate(sdp, mediaType) {
|
|
16347
|
-
var rows = sdp.split("\n");
|
|
16348
|
-
var codecPt;
|
|
16642
|
+
return result;
|
|
16643
|
+
};
|
|
16349
16644
|
|
|
16350
|
-
|
|
16351
|
-
|
|
16352
|
-
|
|
16353
|
-
ret.name = rows[i].split(" ")[1].split("/")[0];
|
|
16354
|
-
ret.sampleRate = rows[i].split(" ")[1].split("/")[1];
|
|
16355
|
-
return ret;
|
|
16356
|
-
} //WCS-2136. WebRTC statistics doesn't work for VP8
|
|
16645
|
+
var getCurrentCodecAndSampleRate = function getCurrentCodecAndSampleRate(sdp, mediaType) {
|
|
16646
|
+
var rows = sdp.split("\n");
|
|
16647
|
+
var codecPt;
|
|
16357
16648
|
|
|
16649
|
+
for (var i = 0; i < rows.length; i++) {
|
|
16650
|
+
if (codecPt && rows[i].indexOf("a=rtpmap:" + codecPt) != -1) {
|
|
16651
|
+
var ret = {};
|
|
16652
|
+
ret.name = rows[i].split(" ")[1].split("/")[0];
|
|
16653
|
+
ret.sampleRate = rows[i].split(" ")[1].split("/")[1];
|
|
16654
|
+
return ret;
|
|
16655
|
+
} //WCS-2136. WebRTC statistics doesn't work for VP8
|
|
16358
16656
|
|
|
16359
|
-
|
|
16360
|
-
|
|
16361
|
-
|
|
16657
|
+
|
|
16658
|
+
if (rows[i].indexOf("m=" + mediaType) != -1) {
|
|
16659
|
+
codecPt = rows[i].split(" ")[3].trim();
|
|
16362
16660
|
}
|
|
16363
16661
|
}
|
|
16364
16662
|
};
|
|
16365
16663
|
|
|
16664
|
+
module.exports = {
|
|
16665
|
+
isEmptyObject: isEmptyObject,
|
|
16666
|
+
copyObjectToArray: copyObjectToArray,
|
|
16667
|
+
copyObjectPropsToAnotherObject: copyObjectPropsToAnotherObject,
|
|
16668
|
+
processRtcStatsReport: processRtcStatsReport,
|
|
16669
|
+
Browser: Browser,
|
|
16670
|
+
SDP: SDP,
|
|
16671
|
+
logger: logger,
|
|
16672
|
+
stripCodecs: stripCodecs,
|
|
16673
|
+
getCurrentCodecAndSampleRate: getCurrentCodecAndSampleRate
|
|
16674
|
+
};
|
|
16675
|
+
|
|
16366
16676
|
},{}],47:[function(require,module,exports){
|
|
16367
16677
|
'use strict';
|
|
16368
16678
|
|
|
@@ -16382,7 +16692,12 @@ var audioContext;
|
|
|
16382
16692
|
var createConnection = function createConnection(options, handlers) {
|
|
16383
16693
|
return new Promise(function (resolve, reject) {
|
|
16384
16694
|
var id = options.id;
|
|
16385
|
-
var display = options.display;
|
|
16695
|
+
var display = options.display; // Set connection logger #WCS-2434
|
|
16696
|
+
|
|
16697
|
+
if (options.logger) {
|
|
16698
|
+
logger = options.logger;
|
|
16699
|
+
}
|
|
16700
|
+
|
|
16386
16701
|
var canvas = document.createElement("canvas");
|
|
16387
16702
|
display.appendChild(canvas);
|
|
16388
16703
|
canvas.id = id;
|