@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
package/flashphoner.js
CHANGED
|
@@ -9682,717 +9682,926 @@ exports['WSPlayer'] = WSPlayer;
|
|
|
9682
9682
|
* @see Session
|
|
9683
9683
|
*/
|
|
9684
9684
|
|
|
9685
|
-
var
|
|
9686
|
-
/**
|
|
9687
|
-
|
|
9688
|
-
|
|
9689
|
-
|
|
9690
|
-
|
|
9685
|
+
var SESSION_STATUS = Object.freeze({
|
|
9686
|
+
/**
|
|
9687
|
+
* Fires when {@link Session} ws socket opens.
|
|
9688
|
+
* @event CONNECTED
|
|
9689
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
9690
|
+
*/
|
|
9691
|
+
CONNECTED: 'CONNECTED',
|
|
9691
9692
|
|
|
9692
|
-
|
|
9693
|
-
|
|
9694
|
-
|
|
9695
|
-
|
|
9696
|
-
|
|
9697
|
-
|
|
9693
|
+
/**
|
|
9694
|
+
* Fires when {@link Session} receives connect ack from REST App.
|
|
9695
|
+
* @event ESTABLISHED
|
|
9696
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
9697
|
+
*/
|
|
9698
|
+
ESTABLISHED: 'ESTABLISHED',
|
|
9698
9699
|
|
|
9699
|
-
|
|
9700
|
-
|
|
9701
|
-
|
|
9702
|
-
|
|
9703
|
-
|
|
9704
|
-
|
|
9700
|
+
/**
|
|
9701
|
+
* Fires when {@link Session} disconnects.
|
|
9702
|
+
* @event DISCONNECTED
|
|
9703
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
9704
|
+
*/
|
|
9705
|
+
DISCONNECTED: 'DISCONNECTED',
|
|
9705
9706
|
|
|
9706
|
-
|
|
9707
|
-
|
|
9708
|
-
|
|
9709
|
-
|
|
9710
|
-
|
|
9711
|
-
|
|
9707
|
+
/**
|
|
9708
|
+
* Fires if {@link Session} call of rest method error.
|
|
9709
|
+
* @event WARN
|
|
9710
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
9711
|
+
*/
|
|
9712
|
+
WARN: 'WARN',
|
|
9712
9713
|
|
|
9713
|
-
|
|
9714
|
-
|
|
9715
|
-
|
|
9716
|
-
|
|
9717
|
-
|
|
9718
|
-
|
|
9719
|
-
|
|
9714
|
+
/**
|
|
9715
|
+
* Fires if {@link Session} connection failed.
|
|
9716
|
+
* Some of the reasons can be network connection failed, REST App failed
|
|
9717
|
+
* @event FAILED
|
|
9718
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
9719
|
+
*/
|
|
9720
|
+
FAILED: 'FAILED',
|
|
9720
9721
|
|
|
9721
|
-
|
|
9722
|
-
|
|
9723
|
-
|
|
9724
|
-
|
|
9725
|
-
|
|
9726
|
-
|
|
9722
|
+
/**
|
|
9723
|
+
* Fires wneh {@link Session} receives debug event
|
|
9724
|
+
* @event DEBUG
|
|
9725
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
9726
|
+
*/
|
|
9727
|
+
DEBUG: 'DEBUG',
|
|
9727
9728
|
|
|
9728
|
-
|
|
9729
|
-
|
|
9730
|
-
|
|
9731
|
-
|
|
9732
|
-
|
|
9733
|
-
|
|
9734
|
-
|
|
9729
|
+
/**
|
|
9730
|
+
* Fires when {@link Session} receives custom REST App message.
|
|
9731
|
+
*
|
|
9732
|
+
* @event APP_DATA
|
|
9733
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
9734
|
+
*/
|
|
9735
|
+
APP_DATA: 'APP_DATA',
|
|
9735
9736
|
|
|
9736
|
-
|
|
9737
|
-
|
|
9738
|
-
|
|
9739
|
-
|
|
9740
|
-
|
|
9741
|
-
|
|
9742
|
-
|
|
9737
|
+
/**
|
|
9738
|
+
* Fires when {@link Session} receives status of sendData operation.
|
|
9739
|
+
*
|
|
9740
|
+
* @event SEND_DATA_STATUS
|
|
9741
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
9742
|
+
*/
|
|
9743
|
+
SEND_DATA_STATUS: 'SEND_DATA_STATUS',
|
|
9743
9744
|
|
|
9744
|
-
|
|
9745
|
+
/**
|
|
9746
|
+
* State of newly created {@link Session}.
|
|
9747
|
+
*
|
|
9748
|
+
* @event PENDING
|
|
9749
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
9750
|
+
*/
|
|
9751
|
+
PENDING: 'PENDING',
|
|
9745
9752
|
|
|
9746
|
-
|
|
9747
|
-
|
|
9748
|
-
|
|
9749
|
-
|
|
9750
|
-
|
|
9751
|
-
|
|
9752
|
-
|
|
9753
|
+
/**
|
|
9754
|
+
* Fires when {@link Session} registers as sip client.
|
|
9755
|
+
*
|
|
9756
|
+
* @event REGISTERED
|
|
9757
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
9758
|
+
*/
|
|
9759
|
+
REGISTERED: 'REGISTERED',
|
|
9753
9760
|
|
|
9754
|
-
|
|
9755
|
-
|
|
9756
|
-
|
|
9757
|
-
|
|
9758
|
-
|
|
9759
|
-
|
|
9760
|
-
|
|
9761
|
+
/**
|
|
9762
|
+
* Fires when {@link Session} unregisters as sip client.
|
|
9763
|
+
*
|
|
9764
|
+
* @event UNREGISTERED
|
|
9765
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
9766
|
+
*/
|
|
9767
|
+
UNREGISTERED: 'UNREGISTERED',
|
|
9761
9768
|
|
|
9762
|
-
|
|
9763
|
-
|
|
9769
|
+
/**
|
|
9770
|
+
* Fires when {@link Session} receives an incoming call.
|
|
9771
|
+
*
|
|
9772
|
+
* @event INCOMING_CALL
|
|
9773
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
9774
|
+
*/
|
|
9775
|
+
INCOMING_CALL: 'INCOMING_CALL'
|
|
9776
|
+
});
|
|
9764
9777
|
/**
|
|
9765
9778
|
* @namespace Flashphoner.constants.STREAM_STATUS
|
|
9766
9779
|
* @see Stream
|
|
9767
9780
|
*/
|
|
9768
9781
|
|
|
9769
|
-
var
|
|
9770
|
-
|
|
9771
|
-
|
|
9782
|
+
var STREAM_STATUS = Object.freeze({
|
|
9783
|
+
/**
|
|
9784
|
+
* State of newly created {@link Stream}.
|
|
9785
|
+
*
|
|
9786
|
+
* @event NEW
|
|
9787
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
9788
|
+
*/
|
|
9789
|
+
NEW: 'NEW',
|
|
9772
9790
|
|
|
9773
|
-
|
|
9774
|
-
|
|
9775
|
-
|
|
9776
|
-
|
|
9777
|
-
|
|
9778
|
-
|
|
9791
|
+
/**
|
|
9792
|
+
* State before {@link Stream} publishing/playing.
|
|
9793
|
+
*
|
|
9794
|
+
* @event PENDING
|
|
9795
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
9796
|
+
*/
|
|
9797
|
+
PENDING: 'PENDING',
|
|
9779
9798
|
|
|
9780
|
-
|
|
9781
|
-
|
|
9782
|
-
|
|
9783
|
-
|
|
9784
|
-
|
|
9785
|
-
|
|
9799
|
+
/**
|
|
9800
|
+
* Fires when {@link Stream} starts publishing.
|
|
9801
|
+
* @event PUBLISHING
|
|
9802
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
9803
|
+
*/
|
|
9804
|
+
PUBLISHING: 'PUBLISHING',
|
|
9786
9805
|
|
|
9787
|
-
|
|
9788
|
-
|
|
9789
|
-
|
|
9790
|
-
|
|
9791
|
-
|
|
9792
|
-
|
|
9806
|
+
/**
|
|
9807
|
+
* Fires when {@link Stream} starts playing.
|
|
9808
|
+
* @event PLAYING
|
|
9809
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
9810
|
+
*/
|
|
9811
|
+
PLAYING: 'PLAYING',
|
|
9793
9812
|
|
|
9794
|
-
|
|
9795
|
-
|
|
9796
|
-
|
|
9797
|
-
|
|
9798
|
-
|
|
9799
|
-
|
|
9813
|
+
/**
|
|
9814
|
+
* Fires if {@link Stream} paused.
|
|
9815
|
+
* @event PAUSED
|
|
9816
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
9817
|
+
*/
|
|
9818
|
+
PAUSED: 'PAUSED',
|
|
9800
9819
|
|
|
9801
|
-
|
|
9802
|
-
|
|
9803
|
-
|
|
9804
|
-
|
|
9805
|
-
|
|
9806
|
-
|
|
9820
|
+
/**
|
|
9821
|
+
* Fires if {@link Stream} was unpublished.
|
|
9822
|
+
* @event UNPUBLISHED
|
|
9823
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
9824
|
+
*/
|
|
9825
|
+
UNPUBLISHED: 'UNPUBLISHED',
|
|
9807
9826
|
|
|
9808
|
-
|
|
9809
|
-
|
|
9810
|
-
|
|
9811
|
-
|
|
9812
|
-
|
|
9813
|
-
|
|
9827
|
+
/**
|
|
9828
|
+
* Fires if playing {@link Stream} was stopped.
|
|
9829
|
+
* @event STOPPED
|
|
9830
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
9831
|
+
*/
|
|
9832
|
+
STOPPED: 'STOPPED',
|
|
9814
9833
|
|
|
9815
|
-
|
|
9816
|
-
|
|
9817
|
-
|
|
9818
|
-
|
|
9819
|
-
|
|
9820
|
-
|
|
9834
|
+
/**
|
|
9835
|
+
* Fires if {@link Stream} failed.
|
|
9836
|
+
* @event FAILED
|
|
9837
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
9838
|
+
*/
|
|
9839
|
+
FAILED: 'FAILED',
|
|
9821
9840
|
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
|
|
9826
|
-
|
|
9827
|
-
|
|
9841
|
+
/**
|
|
9842
|
+
* Fires if {@link Stream} playback problem.
|
|
9843
|
+
* @event PLAYBACK_PROBLEM
|
|
9844
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
9845
|
+
*/
|
|
9846
|
+
PLAYBACK_PROBLEM: 'PLAYBACK_PROBLEM',
|
|
9828
9847
|
|
|
9829
|
-
|
|
9830
|
-
|
|
9831
|
-
|
|
9832
|
-
|
|
9833
|
-
|
|
9834
|
-
|
|
9835
|
-
*/
|
|
9848
|
+
/**
|
|
9849
|
+
* Fires if playing {@link Stream} picture resizing.
|
|
9850
|
+
* @event RESIZE
|
|
9851
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
9852
|
+
*/
|
|
9853
|
+
RESIZE: 'RESIZE',
|
|
9836
9854
|
|
|
9837
|
-
|
|
9838
|
-
|
|
9839
|
-
|
|
9840
|
-
|
|
9841
|
-
|
|
9842
|
-
|
|
9855
|
+
/**
|
|
9856
|
+
* Fires when {@link Stream} snapshot becomes available.
|
|
9857
|
+
* Snapshot is base64 encoded png available through {@link Stream.getInfo}
|
|
9858
|
+
* @event SNAPSHOT_COMPLETE
|
|
9859
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
9860
|
+
*/
|
|
9861
|
+
SNAPSHOT_COMPLETE: 'SNAPSHOT_COMPLETE',
|
|
9843
9862
|
|
|
9844
|
-
|
|
9863
|
+
/**
|
|
9864
|
+
* Fires on playing {@link Stream} if bitrate is higher than available network bandwidth.
|
|
9865
|
+
* @event NOT_ENOUGH_BANDWIDTH
|
|
9866
|
+
* @memberof Flashphoner.constants.NOT_ENOUGH_BANDWIDTH
|
|
9867
|
+
*/
|
|
9868
|
+
NOT_ENOUGH_BANDWIDTH: 'NOT_ENOUGH_BANDWIDTH'
|
|
9869
|
+
});
|
|
9845
9870
|
/**
|
|
9846
9871
|
* @namespace Flashphoner.constants.CALL_STATUS
|
|
9847
9872
|
* @see Call
|
|
9848
9873
|
*/
|
|
9849
9874
|
|
|
9850
|
-
var
|
|
9851
|
-
|
|
9852
|
-
|
|
9853
|
-
|
|
9854
|
-
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
|
|
9858
|
-
|
|
9859
|
-
|
|
9860
|
-
|
|
9861
|
-
|
|
9862
|
-
|
|
9875
|
+
var CALL_STATUS = Object.freeze({
|
|
9876
|
+
/**
|
|
9877
|
+
* State of newly created {@link Call}
|
|
9878
|
+
* @event NEW
|
|
9879
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
9880
|
+
*/
|
|
9881
|
+
NEW: 'NEW',
|
|
9882
|
+
|
|
9883
|
+
/**
|
|
9884
|
+
* The server is ringing to the callee
|
|
9885
|
+
* @event RING
|
|
9886
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
9887
|
+
*/
|
|
9888
|
+
RING: 'RING',
|
|
9889
|
+
RING_MEDIA: 'RING_MEDIA',
|
|
9890
|
+
|
|
9891
|
+
/**
|
|
9892
|
+
* The {@link Call} was put on hold
|
|
9893
|
+
* @event HOLD
|
|
9894
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
9895
|
+
*/
|
|
9896
|
+
HOLD: 'HOLD',
|
|
9897
|
+
|
|
9898
|
+
/**
|
|
9899
|
+
* The {@link Call} is established
|
|
9900
|
+
* @event ESTABLISHED
|
|
9901
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
9902
|
+
*/
|
|
9903
|
+
ESTABLISHED: 'ESTABLISHED',
|
|
9904
|
+
|
|
9905
|
+
/**
|
|
9906
|
+
* The {@link Call} is finished
|
|
9907
|
+
* @event FINISH
|
|
9908
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
9909
|
+
*/
|
|
9910
|
+
FINISH: 'FINISH',
|
|
9911
|
+
|
|
9912
|
+
/**
|
|
9913
|
+
* Callee is busy
|
|
9914
|
+
* @event BUSY
|
|
9915
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
9916
|
+
*/
|
|
9917
|
+
BUSY: 'BUSY',
|
|
9918
|
+
|
|
9919
|
+
/**
|
|
9920
|
+
* SIP session is in progress
|
|
9921
|
+
* @event SESSION_PROGRESS
|
|
9922
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
9923
|
+
*/
|
|
9924
|
+
SESSION_PROGRESS: 'SESSION_PROGRESS',
|
|
9925
|
+
|
|
9926
|
+
/**
|
|
9927
|
+
* The {@link Call} is failed
|
|
9928
|
+
* @event FAILED
|
|
9929
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
9930
|
+
*/
|
|
9931
|
+
FAILED: 'FAILED',
|
|
9932
|
+
|
|
9933
|
+
/**
|
|
9934
|
+
* The {@link Call} state before ringing
|
|
9935
|
+
* @event PENDING
|
|
9936
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
9937
|
+
*/
|
|
9938
|
+
PENDING: 'PENDING',
|
|
9939
|
+
|
|
9940
|
+
/**
|
|
9941
|
+
* The server trying to establish {@link Call}
|
|
9942
|
+
* @event TRYING
|
|
9943
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
9944
|
+
*/
|
|
9945
|
+
TRYING: 'TRYING'
|
|
9946
|
+
});
|
|
9863
9947
|
/**
|
|
9864
9948
|
* @namespace Flashphoner.constants.STREAM_STATUS_INFO
|
|
9865
9949
|
* @see Stream
|
|
9866
9950
|
*/
|
|
9867
9951
|
|
|
9868
|
-
var
|
|
9869
|
-
/**
|
|
9870
|
-
|
|
9871
|
-
|
|
9872
|
-
|
|
9873
|
-
|
|
9874
|
-
|
|
9875
|
-
define(streamStatusInfo, 'FAILED_BY_ICE_ERROR', 'Failed by ICE error');
|
|
9876
|
-
/**
|
|
9877
|
-
* Timeout has been reached during ICE establishment.
|
|
9878
|
-
* @event FAILED_BY_ICE_TIMEOUT
|
|
9879
|
-
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
9880
|
-
*/
|
|
9952
|
+
var STREAM_STATUS_INFO = Object.freeze({
|
|
9953
|
+
/**
|
|
9954
|
+
* Indicates general error during ICE negotiation. Usually occurs if client is behind some exotic nat/firewall.
|
|
9955
|
+
* @event FAILED_BY_ICE_ERROR
|
|
9956
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
9957
|
+
*/
|
|
9958
|
+
FAILED_BY_ICE_ERROR: 'Failed by ICE error',
|
|
9881
9959
|
|
|
9882
|
-
|
|
9883
|
-
|
|
9884
|
-
|
|
9885
|
-
|
|
9886
|
-
|
|
9887
|
-
|
|
9960
|
+
/**
|
|
9961
|
+
* Timeout has been reached during ICE establishment.
|
|
9962
|
+
* @event FAILED_BY_ICE_TIMEOUT
|
|
9963
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
9964
|
+
*/
|
|
9965
|
+
FAILED_BY_ICE_TIMEOUT: 'Failed by ICE timeout',
|
|
9888
9966
|
|
|
9889
|
-
|
|
9890
|
-
|
|
9891
|
-
|
|
9892
|
-
|
|
9893
|
-
|
|
9894
|
-
|
|
9967
|
+
/**
|
|
9968
|
+
* ICE refresh failed on session.
|
|
9969
|
+
* @event FAILED_BY_KEEP_ALIVE
|
|
9970
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
9971
|
+
*/
|
|
9972
|
+
FAILED_BY_KEEP_ALIVE: 'Failed by ICE keep alive',
|
|
9895
9973
|
|
|
9896
|
-
|
|
9897
|
-
|
|
9898
|
-
|
|
9899
|
-
|
|
9900
|
-
|
|
9901
|
-
|
|
9974
|
+
/**
|
|
9975
|
+
* DTLS has wrong fingerprint.
|
|
9976
|
+
* @event FAILED_BY_DTLS_FINGERPRINT_ERROR
|
|
9977
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
9978
|
+
*/
|
|
9979
|
+
FAILED_BY_DTLS_FINGERPRINT_ERROR: 'Failed by DTLS fingerprint error',
|
|
9902
9980
|
|
|
9903
|
-
|
|
9904
|
-
|
|
9905
|
-
|
|
9906
|
-
|
|
9907
|
-
|
|
9908
|
-
|
|
9981
|
+
/**
|
|
9982
|
+
* Client did not send DTLS packets or packets were lost/corrupted during transmission.
|
|
9983
|
+
* @event FAILED_BY_DTLS_ERROR
|
|
9984
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
9985
|
+
*/
|
|
9986
|
+
FAILED_BY_DTLS_ERROR: 'Failed by DTLS error',
|
|
9909
9987
|
|
|
9910
|
-
|
|
9911
|
-
|
|
9912
|
-
|
|
9913
|
-
|
|
9914
|
-
|
|
9915
|
-
|
|
9988
|
+
/**
|
|
9989
|
+
* Indicates general HLS packetizer error, can occur during initialization or packetization (wrong input or out of disk space).
|
|
9990
|
+
* @event FAILED_BY_HLS_WRITER_ERROR
|
|
9991
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
9992
|
+
*/
|
|
9993
|
+
FAILED_BY_HLS_WRITER_ERROR: 'Failed by HLS writer error',
|
|
9916
9994
|
|
|
9917
|
-
|
|
9918
|
-
|
|
9919
|
-
|
|
9920
|
-
|
|
9921
|
-
|
|
9922
|
-
|
|
9995
|
+
/**
|
|
9996
|
+
* Indicates general RTMP republishing error, can occur during initialization or rtmp packetization.
|
|
9997
|
+
* @event FAILED_BY_RTMP_WRITER_ERROR
|
|
9998
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
9999
|
+
*/
|
|
10000
|
+
FAILED_BY_RTMP_WRITER_ERROR: 'Failed by RTMP writer error',
|
|
9923
10001
|
|
|
9924
|
-
|
|
9925
|
-
|
|
9926
|
-
|
|
9927
|
-
|
|
9928
|
-
|
|
9929
|
-
|
|
10002
|
+
/**
|
|
10003
|
+
* RTP session failed by RTP activity timer.
|
|
10004
|
+
* @event FAILED_BY_RTP_ACTIVITY
|
|
10005
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10006
|
+
*/
|
|
10007
|
+
FAILED_BY_RTP_ACTIVITY: 'Failed by RTP activity',
|
|
9930
10008
|
|
|
9931
|
-
|
|
9932
|
-
|
|
9933
|
-
|
|
9934
|
-
|
|
9935
|
-
|
|
9936
|
-
|
|
10009
|
+
/**
|
|
10010
|
+
* Related session was disconnected.
|
|
10011
|
+
* @event STOPPED_BY_SESSION_DISCONNECT
|
|
10012
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10013
|
+
*/
|
|
10014
|
+
STOPPED_BY_SESSION_DISCONNECT: 'Stopped by session disconnect',
|
|
9937
10015
|
|
|
9938
|
-
|
|
9939
|
-
|
|
9940
|
-
|
|
9941
|
-
|
|
9942
|
-
|
|
9943
|
-
|
|
10016
|
+
/**
|
|
10017
|
+
* Stream was stopped by rest terminate request.
|
|
10018
|
+
* @event STOPPED_BY_REST_TERMINATE
|
|
10019
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10020
|
+
*/
|
|
10021
|
+
STOPPED_BY_REST_TERMINATE: 'Stopped by rest /terminate',
|
|
9944
10022
|
|
|
9945
|
-
|
|
9946
|
-
|
|
9947
|
-
|
|
9948
|
-
|
|
9949
|
-
|
|
9950
|
-
|
|
10023
|
+
/**
|
|
10024
|
+
* Related publisher stopped its stream or lost connection.
|
|
10025
|
+
* @event STOPPED_BY_PUBLISHER_STOP
|
|
10026
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10027
|
+
*/
|
|
10028
|
+
STOPPED_BY_PUBLISHER_STOP: 'Stopped by publisher stop',
|
|
9951
10029
|
|
|
9952
|
-
|
|
9953
|
-
|
|
9954
|
-
|
|
9955
|
-
|
|
9956
|
-
|
|
9957
|
-
|
|
10030
|
+
/**
|
|
10031
|
+
* Stop the media session by user after call was finished or unpublish stream.
|
|
10032
|
+
* @event STOPPED_BY_USER
|
|
10033
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10034
|
+
*/
|
|
10035
|
+
STOPPED_BY_USER: 'Stopped by user',
|
|
9958
10036
|
|
|
9959
|
-
|
|
9960
|
-
|
|
9961
|
-
|
|
9962
|
-
|
|
9963
|
-
|
|
9964
|
-
|
|
10037
|
+
/**
|
|
10038
|
+
* Error occurred on the stream.
|
|
10039
|
+
* @event FAILED_BY_ERROR
|
|
10040
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10041
|
+
*/
|
|
10042
|
+
FAILED_BY_ERROR: 'Failed by error',
|
|
9965
10043
|
|
|
9966
|
-
|
|
9967
|
-
|
|
9968
|
-
|
|
9969
|
-
|
|
9970
|
-
|
|
9971
|
-
|
|
10044
|
+
/**
|
|
10045
|
+
* Indicates that error occurred during media session creation. This might be SDP parsing error, all ports are busy, wrong session related config etc.
|
|
10046
|
+
* @event FAILED_TO_ADD_STREAM_TO_PROXY
|
|
10047
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10048
|
+
*/
|
|
10049
|
+
FAILED_TO_ADD_STREAM_TO_PROXY: 'Failed to add stream to proxy',
|
|
9972
10050
|
|
|
9973
|
-
|
|
9974
|
-
|
|
9975
|
-
|
|
9976
|
-
|
|
9977
|
-
|
|
9978
|
-
|
|
10051
|
+
/**
|
|
10052
|
+
* Stopped shapshot distributor.
|
|
10053
|
+
* @event DISTRIBUTOR_STOPPED
|
|
10054
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10055
|
+
*/
|
|
10056
|
+
DISTRIBUTOR_STOPPED: 'Distributor stopped',
|
|
9979
10057
|
|
|
9980
|
-
|
|
9981
|
-
|
|
9982
|
-
|
|
9983
|
-
|
|
9984
|
-
|
|
9985
|
-
|
|
10058
|
+
/**
|
|
10059
|
+
* Publish stream is not ready, try again later.
|
|
10060
|
+
* @event PUBLISH_STREAM_IS_NOT_READY
|
|
10061
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10062
|
+
*/
|
|
10063
|
+
PUBLISH_STREAM_IS_NOT_READY: 'Publish stream is not ready',
|
|
9986
10064
|
|
|
9987
|
-
|
|
9988
|
-
|
|
9989
|
-
|
|
9990
|
-
|
|
9991
|
-
|
|
9992
|
-
|
|
10065
|
+
/**
|
|
10066
|
+
* Stream with this name is not found, check the correct of the name.
|
|
10067
|
+
* @event STREAM_NOT_FOUND
|
|
10068
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10069
|
+
*/
|
|
10070
|
+
STREAM_NOT_FOUND: 'Stream not found',
|
|
9993
10071
|
|
|
9994
|
-
|
|
9995
|
-
|
|
9996
|
-
|
|
9997
|
-
|
|
9998
|
-
|
|
9999
|
-
|
|
10072
|
+
/**
|
|
10073
|
+
* Server already has a publish stream with the same name, try using different one.
|
|
10074
|
+
* @event STREAM_NAME_ALREADY_IN_USE
|
|
10075
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10076
|
+
*/
|
|
10077
|
+
STREAM_NAME_ALREADY_IN_USE: 'Stream name is already in use',
|
|
10000
10078
|
|
|
10001
|
-
|
|
10002
|
-
|
|
10003
|
-
|
|
10004
|
-
|
|
10005
|
-
|
|
10006
|
-
|
|
10079
|
+
/**
|
|
10080
|
+
* Error indicates that stream object received by server has empty mediaSessionId field.
|
|
10081
|
+
* @event MEDIASESSION_ID_NULL
|
|
10082
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10083
|
+
*/
|
|
10084
|
+
MEDIASESSION_ID_NULL: 'MediaSessionId is null',
|
|
10007
10085
|
|
|
10008
|
-
|
|
10009
|
-
|
|
10010
|
-
|
|
10011
|
-
|
|
10012
|
-
|
|
10013
|
-
|
|
10086
|
+
/**
|
|
10087
|
+
* Published or subscribed sessions used this MediaSessionId.
|
|
10088
|
+
* @event MEDIASESSION_ID_ALREADY_IN_USE
|
|
10089
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10090
|
+
*/
|
|
10091
|
+
MEDIASESSION_ID_ALREADY_IN_USE: 'MediaSessionId is already in use',
|
|
10014
10092
|
|
|
10015
|
-
|
|
10016
|
-
|
|
10017
|
-
|
|
10018
|
-
|
|
10019
|
-
|
|
10020
|
-
|
|
10093
|
+
/**
|
|
10094
|
+
* Session is not initialized or terminated on play ordinary stream.
|
|
10095
|
+
* @event SESSION_NOT_READY
|
|
10096
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10097
|
+
*/
|
|
10098
|
+
SESSION_NOT_READY: 'Session not ready',
|
|
10021
10099
|
|
|
10022
|
-
|
|
10023
|
-
|
|
10024
|
-
|
|
10025
|
-
|
|
10026
|
-
|
|
10027
|
-
|
|
10100
|
+
/**
|
|
10101
|
+
* Actual session does not exist.
|
|
10102
|
+
* @event SESSION_DOES_NOT_EXIST
|
|
10103
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10104
|
+
*/
|
|
10105
|
+
SESSION_DOES_NOT_EXIST: 'Session does not exist',
|
|
10028
10106
|
|
|
10029
|
-
|
|
10030
|
-
|
|
10031
|
-
|
|
10032
|
-
|
|
10033
|
-
|
|
10034
|
-
|
|
10107
|
+
/**
|
|
10108
|
+
* RTSP has wrong format on play stream, check the RTSP url validity.
|
|
10109
|
+
* @event RTSP_HAS_WRONG_FORMAT
|
|
10110
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10111
|
+
*/
|
|
10112
|
+
RTSP_HAS_WRONG_FORMAT: 'Rtsp has wrong format',
|
|
10035
10113
|
|
|
10036
|
-
|
|
10037
|
-
|
|
10038
|
-
|
|
10039
|
-
|
|
10040
|
-
|
|
10041
|
-
|
|
10114
|
+
/**
|
|
10115
|
+
* Failed to play vod stream, this format is not supported.
|
|
10116
|
+
* @event FILE_HAS_WRONG_FORMAT
|
|
10117
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10118
|
+
*/
|
|
10119
|
+
FILE_HAS_WRONG_FORMAT: 'File has wrong format',
|
|
10042
10120
|
|
|
10043
|
-
|
|
10044
|
-
|
|
10045
|
-
|
|
10046
|
-
|
|
10047
|
-
|
|
10048
|
-
|
|
10121
|
+
/**
|
|
10122
|
+
* Failed to connect to rtsp stream.
|
|
10123
|
+
* @event FAILED_TO_CONNECT_TO_RTSP_STREAM
|
|
10124
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10125
|
+
*/
|
|
10126
|
+
FAILED_TO_CONNECT_TO_RTSP_STREAM: 'Failed to connect to rtsp stream',
|
|
10049
10127
|
|
|
10050
|
-
|
|
10051
|
-
|
|
10052
|
-
|
|
10053
|
-
|
|
10054
|
-
|
|
10055
|
-
|
|
10128
|
+
/**
|
|
10129
|
+
* Rtsp stream is not found, agent received "404-Not Found".
|
|
10130
|
+
* @event RTSP_STREAM_NOT_FOUND
|
|
10131
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10132
|
+
*/
|
|
10133
|
+
RTSP_STREAM_NOT_FOUND: 'Rtsp stream not found',
|
|
10056
10134
|
|
|
10057
|
-
|
|
10058
|
-
|
|
10059
|
-
|
|
10060
|
-
|
|
10061
|
-
|
|
10062
|
-
|
|
10135
|
+
/**
|
|
10136
|
+
* On shutdown RTSP agent.
|
|
10137
|
+
* @event RTSPAGENT_SHUTDOWN
|
|
10138
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10139
|
+
*/
|
|
10140
|
+
RTSPAGENT_SHUTDOWN: 'RtspAgent shutdown',
|
|
10063
10141
|
|
|
10064
|
-
|
|
10065
|
-
|
|
10066
|
-
|
|
10067
|
-
|
|
10068
|
-
|
|
10069
|
-
|
|
10142
|
+
/**
|
|
10143
|
+
* Stream failed
|
|
10144
|
+
* @event STREAM_FAILED
|
|
10145
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10146
|
+
*/
|
|
10147
|
+
STREAM_FAILED: 'Stream failed',
|
|
10070
10148
|
|
|
10071
|
-
|
|
10072
|
-
|
|
10073
|
-
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
|
-
|
|
10149
|
+
/**
|
|
10150
|
+
* No common codecs on setup track, did not found corresponding trackId->mediaPort.
|
|
10151
|
+
* @event NO_COMMON_CODECS
|
|
10152
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10153
|
+
*/
|
|
10154
|
+
NO_COMMON_CODECS: 'No common codecs',
|
|
10077
10155
|
|
|
10078
|
-
|
|
10079
|
-
|
|
10080
|
-
|
|
10081
|
-
|
|
10082
|
-
|
|
10083
|
-
|
|
10156
|
+
/**
|
|
10157
|
+
* Bad referenced rtsp link, check for correct, example: rtsp://user:b@d_password@127.0.0.1/stream.
|
|
10158
|
+
* @event BAD_URI
|
|
10159
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10160
|
+
*/
|
|
10161
|
+
BAD_URI: 'Bad URI',
|
|
10084
10162
|
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
|
|
10163
|
+
/**
|
|
10164
|
+
* General VOD error, indicates that Exception occurred while reading/processing media file.
|
|
10165
|
+
* @event GOT_EXCEPTION_WHILE_STREAMING_FILE
|
|
10166
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10167
|
+
*/
|
|
10168
|
+
GOT_EXCEPTION_WHILE_STREAMING_FILE: 'Got exception while streaming file',
|
|
10091
10169
|
|
|
10092
|
-
|
|
10093
|
-
|
|
10094
|
-
|
|
10095
|
-
|
|
10096
|
-
|
|
10097
|
-
|
|
10170
|
+
/**
|
|
10171
|
+
* Requested stream shutdown.
|
|
10172
|
+
* @event REQUESTED_STREAM_SHUTDOWN
|
|
10173
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10174
|
+
*/
|
|
10175
|
+
REQUESTED_STREAM_SHUTDOWN: 'Requested stream shutdown',
|
|
10098
10176
|
|
|
10099
|
-
|
|
10100
|
-
|
|
10101
|
-
|
|
10102
|
-
|
|
10103
|
-
|
|
10104
|
-
|
|
10177
|
+
/**
|
|
10178
|
+
* Failed to create movie, file can not be read.
|
|
10179
|
+
* @event FAILED_TO_READ_FILE
|
|
10180
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10181
|
+
*/
|
|
10182
|
+
FAILED_TO_READ_FILE: 'Failed to read file',
|
|
10105
10183
|
|
|
10106
|
-
|
|
10107
|
-
|
|
10108
|
-
|
|
10109
|
-
|
|
10110
|
-
|
|
10111
|
-
|
|
10184
|
+
/**
|
|
10185
|
+
* File does not exist, check filename.
|
|
10186
|
+
* @event FILE_NOT_FOUND
|
|
10187
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10188
|
+
*/
|
|
10189
|
+
FILE_NOT_FOUND: 'File not found',
|
|
10112
10190
|
|
|
10113
|
-
|
|
10114
|
-
|
|
10115
|
-
|
|
10116
|
-
|
|
10117
|
-
|
|
10118
|
-
|
|
10191
|
+
/**
|
|
10192
|
+
* Server failed to establish websocket connection with origin server.
|
|
10193
|
+
* @event FAILED_TO_CONNECT_TO_ORIGIN_STREAM
|
|
10194
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10195
|
+
*/
|
|
10196
|
+
FAILED_TO_CONNECT_TO_ORIGIN_STREAM: 'Failed to connect to origin stream',
|
|
10119
10197
|
|
|
10120
|
-
|
|
10121
|
-
|
|
10122
|
-
|
|
10123
|
-
|
|
10124
|
-
|
|
10125
|
-
|
|
10126
|
-
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10127
|
-
*/
|
|
10198
|
+
/**
|
|
10199
|
+
* CDN stream not found.
|
|
10200
|
+
* @event CDN_STREAM_NOT_FOUND
|
|
10201
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10202
|
+
*/
|
|
10203
|
+
CDN_STREAM_NOT_FOUND: 'CDN stream not found',
|
|
10128
10204
|
|
|
10129
|
-
|
|
10130
|
-
|
|
10131
|
-
|
|
10132
|
-
|
|
10133
|
-
|
|
10134
|
-
|
|
10205
|
+
/**
|
|
10206
|
+
* Indicates that provided URL protocol in stream name is invalid.
|
|
10207
|
+
* Valid: vod://file.mp4
|
|
10208
|
+
* Invalid: dov://file.mp4
|
|
10209
|
+
* @event FAILED_TO_GET_AGENT_STORAGE
|
|
10210
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10211
|
+
*/
|
|
10212
|
+
FAILED_TO_GET_AGENT_STORAGE: 'Failed to get agent storage',
|
|
10135
10213
|
|
|
10136
|
-
|
|
10137
|
-
|
|
10138
|
-
|
|
10139
|
-
|
|
10140
|
-
|
|
10141
|
-
|
|
10214
|
+
/**
|
|
10215
|
+
* Shutdown agent servicing origin stream.
|
|
10216
|
+
* @event AGENT_SERVICING_ORIGIN_STREAM_IS_SHUTTING_DOWN
|
|
10217
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10218
|
+
*/
|
|
10219
|
+
AGENT_SERVICING_ORIGIN_STREAM_IS_SHUTTING_DOWN: 'Agent servicing origin stream is shutting down',
|
|
10142
10220
|
|
|
10143
|
-
|
|
10144
|
-
|
|
10145
|
-
|
|
10146
|
-
|
|
10147
|
-
|
|
10148
|
-
|
|
10221
|
+
/**
|
|
10222
|
+
* Terminated by keep-alive on walk through subscribers.
|
|
10223
|
+
* @event TERMINATED_BY_KEEP_ALIVE
|
|
10224
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10225
|
+
*/
|
|
10226
|
+
TERMINATED_BY_KEEP_ALIVE: 'Terminated by keep-alive',
|
|
10149
10227
|
|
|
10150
|
-
|
|
10151
|
-
|
|
10152
|
-
|
|
10153
|
-
|
|
10154
|
-
|
|
10155
|
-
|
|
10228
|
+
/**
|
|
10229
|
+
* Transcoding required, but disabled in server settings
|
|
10230
|
+
* @event TRANSCODING_REQUIRED_BUT_DISABLED
|
|
10231
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10232
|
+
*/
|
|
10233
|
+
TRANSCODING_REQUIRED_BUT_DISABLED: 'Transcoding required, but disabled',
|
|
10156
10234
|
|
|
10157
|
-
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
|
|
10161
|
-
|
|
10162
|
-
|
|
10235
|
+
/**
|
|
10236
|
+
* Access restricted by access list
|
|
10237
|
+
* @event RESTRICTED_ACCESS
|
|
10238
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10239
|
+
*/
|
|
10240
|
+
RESTRICTED_ACCESS: 'Restricted access',
|
|
10163
10241
|
|
|
10164
|
-
|
|
10242
|
+
/**
|
|
10243
|
+
* No available transcoders for stream
|
|
10244
|
+
* @event NO_AVAILABLE_TRANSCODERS
|
|
10245
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
10246
|
+
*/
|
|
10247
|
+
NO_AVAILABLE_TRANSCODERS: 'No available transcoders'
|
|
10248
|
+
});
|
|
10165
10249
|
/**
|
|
10166
10250
|
* @namespace Flashphoner.constants.CALL_STATUS_INFO
|
|
10167
10251
|
* @see Call
|
|
10168
10252
|
*/
|
|
10169
10253
|
|
|
10170
|
-
var
|
|
10171
|
-
/**
|
|
10172
|
-
|
|
10173
|
-
|
|
10174
|
-
|
|
10175
|
-
|
|
10254
|
+
var CALL_STATUS_INFO = Object.freeze({
|
|
10255
|
+
/**
|
|
10256
|
+
* Normal call hangup.
|
|
10257
|
+
* @event NORMAL_CALL_CLEARING
|
|
10258
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
10259
|
+
*/
|
|
10260
|
+
NORMAL_CALL_CLEARING: 'Normal call clearing',
|
|
10176
10261
|
|
|
10177
|
-
|
|
10178
|
-
|
|
10179
|
-
|
|
10180
|
-
|
|
10181
|
-
|
|
10182
|
-
|
|
10262
|
+
/**
|
|
10263
|
+
* Error occurred while creating a session
|
|
10264
|
+
* @event FAILED_BY_SESSION_CREATION
|
|
10265
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
10266
|
+
*/
|
|
10267
|
+
FAILED_BY_SESSION_CREATION: 'Failed by session creation',
|
|
10183
10268
|
|
|
10184
|
-
|
|
10185
|
-
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
|
|
10189
|
-
|
|
10269
|
+
/**
|
|
10270
|
+
* Failed by error during ICE establishment.
|
|
10271
|
+
* @event FAILED_BY_ICE_ERROR
|
|
10272
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
10273
|
+
*/
|
|
10274
|
+
FAILED_BY_ICE_ERROR: 'Failed by ICE error',
|
|
10190
10275
|
|
|
10191
|
-
|
|
10192
|
-
|
|
10193
|
-
|
|
10194
|
-
|
|
10195
|
-
|
|
10196
|
-
|
|
10276
|
+
/**
|
|
10277
|
+
* RTP session failed by RTP activity timer.
|
|
10278
|
+
* @event FAILED_BY_RTP_ACTIVITY
|
|
10279
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
10280
|
+
*/
|
|
10281
|
+
FAILED_BY_RTP_ACTIVITY: 'Failed by RTP activity',
|
|
10197
10282
|
|
|
10198
|
-
|
|
10199
|
-
|
|
10200
|
-
|
|
10201
|
-
|
|
10202
|
-
|
|
10203
|
-
|
|
10283
|
+
/**
|
|
10284
|
+
* FF writer was failed on RTMP.
|
|
10285
|
+
* @event FAILED_BY_RTMP_WRITER_ERROR
|
|
10286
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
10287
|
+
*/
|
|
10288
|
+
FAILED_BY_RTMP_WRITER_ERROR: 'Failed by RTMP writer error',
|
|
10204
10289
|
|
|
10205
|
-
|
|
10206
|
-
|
|
10207
|
-
|
|
10208
|
-
|
|
10209
|
-
|
|
10210
|
-
|
|
10290
|
+
/**
|
|
10291
|
+
* DTLS wrong fingerprint.
|
|
10292
|
+
* @event FAILED_BY_DTLS_FINGERPRINT_ERROR
|
|
10293
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
10294
|
+
*/
|
|
10295
|
+
FAILED_BY_DTLS_FINGERPRINT_ERROR: 'Failed by DTLS fingerprint error',
|
|
10211
10296
|
|
|
10212
|
-
|
|
10213
|
-
|
|
10214
|
-
|
|
10215
|
-
|
|
10216
|
-
|
|
10217
|
-
|
|
10297
|
+
/**
|
|
10298
|
+
* No common codecs in sdp
|
|
10299
|
+
* @event NO_COMMON_CODECS
|
|
10300
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
10301
|
+
*/
|
|
10302
|
+
NO_COMMON_CODECS: 'No common codecs',
|
|
10218
10303
|
|
|
10219
|
-
|
|
10220
|
-
|
|
10221
|
-
|
|
10222
|
-
|
|
10223
|
-
|
|
10224
|
-
|
|
10304
|
+
/**
|
|
10305
|
+
* Client did not send DTLS packets or packets were lost/corrupted during transmission.
|
|
10306
|
+
* @event FAILED_BY_DTLS_ERROR
|
|
10307
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
10308
|
+
*/
|
|
10309
|
+
FAILED_BY_DTLS_ERROR: 'Failed by DTLS error',
|
|
10225
10310
|
|
|
10226
|
-
|
|
10227
|
-
|
|
10228
|
-
|
|
10229
|
-
|
|
10230
|
-
|
|
10231
|
-
|
|
10311
|
+
/**
|
|
10312
|
+
* Error occurred during the call
|
|
10313
|
+
* @event FAILED_BY_ERROR
|
|
10314
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
10315
|
+
*/
|
|
10316
|
+
FAILED_BY_ERROR: 'Failed by error',
|
|
10317
|
+
|
|
10318
|
+
/**
|
|
10319
|
+
* Call failed by request timeout
|
|
10320
|
+
* @event FAILED_BY_REQUEST_TIMEOUT
|
|
10321
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
10322
|
+
*/
|
|
10323
|
+
FAILED_BY_REQUEST_TIMEOUT: 'Failed by request timeout',
|
|
10232
10324
|
|
|
10233
|
-
|
|
10325
|
+
/**
|
|
10326
|
+
* Transcoding required, but disabled in settings
|
|
10327
|
+
* @event TRANSCODING_REQUIRED_BUT_DISABLED
|
|
10328
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
10329
|
+
*/
|
|
10330
|
+
TRANSCODING_REQUIRED_BUT_DISABLED: 'Transcoding required, but disabled'
|
|
10331
|
+
});
|
|
10234
10332
|
/**
|
|
10235
|
-
|
|
10236
|
-
|
|
10237
|
-
|
|
10238
|
-
|
|
10333
|
+
* @namespace Flashphoner.constants.ERROR_INFO
|
|
10334
|
+
*/
|
|
10335
|
+
|
|
10336
|
+
var ERROR_INFO = Object.freeze({
|
|
10337
|
+
/**
|
|
10338
|
+
* Error if none of MediaProviders available
|
|
10339
|
+
* @event NONE_OF_MEDIAPROVIDERS_AVAILABLE
|
|
10340
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
10341
|
+
*/
|
|
10342
|
+
NONE_OF_MEDIAPROVIDERS_AVAILABLE: 'None of MediaProviders available',
|
|
10343
|
+
|
|
10344
|
+
/**
|
|
10345
|
+
* Error if none of preferred MediaProviders available
|
|
10346
|
+
* @event NONE_OF_PREFERRED_MEDIAPROVIDERS_AVAILABLE
|
|
10347
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
10348
|
+
*/
|
|
10349
|
+
NONE_OF_PREFERRED_MEDIAPROVIDERS_AVAILABLE: 'None of preferred MediaProviders available',
|
|
10239
10350
|
|
|
10240
|
-
|
|
10351
|
+
/**
|
|
10352
|
+
* Error if API is not initialized
|
|
10353
|
+
* @event FLASHPHONER_API_NOT_INITIALIZED
|
|
10354
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
10355
|
+
*/
|
|
10356
|
+
FLASHPHONER_API_NOT_INITIALIZED: 'Flashphoner API is not initialized',
|
|
10357
|
+
|
|
10358
|
+
/**
|
|
10359
|
+
* Error if options.urlServer is not specified
|
|
10360
|
+
* @event OPTIONS_URLSERVER_MUST_BE_PROVIDED
|
|
10361
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
10362
|
+
*/
|
|
10363
|
+
OPTIONS_URLSERVER_MUST_BE_PROVIDED: 'options.urlServer must be provided',
|
|
10364
|
+
|
|
10365
|
+
/**
|
|
10366
|
+
* Error if session state is not valid
|
|
10367
|
+
* @event INVALID_SESSION_STATE
|
|
10368
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
10369
|
+
*/
|
|
10370
|
+
INVALID_SESSION_STATE: 'Invalid session state',
|
|
10371
|
+
|
|
10372
|
+
/**
|
|
10373
|
+
* Error if no options provided
|
|
10374
|
+
* @event OPTIONS_MUST_BE_PROVIDED
|
|
10375
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
10376
|
+
*/
|
|
10377
|
+
OPTIONS_MUST_BE_PROVIDED: 'options must be provided',
|
|
10378
|
+
|
|
10379
|
+
/**
|
|
10380
|
+
* Error if call status is not {@link Flashphoner.constants.CALL_STATUS.NEW}
|
|
10381
|
+
* @event INVALID_CALL_STATE
|
|
10382
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
10383
|
+
*/
|
|
10384
|
+
INVALID_CALL_STATE: 'Invalid call state',
|
|
10385
|
+
|
|
10386
|
+
/**
|
|
10387
|
+
* Error if event is not specified
|
|
10388
|
+
* @event EVENT_CANT_BE_NULL
|
|
10389
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
10390
|
+
*/
|
|
10391
|
+
EVENT_CANT_BE_NULL: 'Event can\'t be null',
|
|
10392
|
+
|
|
10393
|
+
/**
|
|
10394
|
+
* Error if callback is not a valid function
|
|
10395
|
+
* @event CALLBACK_NEEDS_TO_BE_A_VALID_FUNCTION
|
|
10396
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
10397
|
+
*/
|
|
10398
|
+
CALLBACK_NEEDS_TO_BE_A_VALID_FUNCTION: 'Callback needs to be a valid function',
|
|
10399
|
+
|
|
10400
|
+
/**
|
|
10401
|
+
* Error if options.name is not specified
|
|
10402
|
+
* @event OPTIONS_NAME_MUST_BE_PROVIDED
|
|
10403
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
10404
|
+
*/
|
|
10405
|
+
OPTIONS_NAME_MUST_BE_PROVIDED: 'options.name must be provided',
|
|
10406
|
+
|
|
10407
|
+
/**
|
|
10408
|
+
* Error if number of cams is less than 2 or camera is already used by other application
|
|
10409
|
+
* @event CAN_NOT_SWITCH_CAM
|
|
10410
|
+
* @memberOf Flashphoner.constants.ERROR_INFO
|
|
10411
|
+
*/
|
|
10412
|
+
CAN_NOT_SWITCH_CAM: 'Number of cams is less than 2 or camera is already used by other application',
|
|
10413
|
+
|
|
10414
|
+
/**
|
|
10415
|
+
* Error if number of mics is less than 2 or microphone is already used by other application
|
|
10416
|
+
* @event CAN_NOT_SWITCH_MIC
|
|
10417
|
+
* @memberOf Flashphoner.constants.ERROR_INFO
|
|
10418
|
+
*/
|
|
10419
|
+
CAN_NOT_SWITCH_MIC: 'Number of mics is less than 2 or microphone is already used by other application',
|
|
10420
|
+
|
|
10421
|
+
/**
|
|
10422
|
+
* Local browser error detected
|
|
10423
|
+
* @event LOCAL_ERROR
|
|
10424
|
+
* @memberOf Flashphoner.constants.ERROR_INFO
|
|
10425
|
+
*/
|
|
10426
|
+
LOCAL_ERROR: 'Local error'
|
|
10427
|
+
});
|
|
10241
10428
|
/**
|
|
10242
|
-
*
|
|
10243
|
-
* @
|
|
10244
|
-
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
10429
|
+
* Local media devices type
|
|
10430
|
+
* @namespace Flashphoner.constants.MEDIA_DEVICE_KIND
|
|
10245
10431
|
*/
|
|
10246
10432
|
|
|
10247
|
-
|
|
10248
|
-
/**
|
|
10249
|
-
*
|
|
10250
|
-
|
|
10433
|
+
var MEDIA_DEVICE_KIND = Object.freeze({
|
|
10434
|
+
/**
|
|
10435
|
+
* List local media output devices
|
|
10436
|
+
* @see Flashphoner.getMediaDevices
|
|
10437
|
+
* @memberOf Flashphoner.constants.MEDIA_DEVICE_KIND
|
|
10438
|
+
*/
|
|
10439
|
+
OUTPUT: 'output',
|
|
10251
10440
|
|
|
10252
|
-
|
|
10441
|
+
/**
|
|
10442
|
+
* List local media input devices
|
|
10443
|
+
* @see Flashphoner.getMediaDevices
|
|
10444
|
+
* @memberOf Flashphoner.constants.MEDIA_DEVICE_KIND
|
|
10445
|
+
*/
|
|
10446
|
+
INPUT: 'input',
|
|
10447
|
+
|
|
10448
|
+
/**
|
|
10449
|
+
* List local media devices
|
|
10450
|
+
* @see Flashphoner.getMediaDevices
|
|
10451
|
+
* @memberOf Flashphoner.constants.MEDIA_DEVICE_KIND
|
|
10452
|
+
*/
|
|
10453
|
+
ALL: 'all'
|
|
10454
|
+
});
|
|
10253
10455
|
/**
|
|
10254
|
-
*
|
|
10255
|
-
* @
|
|
10256
|
-
* @memberof Flashphoner.constants.ERROR_INFO
|
|
10456
|
+
* WebRTC transport type
|
|
10457
|
+
* @namespace Flashphoner.constants.TRANSPORT_TYPE
|
|
10257
10458
|
*/
|
|
10258
10459
|
|
|
10259
|
-
|
|
10460
|
+
var TRANSPORT_TYPE = Object.freeze({
|
|
10461
|
+
/**
|
|
10462
|
+
* WebRTC RTP traffic goes over UDP (default)
|
|
10463
|
+
* @see Stream
|
|
10464
|
+
* @memberOf Flashphoner.constants.TRANSPORT_TYPE
|
|
10465
|
+
*/
|
|
10466
|
+
UDP: 'UDP',
|
|
10467
|
+
|
|
10468
|
+
/**
|
|
10469
|
+
* WebRTC RTP traffic goes over TCP
|
|
10470
|
+
* @see Stream
|
|
10471
|
+
* @memberOf Flashphoner.constants.TRANSPORT_TYPE
|
|
10472
|
+
*/
|
|
10473
|
+
TCP: 'TCP'
|
|
10474
|
+
});
|
|
10260
10475
|
/**
|
|
10261
|
-
*
|
|
10262
|
-
* @
|
|
10263
|
-
* @memberof Flashphoner.constants.ERROR_INFO
|
|
10476
|
+
* WebRTC connection quality type
|
|
10477
|
+
* @namespace Flashphoner.constants.CONNECTION_QUALITY
|
|
10264
10478
|
*/
|
|
10265
10479
|
|
|
10266
|
-
|
|
10267
|
-
/**
|
|
10268
|
-
|
|
10269
|
-
|
|
10270
|
-
|
|
10271
|
-
|
|
10480
|
+
var CONNECTION_QUALITY = Object.freeze({
|
|
10481
|
+
/**
|
|
10482
|
+
* Channel bandwidth is perfect
|
|
10483
|
+
* @see Stream
|
|
10484
|
+
* @memberOf Flashphoner.constants.CONNECTION_QUALITY
|
|
10485
|
+
*/
|
|
10486
|
+
PERFECT: 'PERFECT',
|
|
10272
10487
|
|
|
10273
|
-
|
|
10274
|
-
|
|
10275
|
-
|
|
10276
|
-
|
|
10277
|
-
|
|
10278
|
-
|
|
10488
|
+
/**
|
|
10489
|
+
* Channel bandwidth is good
|
|
10490
|
+
* @see Stream
|
|
10491
|
+
* @memberOf Flashphoner.constants.CONNECTION_QUALITY
|
|
10492
|
+
*/
|
|
10493
|
+
GOOD: 'GOOD',
|
|
10279
10494
|
|
|
10280
|
-
|
|
10281
|
-
|
|
10282
|
-
|
|
10283
|
-
|
|
10284
|
-
|
|
10285
|
-
|
|
10495
|
+
/**
|
|
10496
|
+
* Channel bandwidth is bad
|
|
10497
|
+
* @see Stream
|
|
10498
|
+
* @memberOf Flashphoner.constants.CONNECTION_QUALITY
|
|
10499
|
+
*/
|
|
10500
|
+
BAD: 'BAD',
|
|
10286
10501
|
|
|
10287
|
-
|
|
10288
|
-
|
|
10289
|
-
|
|
10290
|
-
|
|
10291
|
-
|
|
10292
|
-
|
|
10502
|
+
/**
|
|
10503
|
+
* Channel bandwidth is unknown (initial state)
|
|
10504
|
+
* @see Stream
|
|
10505
|
+
* @memberOf Flashphoner.constants.CONNECTION_QUALITY
|
|
10506
|
+
*/
|
|
10507
|
+
UNKNOWN: 'UNKNOWN',
|
|
10293
10508
|
|
|
10294
|
-
|
|
10509
|
+
/**
|
|
10510
|
+
* Channel bandwidth is updating
|
|
10511
|
+
* @see Stream
|
|
10512
|
+
* @memberOf Flashphoner.constants.CONNECTION_QUALITY
|
|
10513
|
+
*/
|
|
10514
|
+
UPDATE: 'UPDATE'
|
|
10515
|
+
});
|
|
10295
10516
|
/**
|
|
10296
|
-
*
|
|
10297
|
-
* @
|
|
10298
|
-
* @
|
|
10517
|
+
* Websocket signaling stream event
|
|
10518
|
+
* @see Stream
|
|
10519
|
+
* @memberOf Flashphoner.constants
|
|
10299
10520
|
*/
|
|
10300
10521
|
|
|
10301
|
-
|
|
10522
|
+
var STREAM_EVENT = 'STREAM_EVENT';
|
|
10302
10523
|
/**
|
|
10303
|
-
*
|
|
10304
|
-
* @
|
|
10305
|
-
* @memberof Flashphoner.constants.ERROR_INFO
|
|
10524
|
+
* Websocket signaling stream event type
|
|
10525
|
+
* @namespace Flashphoner.constants.STREAM_EVENT_TYPE
|
|
10306
10526
|
*/
|
|
10307
10527
|
|
|
10308
|
-
|
|
10309
|
-
/**
|
|
10310
|
-
|
|
10311
|
-
|
|
10312
|
-
|
|
10313
|
-
|
|
10528
|
+
var STREAM_EVENT_TYPE = Object.freeze({
|
|
10529
|
+
/**
|
|
10530
|
+
* Stream audio is muted
|
|
10531
|
+
* @see Stream
|
|
10532
|
+
* @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
|
|
10533
|
+
*/
|
|
10534
|
+
AUDIO_MUTED: 'audioMuted',
|
|
10314
10535
|
|
|
10315
|
-
|
|
10316
|
-
|
|
10317
|
-
|
|
10318
|
-
|
|
10319
|
-
|
|
10320
|
-
|
|
10536
|
+
/**
|
|
10537
|
+
* Stream audio is unmuted
|
|
10538
|
+
* @see Stream
|
|
10539
|
+
* @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
|
|
10540
|
+
*/
|
|
10541
|
+
AUDIO_UNMUTED: 'audioUnmuted',
|
|
10321
10542
|
|
|
10322
|
-
|
|
10323
|
-
|
|
10324
|
-
|
|
10325
|
-
|
|
10326
|
-
|
|
10327
|
-
|
|
10543
|
+
/**
|
|
10544
|
+
* Stream video is muted
|
|
10545
|
+
* @see Stream
|
|
10546
|
+
* @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
|
|
10547
|
+
*/
|
|
10548
|
+
VIDEO_MUTED: 'videoMuted',
|
|
10328
10549
|
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
|
|
10333
|
-
|
|
10334
|
-
|
|
10550
|
+
/**
|
|
10551
|
+
* Stream videoo is unmuted
|
|
10552
|
+
* @see Stream
|
|
10553
|
+
* @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
|
|
10554
|
+
*/
|
|
10555
|
+
VIDEO_UNMUTED: 'videoUnmuted',
|
|
10335
10556
|
|
|
10336
|
-
|
|
10557
|
+
/**
|
|
10558
|
+
* Data bound to the stream are received
|
|
10559
|
+
* @see Stream
|
|
10560
|
+
* @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
|
|
10561
|
+
*/
|
|
10562
|
+
DATA: 'data'
|
|
10563
|
+
});
|
|
10337
10564
|
/**
|
|
10338
|
-
*
|
|
10339
|
-
* @
|
|
10340
|
-
* @memberOf Flashphoner.constants.ERROR_INFO
|
|
10565
|
+
* WebRTC video content hint type
|
|
10566
|
+
* @namespace Flashphoner.constants.CONTENT_HINT_TYPE
|
|
10341
10567
|
*/
|
|
10342
10568
|
|
|
10343
|
-
|
|
10344
|
-
/**
|
|
10345
|
-
|
|
10346
|
-
|
|
10347
|
-
|
|
10348
|
-
|
|
10569
|
+
var CONTENT_HINT_TYPE = Object.freeze({
|
|
10570
|
+
/**
|
|
10571
|
+
* Video content is motion (webcam case): keep FPS, resolution and bitrate may change
|
|
10572
|
+
* @see Stream
|
|
10573
|
+
* @memberOf Flashphoner.constants.CONTENT_HINT_TYPE
|
|
10574
|
+
*/
|
|
10575
|
+
MOTION: 'motion',
|
|
10349
10576
|
|
|
10350
|
-
|
|
10351
|
-
|
|
10352
|
-
|
|
10353
|
-
|
|
10354
|
-
|
|
10355
|
-
|
|
10356
|
-
define(transportType, 'UDP', 'UDP');
|
|
10357
|
-
define(transportType, 'TCP', 'TCP');
|
|
10358
|
-
var connectionQuality = {};
|
|
10359
|
-
define(connectionQuality, 'PERFECT', 'PERFECT');
|
|
10360
|
-
define(connectionQuality, 'GOOD', 'GOOD');
|
|
10361
|
-
define(connectionQuality, 'BAD', 'BAD');
|
|
10362
|
-
define(connectionQuality, 'UNKNOWN', 'UNKNOWN');
|
|
10363
|
-
define(connectionQuality, 'UPDATE', 'UPDATE');
|
|
10364
|
-
var streamEventType = {};
|
|
10365
|
-
define(streamEventType, 'AUDIO_MUTED', 'audioMuted');
|
|
10366
|
-
define(streamEventType, 'AUDIO_UNMUTED', 'audioUnmuted');
|
|
10367
|
-
define(streamEventType, 'VIDEO_MUTED', 'videoMuted');
|
|
10368
|
-
define(streamEventType, 'VIDEO_UNMUTED', 'videoUnmuted');
|
|
10369
|
-
define(streamEventType, 'DATA', 'data');
|
|
10370
|
-
var contentHintType = {};
|
|
10371
|
-
define(contentHintType, 'MOTION', 'motion');
|
|
10372
|
-
define(contentHintType, 'DETAIL', 'detail');
|
|
10373
|
-
define(contentHintType, 'TEXT', 'text');
|
|
10374
|
-
var constants = {};
|
|
10375
|
-
define(constants, 'SESSION_STATUS', sessionStatus);
|
|
10376
|
-
define(constants, 'STREAM_EVENT_TYPE', streamEventType);
|
|
10377
|
-
define(constants, 'STREAM_EVENT', 'STREAM_EVENT');
|
|
10378
|
-
define(constants, 'STREAM_STATUS', streamStatus);
|
|
10379
|
-
define(constants, 'CALL_STATUS', callStatus);
|
|
10380
|
-
define(constants, 'STREAM_STATUS_INFO', streamStatusInfo);
|
|
10381
|
-
define(constants, 'CALL_STATUS_INFO', callStatusInfo);
|
|
10382
|
-
define(constants, 'ERROR_INFO', errorInfo);
|
|
10383
|
-
define(constants, 'MEDIA_DEVICE_KIND', mediaDeviceKind);
|
|
10384
|
-
define(constants, 'TRANSPORT_TYPE', transportType);
|
|
10385
|
-
define(constants, 'CONNECTION_QUALITY', connectionQuality);
|
|
10386
|
-
define(constants, 'CONTENT_HINT_TYPE', contentHintType); //define helper
|
|
10387
|
-
|
|
10388
|
-
function define(obj, name, value) {
|
|
10389
|
-
Object.defineProperty(obj, name, {
|
|
10390
|
-
value: value,
|
|
10391
|
-
enumerable: true
|
|
10392
|
-
});
|
|
10393
|
-
}
|
|
10577
|
+
/**
|
|
10578
|
+
* Video content is detail (sreen sharing case): keep resolution, bitrate may change, FPS may drop
|
|
10579
|
+
* @see Stream
|
|
10580
|
+
* @memberOf Flashphoner.constants.CONTENT_HINT_TYPE
|
|
10581
|
+
*/
|
|
10582
|
+
DETAIL: 'detail',
|
|
10394
10583
|
|
|
10395
|
-
|
|
10584
|
+
/**
|
|
10585
|
+
* Video content is text (sreen sharing case): keep resolution and bitrate, FPS may drop
|
|
10586
|
+
* @see Stream
|
|
10587
|
+
* @memberOf Flashphoner.constants.CONTENT_HINT_TYPE
|
|
10588
|
+
*/
|
|
10589
|
+
TEXT: 'text'
|
|
10590
|
+
});
|
|
10591
|
+
module.exports = {
|
|
10592
|
+
SESSION_STATUS: SESSION_STATUS,
|
|
10593
|
+
STREAM_STATUS: STREAM_STATUS,
|
|
10594
|
+
CALL_STATUS: CALL_STATUS,
|
|
10595
|
+
STREAM_STATUS_INFO: STREAM_STATUS_INFO,
|
|
10596
|
+
CALL_STATUS_INFO: CALL_STATUS_INFO,
|
|
10597
|
+
ERROR_INFO: ERROR_INFO,
|
|
10598
|
+
MEDIA_DEVICE_KIND: MEDIA_DEVICE_KIND,
|
|
10599
|
+
TRANSPORT_TYPE: TRANSPORT_TYPE,
|
|
10600
|
+
CONNECTION_QUALITY: CONNECTION_QUALITY,
|
|
10601
|
+
STREAM_EVENT: STREAM_EVENT,
|
|
10602
|
+
STREAM_EVENT_TYPE: STREAM_EVENT_TYPE,
|
|
10603
|
+
CONTENT_HINT_TYPE: CONTENT_HINT_TYPE
|
|
10604
|
+
};
|
|
10396
10605
|
|
|
10397
10606
|
},{}],41:[function(require,module,exports){
|
|
10398
10607
|
'use strict';
|
|
@@ -10420,7 +10629,12 @@ var createConnection = function createConnection(options) {
|
|
|
10420
10629
|
var id = options.id;
|
|
10421
10630
|
var authToken = options.authToken;
|
|
10422
10631
|
var display = options.display || options.localDisplay;
|
|
10423
|
-
var flashBufferTime = options.flashBufferTime || 0;
|
|
10632
|
+
var flashBufferTime = options.flashBufferTime || 0; // Set connection logger #WCS-2434
|
|
10633
|
+
|
|
10634
|
+
if (options.logger) {
|
|
10635
|
+
logger = options.logger;
|
|
10636
|
+
}
|
|
10637
|
+
|
|
10424
10638
|
var url = getConnectionUrl(options.mainUrl, options.flashProto, options.flashPort); //todo state from flash instance
|
|
10425
10639
|
|
|
10426
10640
|
var state = function state() {
|
|
@@ -11041,8 +11255,9 @@ var constants = require("./constants");
|
|
|
11041
11255
|
|
|
11042
11256
|
var util = require('./util');
|
|
11043
11257
|
|
|
11044
|
-
var
|
|
11258
|
+
var LoggerObject = require('./util').logger;
|
|
11045
11259
|
|
|
11260
|
+
var coreLogger;
|
|
11046
11261
|
var loggerConf = {
|
|
11047
11262
|
push: false,
|
|
11048
11263
|
severity: "INFO"
|
|
@@ -11090,7 +11305,7 @@ var disableConnectionQualityCalculation;
|
|
|
11090
11305
|
* @param {String=} options.decoderLocation Location of video-worker2.js file
|
|
11091
11306
|
* @param {String=} options.screenSharingExtensionId Chrome screen sharing extension id
|
|
11092
11307
|
* @param {Object=} options.constraints Default local media constraints
|
|
11093
|
-
* @param {Object=} options.logger
|
|
11308
|
+
* @param {Object=} options.logger Core logger options
|
|
11094
11309
|
* @throws {Error} Error if none of MediaProviders available
|
|
11095
11310
|
* @memberof Flashphoner
|
|
11096
11311
|
*/
|
|
@@ -11099,16 +11314,10 @@ var init = function init(options) {
|
|
|
11099
11314
|
if (!initialized) {
|
|
11100
11315
|
if (!options) {
|
|
11101
11316
|
options = {};
|
|
11102
|
-
}
|
|
11317
|
+
} // init global logger
|
|
11103
11318
|
|
|
11104
|
-
loggerConf = options.logger || loggerConf;
|
|
11105
11319
|
|
|
11106
|
-
|
|
11107
|
-
loggerConf.enableLogs = true;
|
|
11108
|
-
} // init logger
|
|
11109
|
-
|
|
11110
|
-
|
|
11111
|
-
logger.init(loggerConf.severity || "INFO", loggerConf.push || false, loggerConf.customLogger, loggerConf.enableLogs);
|
|
11320
|
+
coreLogger = createLogger(options.logger);
|
|
11112
11321
|
var waitingTemasys = false;
|
|
11113
11322
|
|
|
11114
11323
|
try {
|
|
@@ -11129,7 +11338,7 @@ var init = function init(options) {
|
|
|
11129
11338
|
constraints: options.constraints || getDefaultMediaConstraints(),
|
|
11130
11339
|
extensionId: options.screenSharingExtensionId,
|
|
11131
11340
|
audioContext: audioContext,
|
|
11132
|
-
logger:
|
|
11341
|
+
logger: coreLogger,
|
|
11133
11342
|
createMicGainNode: enableGainNode
|
|
11134
11343
|
};
|
|
11135
11344
|
webRtcProvider.configure(webRtcConf);
|
|
@@ -11146,7 +11355,7 @@ var init = function init(options) {
|
|
|
11146
11355
|
var webRtcConf = {
|
|
11147
11356
|
constraints: options.constraints || getDefaultMediaConstraints(),
|
|
11148
11357
|
extensionId: options.screenSharingExtensionId,
|
|
11149
|
-
logger:
|
|
11358
|
+
logger: coreLogger
|
|
11150
11359
|
};
|
|
11151
11360
|
webRtcProvider.configure(webRtcConf); // Just reorder media provider list
|
|
11152
11361
|
|
|
@@ -11174,7 +11383,7 @@ var init = function init(options) {
|
|
|
11174
11383
|
var flashConf = {
|
|
11175
11384
|
constraints: options.constraints || getDefaultMediaConstraints(),
|
|
11176
11385
|
flashMediaProviderSwfLocation: options.flashMediaProviderSwfLocation,
|
|
11177
|
-
logger:
|
|
11386
|
+
logger: coreLogger
|
|
11178
11387
|
};
|
|
11179
11388
|
flashProvider.configure(flashConf);
|
|
11180
11389
|
}
|
|
@@ -11198,7 +11407,7 @@ var init = function init(options) {
|
|
|
11198
11407
|
receiverLocation: options.receiverLocation,
|
|
11199
11408
|
decoderLocation: options.decoderLocation,
|
|
11200
11409
|
audioContext: audioContext,
|
|
11201
|
-
logger:
|
|
11410
|
+
logger: coreLogger
|
|
11202
11411
|
};
|
|
11203
11412
|
websocketProvider.configure(wsConf);
|
|
11204
11413
|
} //check at least 1 provider available
|
|
@@ -11220,7 +11429,7 @@ var init = function init(options) {
|
|
|
11220
11429
|
MediaProvider = _MediaProvider;
|
|
11221
11430
|
}
|
|
11222
11431
|
} else {
|
|
11223
|
-
|
|
11432
|
+
corelogger.warn(LOG_PREFIX, "Preferred media provider is not available.");
|
|
11224
11433
|
}
|
|
11225
11434
|
}
|
|
11226
11435
|
|
|
@@ -11248,7 +11457,7 @@ var init = function init(options) {
|
|
|
11248
11457
|
options.mediaProvidersReadyCallback(Object.keys(MediaProvider));
|
|
11249
11458
|
}
|
|
11250
11459
|
|
|
11251
|
-
|
|
11460
|
+
coreLogger.info(LOG_PREFIX, "Initialized");
|
|
11252
11461
|
initialized = true;
|
|
11253
11462
|
}
|
|
11254
11463
|
};
|
|
@@ -11287,7 +11496,7 @@ var playFirstVideo = function playFirstVideo(display, isLocal, src) {
|
|
|
11287
11496
|
}
|
|
11288
11497
|
};
|
|
11289
11498
|
/**
|
|
11290
|
-
* Get logger
|
|
11499
|
+
* Get core logger
|
|
11291
11500
|
*
|
|
11292
11501
|
* @returns {Object} Logger
|
|
11293
11502
|
* @memberof Flashphoner
|
|
@@ -11298,7 +11507,7 @@ var getLogger = function getLogger() {
|
|
|
11298
11507
|
if (!initialized) {
|
|
11299
11508
|
console.warn("Initialize API first.");
|
|
11300
11509
|
} else {
|
|
11301
|
-
return
|
|
11510
|
+
return coreLogger;
|
|
11302
11511
|
}
|
|
11303
11512
|
};
|
|
11304
11513
|
/**
|
|
@@ -11471,6 +11680,31 @@ var getSessions = function getSessions() {
|
|
|
11471
11680
|
|
|
11472
11681
|
var getSession = function getSession(id) {
|
|
11473
11682
|
return sessions[id];
|
|
11683
|
+
}; // Get logger configuration from options
|
|
11684
|
+
|
|
11685
|
+
|
|
11686
|
+
var getLoggerConf = function getLoggerConf(loggerOptions) {
|
|
11687
|
+
var conf = loggerOptions || loggerConf;
|
|
11688
|
+
|
|
11689
|
+
if (loggerOptions !== null) {
|
|
11690
|
+
conf.enableLogs = true;
|
|
11691
|
+
}
|
|
11692
|
+
|
|
11693
|
+
return conf;
|
|
11694
|
+
}; // Create a new logger object
|
|
11695
|
+
|
|
11696
|
+
|
|
11697
|
+
var createLogger = function createLogger(loggerOptions) {
|
|
11698
|
+
var parentLogger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : coreLogger;
|
|
11699
|
+
var newLogger = parentLogger;
|
|
11700
|
+
|
|
11701
|
+
if (newLogger === undefined || loggerOptions != undefined) {
|
|
11702
|
+
var loggerConf = getLoggerConf(loggerOptions);
|
|
11703
|
+
newLogger = new LoggerObject();
|
|
11704
|
+
newLogger.init(loggerConf.severity || "INFO", loggerConf.push || false, loggerConf.customLogger, loggerConf.enableLogs);
|
|
11705
|
+
}
|
|
11706
|
+
|
|
11707
|
+
return newLogger;
|
|
11474
11708
|
};
|
|
11475
11709
|
/**
|
|
11476
11710
|
* Create new session and connect to server.
|
|
@@ -11490,6 +11724,7 @@ var getSession = function getSession(id) {
|
|
|
11490
11724
|
* @param {Integer=} options.pingInterval Server ping interval in milliseconds [0]
|
|
11491
11725
|
* @param {Integer=} options.receiveProbes A maximum subsequental pings received missing count [0]
|
|
11492
11726
|
* @param {Integer=} options.probesInterval Interval to check subsequental pings received [0]
|
|
11727
|
+
* @param {Object=} options.logger Session logger options
|
|
11493
11728
|
* @returns {Session} Created session
|
|
11494
11729
|
* @throws {Error} Error if API is not initialized
|
|
11495
11730
|
* @throws {TypeError} Error if options.urlServer is not specified
|
|
@@ -11504,8 +11739,12 @@ var createSession = function createSession(options) {
|
|
|
11504
11739
|
|
|
11505
11740
|
if (!options || !options.urlServer) {
|
|
11506
11741
|
throw new TypeError("options.urlServer must be provided");
|
|
11507
|
-
}
|
|
11742
|
+
} // Set session logger #WCS-2434
|
|
11508
11743
|
|
|
11744
|
+
|
|
11745
|
+
var sessionLogger = createLogger(options.logger); // Override logger for all low level operations
|
|
11746
|
+
|
|
11747
|
+
var logger = sessionLogger;
|
|
11509
11748
|
var id_ = uuid_v1();
|
|
11510
11749
|
var sessionStatus = SESSION_STATUS.PENDING;
|
|
11511
11750
|
var urlServer = options.urlServer;
|
|
@@ -11611,7 +11850,7 @@ var createSession = function createSession(options) {
|
|
|
11611
11850
|
if (timeout != undefined && timeout > 0) {
|
|
11612
11851
|
connectionTimeout = setTimeout(function () {
|
|
11613
11852
|
if (wsConnection.readyState == 0) {
|
|
11614
|
-
|
|
11853
|
+
logger.warn(LOG_PREFIX, "WS connection timeout");
|
|
11615
11854
|
wsConnection.close();
|
|
11616
11855
|
}
|
|
11617
11856
|
}, timeout);
|
|
@@ -11635,7 +11874,7 @@ var createSession = function createSession(options) {
|
|
|
11635
11874
|
mediaProviders: Object.keys(MediaProvider),
|
|
11636
11875
|
keepAlive: keepAlive,
|
|
11637
11876
|
authToken: authToken,
|
|
11638
|
-
clientVersion: "2.0.
|
|
11877
|
+
clientVersion: "2.0.217",
|
|
11639
11878
|
clientOSVersion: window.navigator.appVersion,
|
|
11640
11879
|
clientBrowserVersion: window.navigator.userAgent,
|
|
11641
11880
|
msePacketizationVersion: 2,
|
|
@@ -11941,6 +12180,7 @@ var createSession = function createSession(options) {
|
|
|
11941
12180
|
* @param {Array<string>=} options.sipSDP Array of custom SDP params (ex. bandwidth (b=))
|
|
11942
12181
|
* @param {Array<string>=} options.sipHeaders Array of custom SIP headers
|
|
11943
12182
|
* @param {string=} options.videoContentHint Video content hint for browser ('detail' by default to maintain resolution), {@link Flashphoner.constants.CONTENT_HINT_TYPE}
|
|
12183
|
+
* @param {Object=} options.logger Call logger options
|
|
11944
12184
|
* @param {sdpHook} sdpHook The callback that handles sdp from the server
|
|
11945
12185
|
* @returns {Call} Call
|
|
11946
12186
|
* @throws {TypeError} Error if no options provided
|
|
@@ -11953,15 +12193,18 @@ var createSession = function createSession(options) {
|
|
|
11953
12193
|
var createCall = function createCall(options) {
|
|
11954
12194
|
//check session state
|
|
11955
12195
|
if (sessionStatus !== SESSION_STATUS.REGISTERED && sessionStatus !== SESSION_STATUS.ESTABLISHED) {
|
|
11956
|
-
|
|
11957
|
-
throw new Error('Invalid session state');
|
|
12196
|
+
throw new Error('Invalid session state ' + sessionStatus);
|
|
11958
12197
|
} //check options
|
|
11959
12198
|
|
|
11960
12199
|
|
|
11961
12200
|
if (!options) {
|
|
11962
12201
|
throw new TypeError("options must be provided");
|
|
11963
|
-
}
|
|
12202
|
+
} // Set call logger #WCS-2434
|
|
12203
|
+
|
|
11964
12204
|
|
|
12205
|
+
var callLogger = createLogger(options.logger, sessionLogger); // Override logger for all low level operations
|
|
12206
|
+
|
|
12207
|
+
var logger = callLogger;
|
|
11965
12208
|
var login = appKey == 'clickToCallApp' ? '' : cConfig.sipLogin;
|
|
11966
12209
|
var caller_ = options.incoming ? options.caller : login;
|
|
11967
12210
|
var callee_ = options.callee;
|
|
@@ -12107,7 +12350,8 @@ var createSession = function createSession(options) {
|
|
|
12107
12350
|
constraints: constraints,
|
|
12108
12351
|
connectionConfig: mediaOptions,
|
|
12109
12352
|
audioOutputId: audioOutputId,
|
|
12110
|
-
videoContentHint: videoContentHint
|
|
12353
|
+
videoContentHint: videoContentHint,
|
|
12354
|
+
logger: logger
|
|
12111
12355
|
}).then(function (newConnection) {
|
|
12112
12356
|
mediaConnection = newConnection;
|
|
12113
12357
|
return mediaConnection.createOffer({
|
|
@@ -12693,7 +12937,7 @@ var createSession = function createSession(options) {
|
|
|
12693
12937
|
/**
|
|
12694
12938
|
* Get call info
|
|
12695
12939
|
* @returns {string} Info
|
|
12696
|
-
* @memberof
|
|
12940
|
+
* @memberof Call
|
|
12697
12941
|
* @inner
|
|
12698
12942
|
*/
|
|
12699
12943
|
|
|
@@ -12704,7 +12948,7 @@ var createSession = function createSession(options) {
|
|
|
12704
12948
|
/**
|
|
12705
12949
|
* Get stream error info
|
|
12706
12950
|
* @returns {string} Error info
|
|
12707
|
-
* @memberof
|
|
12951
|
+
* @memberof Call
|
|
12708
12952
|
* @inner
|
|
12709
12953
|
*/
|
|
12710
12954
|
|
|
@@ -12712,6 +12956,17 @@ var createSession = function createSession(options) {
|
|
|
12712
12956
|
var getErrorInfo = function getErrorInfo() {
|
|
12713
12957
|
return errorInfo_;
|
|
12714
12958
|
};
|
|
12959
|
+
/**
|
|
12960
|
+
* Get call logger
|
|
12961
|
+
*
|
|
12962
|
+
* @returns {Object} Logger
|
|
12963
|
+
* @memberof Call
|
|
12964
|
+
*/
|
|
12965
|
+
|
|
12966
|
+
|
|
12967
|
+
var getLogger = function getLogger() {
|
|
12968
|
+
return callLogger;
|
|
12969
|
+
};
|
|
12715
12970
|
|
|
12716
12971
|
call.call = call_;
|
|
12717
12972
|
call.answer = answer;
|
|
@@ -12743,6 +12998,7 @@ var createSession = function createSession(options) {
|
|
|
12743
12998
|
call.switchMic = switchMic;
|
|
12744
12999
|
call.switchToScreen = switchToScreen;
|
|
12745
13000
|
call.switchToCam = switchToCam;
|
|
13001
|
+
call.getLogger = getLogger;
|
|
12746
13002
|
calls[id_] = call;
|
|
12747
13003
|
return call;
|
|
12748
13004
|
};
|
|
@@ -12789,6 +13045,7 @@ var createSession = function createSession(options) {
|
|
|
12789
13045
|
* @param {string=} options.useCanvasMediaStream EXPERIMENTAL: when publish bind browser's media stream to the canvas. It can be useful for image filtering
|
|
12790
13046
|
* @param {string=} options.videoContentHint Video content hint for browser ('detail' by default to maintain resolution), {@link Flashphoner.constants.CONTENT_HINT_TYPE}
|
|
12791
13047
|
* @param {Boolean=} options.unmutePlayOnStart Unmute playback on start. May be used after user gesture only, so set 'unmutePlayOnStart: false' for autoplay
|
|
13048
|
+
* @param {Object=} options.logger Stream logger options
|
|
12792
13049
|
* @param {sdpHook} sdpHook The callback that handles sdp from the server
|
|
12793
13050
|
* @returns {Stream} Stream
|
|
12794
13051
|
* @throws {TypeError} Error if no options provided
|
|
@@ -12804,7 +13061,7 @@ var createSession = function createSession(options) {
|
|
|
12804
13061
|
var availableCallbacks = []; //check session state
|
|
12805
13062
|
|
|
12806
13063
|
if (sessionStatus !== SESSION_STATUS.ESTABLISHED) {
|
|
12807
|
-
throw new Error('Invalid session state');
|
|
13064
|
+
throw new Error('Invalid session state ' + sessionStatus);
|
|
12808
13065
|
} //check options
|
|
12809
13066
|
|
|
12810
13067
|
|
|
@@ -12814,8 +13071,12 @@ var createSession = function createSession(options) {
|
|
|
12814
13071
|
|
|
12815
13072
|
if (!options.name) {
|
|
12816
13073
|
throw new TypeError("options.name must be provided");
|
|
12817
|
-
}
|
|
13074
|
+
} // Set stream logger #WCS-2434
|
|
13075
|
+
|
|
12818
13076
|
|
|
13077
|
+
var streamLogger = createLogger(options.logger, sessionLogger); // Override logger for all low level operations
|
|
13078
|
+
|
|
13079
|
+
var logger = streamLogger;
|
|
12819
13080
|
var clientKf = new KalmanFilter();
|
|
12820
13081
|
var serverKf = new KalmanFilter();
|
|
12821
13082
|
var id_ = uuid_v1();
|
|
@@ -13059,7 +13320,7 @@ var createSession = function createSession(options) {
|
|
|
13059
13320
|
logger.debug(LOG_PREFIX, "Play stream " + name_);
|
|
13060
13321
|
|
|
13061
13322
|
if (status_ !== STREAM_STATUS.NEW) {
|
|
13062
|
-
throw new Error("Invalid stream state");
|
|
13323
|
+
throw new Error("Invalid stream state " + status_);
|
|
13063
13324
|
}
|
|
13064
13325
|
|
|
13065
13326
|
status_ = STREAM_STATUS.PENDING; //create mediaProvider connection
|
|
@@ -13078,7 +13339,8 @@ var createSession = function createSession(options) {
|
|
|
13078
13339
|
audioOutputId: audioOutputId,
|
|
13079
13340
|
remoteVideo: remoteVideo,
|
|
13080
13341
|
playoutDelay: playoutDelay,
|
|
13081
|
-
unmutePlayOnStart: unmutePlayOnStart
|
|
13342
|
+
unmutePlayOnStart: unmutePlayOnStart,
|
|
13343
|
+
logger: logger
|
|
13082
13344
|
}, streamRefreshHandlers[id_]).then(function (newConnection) {
|
|
13083
13345
|
mediaConnection = newConnection;
|
|
13084
13346
|
|
|
@@ -13142,7 +13404,7 @@ var createSession = function createSession(options) {
|
|
|
13142
13404
|
logger.debug(LOG_PREFIX, "Publish stream " + name_);
|
|
13143
13405
|
|
|
13144
13406
|
if (status_ !== STREAM_STATUS.NEW) {
|
|
13145
|
-
throw new Error("Invalid stream state");
|
|
13407
|
+
throw new Error("Invalid stream state " + status_);
|
|
13146
13408
|
}
|
|
13147
13409
|
|
|
13148
13410
|
status_ = STREAM_STATUS.PENDING;
|
|
@@ -13176,7 +13438,8 @@ var createSession = function createSession(options) {
|
|
|
13176
13438
|
connectionConfig: mediaOptions,
|
|
13177
13439
|
connectionConstraints: mediaConnectionConstraints,
|
|
13178
13440
|
customStream: constraints && constraints.customStream ? constraints.customStream : false,
|
|
13179
|
-
videoContentHint: videoContentHint
|
|
13441
|
+
videoContentHint: videoContentHint,
|
|
13442
|
+
logger: logger
|
|
13180
13443
|
}).then(function (newConnection) {
|
|
13181
13444
|
mediaConnection = newConnection;
|
|
13182
13445
|
return mediaConnection.createOffer({
|
|
@@ -13806,6 +14069,17 @@ var createSession = function createSession(options) {
|
|
|
13806
14069
|
availableCallbacks.push(promise);
|
|
13807
14070
|
});
|
|
13808
14071
|
};
|
|
14072
|
+
/**
|
|
14073
|
+
* Get stream logger
|
|
14074
|
+
*
|
|
14075
|
+
* @returns {Object} Logger
|
|
14076
|
+
* @memberof Stream
|
|
14077
|
+
*/
|
|
14078
|
+
|
|
14079
|
+
|
|
14080
|
+
var getLogger = function getLogger() {
|
|
14081
|
+
return streamLogger;
|
|
14082
|
+
};
|
|
13809
14083
|
|
|
13810
14084
|
stream.play = play;
|
|
13811
14085
|
stream.publish = publish;
|
|
@@ -13845,6 +14119,7 @@ var createSession = function createSession(options) {
|
|
|
13845
14119
|
stream.switchToScreen = switchToScreen;
|
|
13846
14120
|
stream.switchToCam = switchToCam;
|
|
13847
14121
|
stream.sendData = sendData;
|
|
14122
|
+
stream.getLogger = getLogger;
|
|
13848
14123
|
streams[id_] = stream;
|
|
13849
14124
|
return stream;
|
|
13850
14125
|
};
|
|
@@ -14053,6 +14328,17 @@ var createSession = function createSession(options) {
|
|
|
14053
14328
|
}
|
|
14054
14329
|
|
|
14055
14330
|
return sdp;
|
|
14331
|
+
};
|
|
14332
|
+
/**
|
|
14333
|
+
* Get session logger
|
|
14334
|
+
*
|
|
14335
|
+
* @returns {Object} Logger
|
|
14336
|
+
* @memberof Session
|
|
14337
|
+
*/
|
|
14338
|
+
|
|
14339
|
+
|
|
14340
|
+
var getLogger = function getLogger() {
|
|
14341
|
+
return sessionLogger;
|
|
14056
14342
|
}; //export Session
|
|
14057
14343
|
|
|
14058
14344
|
|
|
@@ -14068,7 +14354,8 @@ var createSession = function createSession(options) {
|
|
|
14068
14354
|
session.submitBugReport = submitBugReport;
|
|
14069
14355
|
session.startDebug = startDebug;
|
|
14070
14356
|
session.stopDebug = stopDebug;
|
|
14071
|
-
session.on = on;
|
|
14357
|
+
session.on = on;
|
|
14358
|
+
session.getLogger = getLogger; //save interface to global map
|
|
14072
14359
|
|
|
14073
14360
|
sessions[id_] = session;
|
|
14074
14361
|
return session;
|
|
@@ -14114,165 +14401,171 @@ module.exports = {
|
|
|
14114
14401
|
},{}],44:[function(require,module,exports){
|
|
14115
14402
|
'use strict';
|
|
14116
14403
|
|
|
14117
|
-
|
|
14118
|
-
|
|
14119
|
-
|
|
14120
|
-
|
|
14121
|
-
}
|
|
14404
|
+
var isEmptyObject = function isEmptyObject(obj) {
|
|
14405
|
+
for (var name in obj) {
|
|
14406
|
+
return false;
|
|
14407
|
+
}
|
|
14122
14408
|
|
|
14123
|
-
|
|
14124
|
-
|
|
14409
|
+
return true;
|
|
14410
|
+
};
|
|
14411
|
+
/**
|
|
14412
|
+
* Copy values of object own properties to array.
|
|
14413
|
+
*
|
|
14414
|
+
* @param obj
|
|
14415
|
+
* @returns {Array}
|
|
14416
|
+
*/
|
|
14125
14417
|
|
|
14126
|
-
/**
|
|
14127
|
-
* Copy values of object own properties to array.
|
|
14128
|
-
*
|
|
14129
|
-
* @param obj
|
|
14130
|
-
* @returns {Array}
|
|
14131
|
-
*/
|
|
14132
|
-
copyObjectToArray: function copyObjectToArray(obj) {
|
|
14133
|
-
var ret = [];
|
|
14134
14418
|
|
|
14135
|
-
|
|
14136
|
-
|
|
14137
|
-
|
|
14138
|
-
|
|
14419
|
+
var copyObjectToArray = function copyObjectToArray(obj) {
|
|
14420
|
+
var ret = [];
|
|
14421
|
+
|
|
14422
|
+
for (var prop in obj) {
|
|
14423
|
+
if (obj.hasOwnProperty(prop)) {
|
|
14424
|
+
ret.push(obj[prop]);
|
|
14139
14425
|
}
|
|
14426
|
+
}
|
|
14140
14427
|
|
|
14141
|
-
|
|
14142
|
-
|
|
14428
|
+
return ret;
|
|
14429
|
+
};
|
|
14430
|
+
/**
|
|
14431
|
+
* Copy src properties to dst object.
|
|
14432
|
+
* Will overwrite dst prop with src prop in case of dst prop exist.
|
|
14433
|
+
*/
|
|
14143
14434
|
|
|
14144
|
-
|
|
14145
|
-
|
|
14146
|
-
|
|
14147
|
-
|
|
14148
|
-
|
|
14149
|
-
for (var prop in src) {
|
|
14150
|
-
if (src.hasOwnProperty(prop)) {
|
|
14151
|
-
dst[prop] = src[prop];
|
|
14152
|
-
}
|
|
14435
|
+
|
|
14436
|
+
var copyObjectPropsToAnotherObject = function copyObjectPropsToAnotherObject(src, dst) {
|
|
14437
|
+
for (var prop in src) {
|
|
14438
|
+
if (src.hasOwnProperty(prop)) {
|
|
14439
|
+
dst[prop] = src[prop];
|
|
14153
14440
|
}
|
|
14154
|
-
}
|
|
14155
|
-
|
|
14156
|
-
var result = {};
|
|
14441
|
+
}
|
|
14442
|
+
};
|
|
14157
14443
|
|
|
14158
|
-
|
|
14159
|
-
|
|
14160
|
-
* Report types: googComponent, googCandidatePair, googCertificate, googLibjingleSession, googTrack, ssrc
|
|
14161
|
-
*/
|
|
14162
|
-
var gotResult = false;
|
|
14444
|
+
var processRtcStatsReport = function processRtcStatsReport(browser, report) {
|
|
14445
|
+
var result = {};
|
|
14163
14446
|
|
|
14164
|
-
|
|
14165
|
-
|
|
14166
|
-
|
|
14167
|
-
|
|
14168
|
-
|
|
14169
|
-
}
|
|
14447
|
+
if (browser == "chrome") {
|
|
14448
|
+
/**
|
|
14449
|
+
* Report types: googComponent, googCandidatePair, googCertificate, googLibjingleSession, googTrack, ssrc
|
|
14450
|
+
*/
|
|
14451
|
+
var gotResult = false;
|
|
14170
14452
|
|
|
14171
|
-
|
|
14453
|
+
if (report.type && report.type == "googCandidatePair") {
|
|
14454
|
+
//check if this is active pair
|
|
14455
|
+
if (report.googActiveConnection == "true") {
|
|
14172
14456
|
gotResult = true;
|
|
14173
14457
|
}
|
|
14458
|
+
}
|
|
14174
14459
|
|
|
14175
|
-
|
|
14176
|
-
|
|
14177
|
-
|
|
14178
|
-
|
|
14179
|
-
|
|
14460
|
+
if (report.type && report.type == "ssrc") {
|
|
14461
|
+
gotResult = true;
|
|
14462
|
+
}
|
|
14463
|
+
|
|
14464
|
+
if (gotResult) {
|
|
14465
|
+
for (var k in report) {
|
|
14466
|
+
if (report.hasOwnProperty(k)) {
|
|
14467
|
+
result[k] = report[k];
|
|
14180
14468
|
}
|
|
14181
14469
|
}
|
|
14470
|
+
}
|
|
14182
14471
|
|
|
14183
|
-
|
|
14184
|
-
|
|
14185
|
-
|
|
14186
|
-
|
|
14187
|
-
|
|
14188
|
-
|
|
14189
|
-
|
|
14472
|
+
return result;
|
|
14473
|
+
} else if (browser == "firefox") {
|
|
14474
|
+
/**
|
|
14475
|
+
* RTCStatsReport http://mxr.mozilla.org/mozilla-central/source/dom/webidl/RTCStatsReport.webidl
|
|
14476
|
+
*/
|
|
14477
|
+
if (report.type && (report.type == "outboundrtp" || report.type == "inboundrtp") && report.id.indexOf("rtcp") == -1) {
|
|
14478
|
+
result = {};
|
|
14190
14479
|
|
|
14191
|
-
|
|
14192
|
-
|
|
14193
|
-
|
|
14194
|
-
}
|
|
14480
|
+
for (var k in report) {
|
|
14481
|
+
if (report.hasOwnProperty(k)) {
|
|
14482
|
+
result[k] = report[k];
|
|
14195
14483
|
}
|
|
14196
14484
|
}
|
|
14197
|
-
|
|
14198
|
-
return result;
|
|
14199
|
-
} else {
|
|
14200
|
-
return result;
|
|
14201
14485
|
}
|
|
14202
14486
|
|
|
14203
|
-
;
|
|
14487
|
+
return result;
|
|
14488
|
+
} else {
|
|
14489
|
+
return result;
|
|
14490
|
+
}
|
|
14491
|
+
};
|
|
14492
|
+
|
|
14493
|
+
var Browser = {
|
|
14494
|
+
isIE: function isIE() {
|
|
14495
|
+
return (
|
|
14496
|
+
/*@cc_on!@*/
|
|
14497
|
+
false || !!document.documentMode
|
|
14498
|
+
);
|
|
14204
14499
|
},
|
|
14205
|
-
|
|
14206
|
-
|
|
14207
|
-
return (
|
|
14208
|
-
/*@cc_on!@*/
|
|
14209
|
-
false || !!document.documentMode
|
|
14210
|
-
);
|
|
14211
|
-
},
|
|
14212
|
-
isFirefox: function isFirefox() {
|
|
14213
|
-
return typeof InstallTrigger !== 'undefined';
|
|
14214
|
-
},
|
|
14215
|
-
isChrome: function isChrome() {
|
|
14216
|
-
return !!window.chrome && /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor) && !/OPR/.test(navigator.userAgent);
|
|
14217
|
-
},
|
|
14218
|
-
isEdge: function isEdge() {
|
|
14219
|
-
return !isIE && !!window.StyleMedia;
|
|
14220
|
-
},
|
|
14221
|
-
isOpera: function isOpera() {
|
|
14222
|
-
return !!window.opr && !!opr.addons || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
|
|
14223
|
-
},
|
|
14224
|
-
isiOS: function isiOS() {
|
|
14225
|
-
return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
|
14226
|
-
},
|
|
14227
|
-
isSafari: function isSafari() {
|
|
14228
|
-
var userAgent = navigator.userAgent.toLowerCase();
|
|
14229
|
-
return /(safari|applewebkit)/i.test(userAgent) && !userAgent.includes("chrome") && !userAgent.includes("android");
|
|
14230
|
-
},
|
|
14231
|
-
isAndroid: function isAndroid() {
|
|
14232
|
-
return navigator.userAgent.toLowerCase().indexOf("android") > -1;
|
|
14233
|
-
},
|
|
14234
|
-
isSafariWebRTC: function isSafariWebRTC() {
|
|
14235
|
-
return navigator.mediaDevices && this.isSafari();
|
|
14236
|
-
},
|
|
14237
|
-
isSamsungBrowser: function isSamsungBrowser() {
|
|
14238
|
-
return /SamsungBrowser/i.test(navigator.userAgent);
|
|
14239
|
-
},
|
|
14240
|
-
isAndroidFirefox: function isAndroidFirefox() {
|
|
14241
|
-
return this.isAndroid() && /Firefox/i.test(navigator.userAgent);
|
|
14242
|
-
}
|
|
14500
|
+
isFirefox: function isFirefox() {
|
|
14501
|
+
return typeof InstallTrigger !== 'undefined';
|
|
14243
14502
|
},
|
|
14244
|
-
|
|
14245
|
-
|
|
14246
|
-
|
|
14247
|
-
|
|
14248
|
-
|
|
14249
|
-
|
|
14250
|
-
|
|
14251
|
-
|
|
14252
|
-
|
|
14253
|
-
|
|
14254
|
-
|
|
14255
|
-
|
|
14503
|
+
isChrome: function isChrome() {
|
|
14504
|
+
return !!window.chrome && /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor) && !/OPR/.test(navigator.userAgent);
|
|
14505
|
+
},
|
|
14506
|
+
isEdge: function isEdge() {
|
|
14507
|
+
return !isIE && !!window.StyleMedia;
|
|
14508
|
+
},
|
|
14509
|
+
isOpera: function isOpera() {
|
|
14510
|
+
return !!window.opr && !!opr.addons || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
|
|
14511
|
+
},
|
|
14512
|
+
isiOS: function isiOS() {
|
|
14513
|
+
return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
|
14514
|
+
},
|
|
14515
|
+
isSafari: function isSafari() {
|
|
14516
|
+
var userAgent = navigator.userAgent.toLowerCase();
|
|
14517
|
+
return /(safari|applewebkit)/i.test(userAgent) && !userAgent.includes("chrome") && !userAgent.includes("android");
|
|
14518
|
+
},
|
|
14519
|
+
isAndroid: function isAndroid() {
|
|
14520
|
+
return navigator.userAgent.toLowerCase().indexOf("android") > -1;
|
|
14521
|
+
},
|
|
14522
|
+
isSafariWebRTC: function isSafariWebRTC() {
|
|
14523
|
+
return navigator.mediaDevices && this.isSafari();
|
|
14524
|
+
},
|
|
14525
|
+
isSamsungBrowser: function isSamsungBrowser() {
|
|
14526
|
+
return /SamsungBrowser/i.test(navigator.userAgent);
|
|
14527
|
+
},
|
|
14528
|
+
isAndroidFirefox: function isAndroidFirefox() {
|
|
14529
|
+
return this.isAndroid() && /Firefox/i.test(navigator.userAgent);
|
|
14530
|
+
},
|
|
14531
|
+
isChromiumEdge: function isChromiumEdge() {
|
|
14532
|
+
return /Chrome/i.test(navigator.userAgent) && /Edg/i.test(navigator.userAgent);
|
|
14533
|
+
}
|
|
14534
|
+
};
|
|
14535
|
+
var SDP = {
|
|
14536
|
+
matchPrefix: function matchPrefix(sdp, prefix) {
|
|
14537
|
+
var parts = sdp.trim().split('\n').map(function (line) {
|
|
14538
|
+
return line.trim();
|
|
14539
|
+
});
|
|
14540
|
+
return parts.filter(function (line) {
|
|
14541
|
+
return line.indexOf(prefix) === 0;
|
|
14542
|
+
});
|
|
14543
|
+
},
|
|
14544
|
+
writeFmtp: function writeFmtp(sdp, param, codec) {
|
|
14545
|
+
var sdpArray = sdp.split("\n");
|
|
14546
|
+
var i;
|
|
14256
14547
|
|
|
14257
|
-
|
|
14258
|
-
|
|
14259
|
-
|
|
14260
|
-
|
|
14261
|
-
|
|
14548
|
+
for (i = 0; i < sdpArray.length; i++) {
|
|
14549
|
+
if (sdpArray[i].search(codec) != -1 && sdpArray[i].indexOf("a=rtpmap") == 0) {
|
|
14550
|
+
sdpArray[i] += "\na=fmtp:" + sdpArray[i].match(/[0-9]+/)[0] + " " + param + "\r";
|
|
14551
|
+
}
|
|
14552
|
+
} //normalize sdp after modifications
|
|
14262
14553
|
|
|
14263
14554
|
|
|
14264
|
-
|
|
14555
|
+
var result = "";
|
|
14265
14556
|
|
|
14266
|
-
|
|
14267
|
-
|
|
14268
|
-
|
|
14269
|
-
}
|
|
14557
|
+
for (i = 0; i < sdpArray.length; i++) {
|
|
14558
|
+
if (sdpArray[i] != "") {
|
|
14559
|
+
result += sdpArray[i] + "\n";
|
|
14270
14560
|
}
|
|
14271
|
-
|
|
14272
|
-
return result;
|
|
14273
14561
|
}
|
|
14274
|
-
|
|
14275
|
-
|
|
14562
|
+
|
|
14563
|
+
return result;
|
|
14564
|
+
}
|
|
14565
|
+
};
|
|
14566
|
+
|
|
14567
|
+
var logger = function logger() {
|
|
14568
|
+
return {
|
|
14276
14569
|
init: function init(verbosity, enablePushLogs, customLogger, enableLogs) {
|
|
14277
14570
|
switch (verbosity.toUpperCase()) {
|
|
14278
14571
|
case "DEBUG":
|
|
@@ -14453,92 +14746,104 @@ module.exports = {
|
|
|
14453
14746
|
default:
|
|
14454
14747
|
this.verbosity = 2;
|
|
14455
14748
|
}
|
|
14456
|
-
|
|
14457
|
-
;
|
|
14458
14749
|
}
|
|
14459
|
-
}
|
|
14460
|
-
|
|
14461
|
-
if (!codecs.length) return sdp;
|
|
14462
|
-
var sdpArray = sdp.split("\n");
|
|
14463
|
-
var codecsArray = codecs.split(","); //search and delete codecs line
|
|
14750
|
+
};
|
|
14751
|
+
};
|
|
14464
14752
|
|
|
14465
|
-
|
|
14466
|
-
|
|
14753
|
+
var stripCodecs = function stripCodecs(sdp, codecs) {
|
|
14754
|
+
if (!codecs.length) return sdp;
|
|
14755
|
+
var sdpArray = sdp.split("\n");
|
|
14756
|
+
var codecsArray = codecs.split(","); //search and delete codecs line
|
|
14467
14757
|
|
|
14468
|
-
|
|
14469
|
-
|
|
14758
|
+
var pt = [];
|
|
14759
|
+
var i;
|
|
14470
14760
|
|
|
14471
|
-
|
|
14472
|
-
|
|
14473
|
-
|
|
14474
|
-
|
|
14475
|
-
|
|
14476
|
-
|
|
14761
|
+
for (var p = 0; p < codecsArray.length; p++) {
|
|
14762
|
+
console.log("Searching for codec " + codecsArray[p]);
|
|
14763
|
+
|
|
14764
|
+
for (i = 0; i < sdpArray.length; i++) {
|
|
14765
|
+
if (sdpArray[i].search(new RegExp(codecsArray[p], 'i')) != -1 && sdpArray[i].indexOf("a=rtpmap") == 0) {
|
|
14766
|
+
console.log(codecsArray[p] + " detected");
|
|
14767
|
+
pt.push(sdpArray[i].match(/[0-9]+/)[0]);
|
|
14768
|
+
sdpArray[i] = "";
|
|
14477
14769
|
}
|
|
14478
14770
|
}
|
|
14771
|
+
}
|
|
14479
14772
|
|
|
14480
|
-
|
|
14481
|
-
|
|
14482
|
-
|
|
14483
|
-
|
|
14484
|
-
|
|
14485
|
-
|
|
14486
|
-
}
|
|
14773
|
+
if (pt.length) {
|
|
14774
|
+
//searching for fmtp
|
|
14775
|
+
for (p = 0; p < pt.length; p++) {
|
|
14776
|
+
for (i = 0; i < sdpArray.length; i++) {
|
|
14777
|
+
if (sdpArray[i].search("a=fmtp:" + pt[p]) != -1 || sdpArray[i].search("a=rtcp-fb:" + pt[p]) != -1) {
|
|
14778
|
+
sdpArray[i] = "";
|
|
14487
14779
|
}
|
|
14488
|
-
}
|
|
14780
|
+
}
|
|
14781
|
+
} //delete entries from m= line
|
|
14489
14782
|
|
|
14490
14783
|
|
|
14491
|
-
|
|
14492
|
-
|
|
14493
|
-
|
|
14494
|
-
|
|
14784
|
+
for (i = 0; i < sdpArray.length; i++) {
|
|
14785
|
+
if (sdpArray[i].search("m=audio") != -1 || sdpArray[i].search("m=video") != -1) {
|
|
14786
|
+
var mLineSplitted = sdpArray[i].split(" ");
|
|
14787
|
+
var newMLine = "";
|
|
14495
14788
|
|
|
14496
|
-
|
|
14497
|
-
|
|
14498
|
-
|
|
14789
|
+
for (var m = 0; m < mLineSplitted.length; m++) {
|
|
14790
|
+
if (pt.indexOf(mLineSplitted[m].trim()) == -1 || m <= 2) {
|
|
14791
|
+
newMLine += mLineSplitted[m];
|
|
14499
14792
|
|
|
14500
|
-
|
|
14501
|
-
|
|
14502
|
-
}
|
|
14793
|
+
if (m < mLineSplitted.length - 1) {
|
|
14794
|
+
newMLine = newMLine + " ";
|
|
14503
14795
|
}
|
|
14504
14796
|
}
|
|
14505
|
-
|
|
14506
|
-
sdpArray[i] = newMLine;
|
|
14507
14797
|
}
|
|
14798
|
+
|
|
14799
|
+
sdpArray[i] = newMLine;
|
|
14508
14800
|
}
|
|
14509
|
-
}
|
|
14801
|
+
}
|
|
14802
|
+
} //normalize sdp after modifications
|
|
14510
14803
|
|
|
14511
14804
|
|
|
14512
|
-
|
|
14805
|
+
var result = "";
|
|
14513
14806
|
|
|
14514
|
-
|
|
14515
|
-
|
|
14516
|
-
|
|
14517
|
-
}
|
|
14807
|
+
for (i = 0; i < sdpArray.length; i++) {
|
|
14808
|
+
if (sdpArray[i] != "") {
|
|
14809
|
+
result += sdpArray[i] + "\n";
|
|
14518
14810
|
}
|
|
14811
|
+
}
|
|
14519
14812
|
|
|
14520
|
-
|
|
14521
|
-
|
|
14522
|
-
getCurrentCodecAndSampleRate: function getCurrentCodecAndSampleRate(sdp, mediaType) {
|
|
14523
|
-
var rows = sdp.split("\n");
|
|
14524
|
-
var codecPt;
|
|
14813
|
+
return result;
|
|
14814
|
+
};
|
|
14525
14815
|
|
|
14526
|
-
|
|
14527
|
-
|
|
14528
|
-
|
|
14529
|
-
ret.name = rows[i].split(" ")[1].split("/")[0];
|
|
14530
|
-
ret.sampleRate = rows[i].split(" ")[1].split("/")[1];
|
|
14531
|
-
return ret;
|
|
14532
|
-
} //WCS-2136. WebRTC statistics doesn't work for VP8
|
|
14816
|
+
var getCurrentCodecAndSampleRate = function getCurrentCodecAndSampleRate(sdp, mediaType) {
|
|
14817
|
+
var rows = sdp.split("\n");
|
|
14818
|
+
var codecPt;
|
|
14533
14819
|
|
|
14820
|
+
for (var i = 0; i < rows.length; i++) {
|
|
14821
|
+
if (codecPt && rows[i].indexOf("a=rtpmap:" + codecPt) != -1) {
|
|
14822
|
+
var ret = {};
|
|
14823
|
+
ret.name = rows[i].split(" ")[1].split("/")[0];
|
|
14824
|
+
ret.sampleRate = rows[i].split(" ")[1].split("/")[1];
|
|
14825
|
+
return ret;
|
|
14826
|
+
} //WCS-2136. WebRTC statistics doesn't work for VP8
|
|
14534
14827
|
|
|
14535
|
-
|
|
14536
|
-
|
|
14537
|
-
|
|
14828
|
+
|
|
14829
|
+
if (rows[i].indexOf("m=" + mediaType) != -1) {
|
|
14830
|
+
codecPt = rows[i].split(" ")[3].trim();
|
|
14538
14831
|
}
|
|
14539
14832
|
}
|
|
14540
14833
|
};
|
|
14541
14834
|
|
|
14835
|
+
module.exports = {
|
|
14836
|
+
isEmptyObject: isEmptyObject,
|
|
14837
|
+
copyObjectToArray: copyObjectToArray,
|
|
14838
|
+
copyObjectPropsToAnotherObject: copyObjectPropsToAnotherObject,
|
|
14839
|
+
processRtcStatsReport: processRtcStatsReport,
|
|
14840
|
+
Browser: Browser,
|
|
14841
|
+
SDP: SDP,
|
|
14842
|
+
logger: logger,
|
|
14843
|
+
stripCodecs: stripCodecs,
|
|
14844
|
+
getCurrentCodecAndSampleRate: getCurrentCodecAndSampleRate
|
|
14845
|
+
};
|
|
14846
|
+
|
|
14542
14847
|
},{}],45:[function(require,module,exports){
|
|
14543
14848
|
'use strict';
|
|
14544
14849
|
|
|
@@ -14572,6 +14877,11 @@ var mics = [];
|
|
|
14572
14877
|
|
|
14573
14878
|
var createConnection = function createConnection(options) {
|
|
14574
14879
|
return new Promise(function (resolve, reject) {
|
|
14880
|
+
// Set connection logger #WCS-2434
|
|
14881
|
+
if (options.logger) {
|
|
14882
|
+
logger = options.logger;
|
|
14883
|
+
}
|
|
14884
|
+
|
|
14575
14885
|
var id = options.id;
|
|
14576
14886
|
var connectionConfig = options.connectionConfig || {
|
|
14577
14887
|
"iceServers": []
|
|
@@ -14702,9 +15012,9 @@ var createConnection = function createConnection(options) {
|
|
|
14702
15012
|
function setContentHint(stream, hint) {
|
|
14703
15013
|
stream.getVideoTracks().forEach(function (track) {
|
|
14704
15014
|
if (track.contentHint === undefined) {
|
|
14705
|
-
logger.warn("contentHint unsupported");
|
|
15015
|
+
logger.warn(LOG_PREFIX, "Track contentHint unsupported");
|
|
14706
15016
|
} else {
|
|
14707
|
-
logger.info("Set video track contentHint to " + hint);
|
|
15017
|
+
logger.info(LOG_PREFIX, "Set video track contentHint to " + hint);
|
|
14708
15018
|
track.contentHint = hint;
|
|
14709
15019
|
}
|
|
14710
15020
|
});
|
|
@@ -14741,7 +15051,7 @@ var createConnection = function createConnection(options) {
|
|
|
14741
15051
|
//WCS-2771 add playback delay
|
|
14742
15052
|
connection.getReceivers().forEach(function (track) {
|
|
14743
15053
|
if (track.playoutDelayHint === undefined) {
|
|
14744
|
-
logger.warn("
|
|
15054
|
+
logger.warn(LOG_PREFIX, "Playout delay unsupported");
|
|
14745
15055
|
}
|
|
14746
15056
|
|
|
14747
15057
|
track.playoutDelayHint = playoutDelay;
|
|
@@ -15134,7 +15444,7 @@ var createConnection = function createConnection(options) {
|
|
|
15134
15444
|
localVideo.srcObject.addTrack(audioTrack);
|
|
15135
15445
|
}
|
|
15136
15446
|
|
|
15137
|
-
logger.info("Switch camera to " + cam);
|
|
15447
|
+
logger.info(LOG_PREFIX, "Switch camera to " + cam);
|
|
15138
15448
|
resolve(cam);
|
|
15139
15449
|
})["catch"](function (reason) {
|
|
15140
15450
|
logger.error(LOG_PREFIX, reason);
|
|
@@ -15192,7 +15502,7 @@ var createConnection = function createConnection(options) {
|
|
|
15192
15502
|
localVideo.srcObject.addTrack(videoTrack);
|
|
15193
15503
|
}
|
|
15194
15504
|
|
|
15195
|
-
logger.info("Switch mic to " + mic);
|
|
15505
|
+
logger.info(LOG_PREFIX, "Switch mic to " + mic);
|
|
15196
15506
|
resolve(mic);
|
|
15197
15507
|
})["catch"](function (reason) {
|
|
15198
15508
|
logger.error(LOG_PREFIX, reason);
|
|
@@ -15286,7 +15596,7 @@ var createConnection = function createConnection(options) {
|
|
|
15286
15596
|
localVideo.srcObject.addTrack(currentAudioTrack);
|
|
15287
15597
|
}
|
|
15288
15598
|
});
|
|
15289
|
-
logger.info("Switch to screen");
|
|
15599
|
+
logger.info(LOG_PREFIX, "Switch to screen");
|
|
15290
15600
|
screenShare = true;
|
|
15291
15601
|
resolve();
|
|
15292
15602
|
};
|
|
@@ -15318,7 +15628,7 @@ var createConnection = function createConnection(options) {
|
|
|
15318
15628
|
});
|
|
15319
15629
|
}
|
|
15320
15630
|
|
|
15321
|
-
logger.info("Switch to cam");
|
|
15631
|
+
logger.info(LOG_PREFIX, "Switch to cam");
|
|
15322
15632
|
screenShare = false;
|
|
15323
15633
|
};
|
|
15324
15634
|
|
|
@@ -16190,7 +16500,12 @@ var audioContext;
|
|
|
16190
16500
|
var createConnection = function createConnection(options, handlers) {
|
|
16191
16501
|
return new Promise(function (resolve, reject) {
|
|
16192
16502
|
var id = options.id;
|
|
16193
|
-
var display = options.display;
|
|
16503
|
+
var display = options.display; // Set connection logger #WCS-2434
|
|
16504
|
+
|
|
16505
|
+
if (options.logger) {
|
|
16506
|
+
logger = options.logger;
|
|
16507
|
+
}
|
|
16508
|
+
|
|
16194
16509
|
var canvas = document.createElement("canvas");
|
|
16195
16510
|
display.appendChild(canvas);
|
|
16196
16511
|
canvas.id = id;
|