@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
|
@@ -17606,717 +17606,926 @@ exports['WSPlayer'] = WSPlayer;
|
|
|
17606
17606
|
* @see Session
|
|
17607
17607
|
*/
|
|
17608
17608
|
|
|
17609
|
-
var
|
|
17610
|
-
/**
|
|
17611
|
-
|
|
17612
|
-
|
|
17613
|
-
|
|
17614
|
-
|
|
17609
|
+
var SESSION_STATUS = Object.freeze({
|
|
17610
|
+
/**
|
|
17611
|
+
* Fires when {@link Session} ws socket opens.
|
|
17612
|
+
* @event CONNECTED
|
|
17613
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
17614
|
+
*/
|
|
17615
|
+
CONNECTED: 'CONNECTED',
|
|
17615
17616
|
|
|
17616
|
-
|
|
17617
|
-
|
|
17618
|
-
|
|
17619
|
-
|
|
17620
|
-
|
|
17621
|
-
|
|
17617
|
+
/**
|
|
17618
|
+
* Fires when {@link Session} receives connect ack from REST App.
|
|
17619
|
+
* @event ESTABLISHED
|
|
17620
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
17621
|
+
*/
|
|
17622
|
+
ESTABLISHED: 'ESTABLISHED',
|
|
17622
17623
|
|
|
17623
|
-
|
|
17624
|
-
|
|
17625
|
-
|
|
17626
|
-
|
|
17627
|
-
|
|
17628
|
-
|
|
17624
|
+
/**
|
|
17625
|
+
* Fires when {@link Session} disconnects.
|
|
17626
|
+
* @event DISCONNECTED
|
|
17627
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
17628
|
+
*/
|
|
17629
|
+
DISCONNECTED: 'DISCONNECTED',
|
|
17629
17630
|
|
|
17630
|
-
|
|
17631
|
-
|
|
17632
|
-
|
|
17633
|
-
|
|
17634
|
-
|
|
17635
|
-
|
|
17631
|
+
/**
|
|
17632
|
+
* Fires if {@link Session} call of rest method error.
|
|
17633
|
+
* @event WARN
|
|
17634
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
17635
|
+
*/
|
|
17636
|
+
WARN: 'WARN',
|
|
17636
17637
|
|
|
17637
|
-
|
|
17638
|
-
|
|
17639
|
-
|
|
17640
|
-
|
|
17641
|
-
|
|
17642
|
-
|
|
17643
|
-
|
|
17638
|
+
/**
|
|
17639
|
+
* Fires if {@link Session} connection failed.
|
|
17640
|
+
* Some of the reasons can be network connection failed, REST App failed
|
|
17641
|
+
* @event FAILED
|
|
17642
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
17643
|
+
*/
|
|
17644
|
+
FAILED: 'FAILED',
|
|
17644
17645
|
|
|
17645
|
-
|
|
17646
|
-
|
|
17647
|
-
|
|
17648
|
-
|
|
17649
|
-
|
|
17650
|
-
|
|
17646
|
+
/**
|
|
17647
|
+
* Fires wneh {@link Session} receives debug event
|
|
17648
|
+
* @event DEBUG
|
|
17649
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
17650
|
+
*/
|
|
17651
|
+
DEBUG: 'DEBUG',
|
|
17651
17652
|
|
|
17652
|
-
|
|
17653
|
-
|
|
17654
|
-
|
|
17655
|
-
|
|
17656
|
-
|
|
17657
|
-
|
|
17658
|
-
|
|
17653
|
+
/**
|
|
17654
|
+
* Fires when {@link Session} receives custom REST App message.
|
|
17655
|
+
*
|
|
17656
|
+
* @event APP_DATA
|
|
17657
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
17658
|
+
*/
|
|
17659
|
+
APP_DATA: 'APP_DATA',
|
|
17659
17660
|
|
|
17660
|
-
|
|
17661
|
-
|
|
17662
|
-
|
|
17663
|
-
|
|
17664
|
-
|
|
17665
|
-
|
|
17666
|
-
|
|
17661
|
+
/**
|
|
17662
|
+
* Fires when {@link Session} receives status of sendData operation.
|
|
17663
|
+
*
|
|
17664
|
+
* @event SEND_DATA_STATUS
|
|
17665
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
17666
|
+
*/
|
|
17667
|
+
SEND_DATA_STATUS: 'SEND_DATA_STATUS',
|
|
17667
17668
|
|
|
17668
|
-
|
|
17669
|
+
/**
|
|
17670
|
+
* State of newly created {@link Session}.
|
|
17671
|
+
*
|
|
17672
|
+
* @event PENDING
|
|
17673
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
17674
|
+
*/
|
|
17675
|
+
PENDING: 'PENDING',
|
|
17669
17676
|
|
|
17670
|
-
|
|
17671
|
-
|
|
17672
|
-
|
|
17673
|
-
|
|
17674
|
-
|
|
17675
|
-
|
|
17676
|
-
|
|
17677
|
+
/**
|
|
17678
|
+
* Fires when {@link Session} registers as sip client.
|
|
17679
|
+
*
|
|
17680
|
+
* @event REGISTERED
|
|
17681
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
17682
|
+
*/
|
|
17683
|
+
REGISTERED: 'REGISTERED',
|
|
17677
17684
|
|
|
17678
|
-
|
|
17679
|
-
|
|
17680
|
-
|
|
17681
|
-
|
|
17682
|
-
|
|
17683
|
-
|
|
17684
|
-
|
|
17685
|
+
/**
|
|
17686
|
+
* Fires when {@link Session} unregisters as sip client.
|
|
17687
|
+
*
|
|
17688
|
+
* @event UNREGISTERED
|
|
17689
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
17690
|
+
*/
|
|
17691
|
+
UNREGISTERED: 'UNREGISTERED',
|
|
17685
17692
|
|
|
17686
|
-
|
|
17687
|
-
|
|
17693
|
+
/**
|
|
17694
|
+
* Fires when {@link Session} receives an incoming call.
|
|
17695
|
+
*
|
|
17696
|
+
* @event INCOMING_CALL
|
|
17697
|
+
* @memberof Flashphoner.constants.SESSION_STATUS
|
|
17698
|
+
*/
|
|
17699
|
+
INCOMING_CALL: 'INCOMING_CALL'
|
|
17700
|
+
});
|
|
17688
17701
|
/**
|
|
17689
17702
|
* @namespace Flashphoner.constants.STREAM_STATUS
|
|
17690
17703
|
* @see Stream
|
|
17691
17704
|
*/
|
|
17692
17705
|
|
|
17693
|
-
var
|
|
17694
|
-
|
|
17695
|
-
|
|
17706
|
+
var STREAM_STATUS = Object.freeze({
|
|
17707
|
+
/**
|
|
17708
|
+
* State of newly created {@link Stream}.
|
|
17709
|
+
*
|
|
17710
|
+
* @event NEW
|
|
17711
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
17712
|
+
*/
|
|
17713
|
+
NEW: 'NEW',
|
|
17696
17714
|
|
|
17697
|
-
|
|
17698
|
-
|
|
17699
|
-
|
|
17700
|
-
|
|
17701
|
-
|
|
17702
|
-
|
|
17715
|
+
/**
|
|
17716
|
+
* State before {@link Stream} publishing/playing.
|
|
17717
|
+
*
|
|
17718
|
+
* @event PENDING
|
|
17719
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
17720
|
+
*/
|
|
17721
|
+
PENDING: 'PENDING',
|
|
17703
17722
|
|
|
17704
|
-
|
|
17705
|
-
|
|
17706
|
-
|
|
17707
|
-
|
|
17708
|
-
|
|
17709
|
-
|
|
17723
|
+
/**
|
|
17724
|
+
* Fires when {@link Stream} starts publishing.
|
|
17725
|
+
* @event PUBLISHING
|
|
17726
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
17727
|
+
*/
|
|
17728
|
+
PUBLISHING: 'PUBLISHING',
|
|
17710
17729
|
|
|
17711
|
-
|
|
17712
|
-
|
|
17713
|
-
|
|
17714
|
-
|
|
17715
|
-
|
|
17716
|
-
|
|
17730
|
+
/**
|
|
17731
|
+
* Fires when {@link Stream} starts playing.
|
|
17732
|
+
* @event PLAYING
|
|
17733
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
17734
|
+
*/
|
|
17735
|
+
PLAYING: 'PLAYING',
|
|
17717
17736
|
|
|
17718
|
-
|
|
17719
|
-
|
|
17720
|
-
|
|
17721
|
-
|
|
17722
|
-
|
|
17723
|
-
|
|
17737
|
+
/**
|
|
17738
|
+
* Fires if {@link Stream} paused.
|
|
17739
|
+
* @event PAUSED
|
|
17740
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
17741
|
+
*/
|
|
17742
|
+
PAUSED: 'PAUSED',
|
|
17724
17743
|
|
|
17725
|
-
|
|
17726
|
-
|
|
17727
|
-
|
|
17728
|
-
|
|
17729
|
-
|
|
17730
|
-
|
|
17744
|
+
/**
|
|
17745
|
+
* Fires if {@link Stream} was unpublished.
|
|
17746
|
+
* @event UNPUBLISHED
|
|
17747
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
17748
|
+
*/
|
|
17749
|
+
UNPUBLISHED: 'UNPUBLISHED',
|
|
17731
17750
|
|
|
17732
|
-
|
|
17733
|
-
|
|
17734
|
-
|
|
17735
|
-
|
|
17736
|
-
|
|
17737
|
-
|
|
17751
|
+
/**
|
|
17752
|
+
* Fires if playing {@link Stream} was stopped.
|
|
17753
|
+
* @event STOPPED
|
|
17754
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
17755
|
+
*/
|
|
17756
|
+
STOPPED: 'STOPPED',
|
|
17738
17757
|
|
|
17739
|
-
|
|
17740
|
-
|
|
17741
|
-
|
|
17742
|
-
|
|
17743
|
-
|
|
17744
|
-
|
|
17758
|
+
/**
|
|
17759
|
+
* Fires if {@link Stream} failed.
|
|
17760
|
+
* @event FAILED
|
|
17761
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
17762
|
+
*/
|
|
17763
|
+
FAILED: 'FAILED',
|
|
17745
17764
|
|
|
17746
|
-
|
|
17747
|
-
|
|
17748
|
-
|
|
17749
|
-
|
|
17750
|
-
|
|
17751
|
-
|
|
17765
|
+
/**
|
|
17766
|
+
* Fires if {@link Stream} playback problem.
|
|
17767
|
+
* @event PLAYBACK_PROBLEM
|
|
17768
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
17769
|
+
*/
|
|
17770
|
+
PLAYBACK_PROBLEM: 'PLAYBACK_PROBLEM',
|
|
17752
17771
|
|
|
17753
|
-
|
|
17754
|
-
|
|
17755
|
-
|
|
17756
|
-
|
|
17757
|
-
|
|
17758
|
-
|
|
17759
|
-
*/
|
|
17772
|
+
/**
|
|
17773
|
+
* Fires if playing {@link Stream} picture resizing.
|
|
17774
|
+
* @event RESIZE
|
|
17775
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
17776
|
+
*/
|
|
17777
|
+
RESIZE: 'RESIZE',
|
|
17760
17778
|
|
|
17761
|
-
|
|
17762
|
-
|
|
17763
|
-
|
|
17764
|
-
|
|
17765
|
-
|
|
17766
|
-
|
|
17779
|
+
/**
|
|
17780
|
+
* Fires when {@link Stream} snapshot becomes available.
|
|
17781
|
+
* Snapshot is base64 encoded png available through {@link Stream.getInfo}
|
|
17782
|
+
* @event SNAPSHOT_COMPLETE
|
|
17783
|
+
* @memberof Flashphoner.constants.STREAM_STATUS
|
|
17784
|
+
*/
|
|
17785
|
+
SNAPSHOT_COMPLETE: 'SNAPSHOT_COMPLETE',
|
|
17767
17786
|
|
|
17768
|
-
|
|
17787
|
+
/**
|
|
17788
|
+
* Fires on playing {@link Stream} if bitrate is higher than available network bandwidth.
|
|
17789
|
+
* @event NOT_ENOUGH_BANDWIDTH
|
|
17790
|
+
* @memberof Flashphoner.constants.NOT_ENOUGH_BANDWIDTH
|
|
17791
|
+
*/
|
|
17792
|
+
NOT_ENOUGH_BANDWIDTH: 'NOT_ENOUGH_BANDWIDTH'
|
|
17793
|
+
});
|
|
17769
17794
|
/**
|
|
17770
17795
|
* @namespace Flashphoner.constants.CALL_STATUS
|
|
17771
17796
|
* @see Call
|
|
17772
17797
|
*/
|
|
17773
17798
|
|
|
17774
|
-
var
|
|
17775
|
-
|
|
17776
|
-
|
|
17777
|
-
|
|
17778
|
-
|
|
17779
|
-
|
|
17780
|
-
|
|
17781
|
-
|
|
17782
|
-
|
|
17783
|
-
|
|
17784
|
-
|
|
17785
|
-
|
|
17786
|
-
|
|
17799
|
+
var CALL_STATUS = Object.freeze({
|
|
17800
|
+
/**
|
|
17801
|
+
* State of newly created {@link Call}
|
|
17802
|
+
* @event NEW
|
|
17803
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
17804
|
+
*/
|
|
17805
|
+
NEW: 'NEW',
|
|
17806
|
+
|
|
17807
|
+
/**
|
|
17808
|
+
* The server is ringing to the callee
|
|
17809
|
+
* @event RING
|
|
17810
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
17811
|
+
*/
|
|
17812
|
+
RING: 'RING',
|
|
17813
|
+
RING_MEDIA: 'RING_MEDIA',
|
|
17814
|
+
|
|
17815
|
+
/**
|
|
17816
|
+
* The {@link Call} was put on hold
|
|
17817
|
+
* @event HOLD
|
|
17818
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
17819
|
+
*/
|
|
17820
|
+
HOLD: 'HOLD',
|
|
17821
|
+
|
|
17822
|
+
/**
|
|
17823
|
+
* The {@link Call} is established
|
|
17824
|
+
* @event ESTABLISHED
|
|
17825
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
17826
|
+
*/
|
|
17827
|
+
ESTABLISHED: 'ESTABLISHED',
|
|
17828
|
+
|
|
17829
|
+
/**
|
|
17830
|
+
* The {@link Call} is finished
|
|
17831
|
+
* @event FINISH
|
|
17832
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
17833
|
+
*/
|
|
17834
|
+
FINISH: 'FINISH',
|
|
17835
|
+
|
|
17836
|
+
/**
|
|
17837
|
+
* Callee is busy
|
|
17838
|
+
* @event BUSY
|
|
17839
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
17840
|
+
*/
|
|
17841
|
+
BUSY: 'BUSY',
|
|
17842
|
+
|
|
17843
|
+
/**
|
|
17844
|
+
* SIP session is in progress
|
|
17845
|
+
* @event SESSION_PROGRESS
|
|
17846
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
17847
|
+
*/
|
|
17848
|
+
SESSION_PROGRESS: 'SESSION_PROGRESS',
|
|
17849
|
+
|
|
17850
|
+
/**
|
|
17851
|
+
* The {@link Call} is failed
|
|
17852
|
+
* @event FAILED
|
|
17853
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
17854
|
+
*/
|
|
17855
|
+
FAILED: 'FAILED',
|
|
17856
|
+
|
|
17857
|
+
/**
|
|
17858
|
+
* The {@link Call} state before ringing
|
|
17859
|
+
* @event PENDING
|
|
17860
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
17861
|
+
*/
|
|
17862
|
+
PENDING: 'PENDING',
|
|
17863
|
+
|
|
17864
|
+
/**
|
|
17865
|
+
* The server trying to establish {@link Call}
|
|
17866
|
+
* @event TRYING
|
|
17867
|
+
* @memberof Flashphoner.constants.CALL_STATUS
|
|
17868
|
+
*/
|
|
17869
|
+
TRYING: 'TRYING'
|
|
17870
|
+
});
|
|
17787
17871
|
/**
|
|
17788
17872
|
* @namespace Flashphoner.constants.STREAM_STATUS_INFO
|
|
17789
17873
|
* @see Stream
|
|
17790
17874
|
*/
|
|
17791
17875
|
|
|
17792
|
-
var
|
|
17793
|
-
/**
|
|
17794
|
-
|
|
17795
|
-
|
|
17796
|
-
|
|
17797
|
-
|
|
17798
|
-
|
|
17799
|
-
define(streamStatusInfo, 'FAILED_BY_ICE_ERROR', 'Failed by ICE error');
|
|
17800
|
-
/**
|
|
17801
|
-
* Timeout has been reached during ICE establishment.
|
|
17802
|
-
* @event FAILED_BY_ICE_TIMEOUT
|
|
17803
|
-
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
17804
|
-
*/
|
|
17876
|
+
var STREAM_STATUS_INFO = Object.freeze({
|
|
17877
|
+
/**
|
|
17878
|
+
* Indicates general error during ICE negotiation. Usually occurs if client is behind some exotic nat/firewall.
|
|
17879
|
+
* @event FAILED_BY_ICE_ERROR
|
|
17880
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
17881
|
+
*/
|
|
17882
|
+
FAILED_BY_ICE_ERROR: 'Failed by ICE error',
|
|
17805
17883
|
|
|
17806
|
-
|
|
17807
|
-
|
|
17808
|
-
|
|
17809
|
-
|
|
17810
|
-
|
|
17811
|
-
|
|
17884
|
+
/**
|
|
17885
|
+
* Timeout has been reached during ICE establishment.
|
|
17886
|
+
* @event FAILED_BY_ICE_TIMEOUT
|
|
17887
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
17888
|
+
*/
|
|
17889
|
+
FAILED_BY_ICE_TIMEOUT: 'Failed by ICE timeout',
|
|
17812
17890
|
|
|
17813
|
-
|
|
17814
|
-
|
|
17815
|
-
|
|
17816
|
-
|
|
17817
|
-
|
|
17818
|
-
|
|
17891
|
+
/**
|
|
17892
|
+
* ICE refresh failed on session.
|
|
17893
|
+
* @event FAILED_BY_KEEP_ALIVE
|
|
17894
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
17895
|
+
*/
|
|
17896
|
+
FAILED_BY_KEEP_ALIVE: 'Failed by ICE keep alive',
|
|
17819
17897
|
|
|
17820
|
-
|
|
17821
|
-
|
|
17822
|
-
|
|
17823
|
-
|
|
17824
|
-
|
|
17825
|
-
|
|
17898
|
+
/**
|
|
17899
|
+
* DTLS has wrong fingerprint.
|
|
17900
|
+
* @event FAILED_BY_DTLS_FINGERPRINT_ERROR
|
|
17901
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
17902
|
+
*/
|
|
17903
|
+
FAILED_BY_DTLS_FINGERPRINT_ERROR: 'Failed by DTLS fingerprint error',
|
|
17826
17904
|
|
|
17827
|
-
|
|
17828
|
-
|
|
17829
|
-
|
|
17830
|
-
|
|
17831
|
-
|
|
17832
|
-
|
|
17905
|
+
/**
|
|
17906
|
+
* Client did not send DTLS packets or packets were lost/corrupted during transmission.
|
|
17907
|
+
* @event FAILED_BY_DTLS_ERROR
|
|
17908
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
17909
|
+
*/
|
|
17910
|
+
FAILED_BY_DTLS_ERROR: 'Failed by DTLS error',
|
|
17833
17911
|
|
|
17834
|
-
|
|
17835
|
-
|
|
17836
|
-
|
|
17837
|
-
|
|
17838
|
-
|
|
17839
|
-
|
|
17912
|
+
/**
|
|
17913
|
+
* Indicates general HLS packetizer error, can occur during initialization or packetization (wrong input or out of disk space).
|
|
17914
|
+
* @event FAILED_BY_HLS_WRITER_ERROR
|
|
17915
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
17916
|
+
*/
|
|
17917
|
+
FAILED_BY_HLS_WRITER_ERROR: 'Failed by HLS writer error',
|
|
17840
17918
|
|
|
17841
|
-
|
|
17842
|
-
|
|
17843
|
-
|
|
17844
|
-
|
|
17845
|
-
|
|
17846
|
-
|
|
17919
|
+
/**
|
|
17920
|
+
* Indicates general RTMP republishing error, can occur during initialization or rtmp packetization.
|
|
17921
|
+
* @event FAILED_BY_RTMP_WRITER_ERROR
|
|
17922
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
17923
|
+
*/
|
|
17924
|
+
FAILED_BY_RTMP_WRITER_ERROR: 'Failed by RTMP writer error',
|
|
17847
17925
|
|
|
17848
|
-
|
|
17849
|
-
|
|
17850
|
-
|
|
17851
|
-
|
|
17852
|
-
|
|
17853
|
-
|
|
17926
|
+
/**
|
|
17927
|
+
* RTP session failed by RTP activity timer.
|
|
17928
|
+
* @event FAILED_BY_RTP_ACTIVITY
|
|
17929
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
17930
|
+
*/
|
|
17931
|
+
FAILED_BY_RTP_ACTIVITY: 'Failed by RTP activity',
|
|
17854
17932
|
|
|
17855
|
-
|
|
17856
|
-
|
|
17857
|
-
|
|
17858
|
-
|
|
17859
|
-
|
|
17860
|
-
|
|
17933
|
+
/**
|
|
17934
|
+
* Related session was disconnected.
|
|
17935
|
+
* @event STOPPED_BY_SESSION_DISCONNECT
|
|
17936
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
17937
|
+
*/
|
|
17938
|
+
STOPPED_BY_SESSION_DISCONNECT: 'Stopped by session disconnect',
|
|
17861
17939
|
|
|
17862
|
-
|
|
17863
|
-
|
|
17864
|
-
|
|
17865
|
-
|
|
17866
|
-
|
|
17867
|
-
|
|
17940
|
+
/**
|
|
17941
|
+
* Stream was stopped by rest terminate request.
|
|
17942
|
+
* @event STOPPED_BY_REST_TERMINATE
|
|
17943
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
17944
|
+
*/
|
|
17945
|
+
STOPPED_BY_REST_TERMINATE: 'Stopped by rest /terminate',
|
|
17868
17946
|
|
|
17869
|
-
|
|
17870
|
-
|
|
17871
|
-
|
|
17872
|
-
|
|
17873
|
-
|
|
17874
|
-
|
|
17947
|
+
/**
|
|
17948
|
+
* Related publisher stopped its stream or lost connection.
|
|
17949
|
+
* @event STOPPED_BY_PUBLISHER_STOP
|
|
17950
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
17951
|
+
*/
|
|
17952
|
+
STOPPED_BY_PUBLISHER_STOP: 'Stopped by publisher stop',
|
|
17875
17953
|
|
|
17876
|
-
|
|
17877
|
-
|
|
17878
|
-
|
|
17879
|
-
|
|
17880
|
-
|
|
17881
|
-
|
|
17954
|
+
/**
|
|
17955
|
+
* Stop the media session by user after call was finished or unpublish stream.
|
|
17956
|
+
* @event STOPPED_BY_USER
|
|
17957
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
17958
|
+
*/
|
|
17959
|
+
STOPPED_BY_USER: 'Stopped by user',
|
|
17882
17960
|
|
|
17883
|
-
|
|
17884
|
-
|
|
17885
|
-
|
|
17886
|
-
|
|
17887
|
-
|
|
17888
|
-
|
|
17961
|
+
/**
|
|
17962
|
+
* Error occurred on the stream.
|
|
17963
|
+
* @event FAILED_BY_ERROR
|
|
17964
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
17965
|
+
*/
|
|
17966
|
+
FAILED_BY_ERROR: 'Failed by error',
|
|
17889
17967
|
|
|
17890
|
-
|
|
17891
|
-
|
|
17892
|
-
|
|
17893
|
-
|
|
17894
|
-
|
|
17895
|
-
|
|
17968
|
+
/**
|
|
17969
|
+
* Indicates that error occurred during media session creation. This might be SDP parsing error, all ports are busy, wrong session related config etc.
|
|
17970
|
+
* @event FAILED_TO_ADD_STREAM_TO_PROXY
|
|
17971
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
17972
|
+
*/
|
|
17973
|
+
FAILED_TO_ADD_STREAM_TO_PROXY: 'Failed to add stream to proxy',
|
|
17896
17974
|
|
|
17897
|
-
|
|
17898
|
-
|
|
17899
|
-
|
|
17900
|
-
|
|
17901
|
-
|
|
17902
|
-
|
|
17975
|
+
/**
|
|
17976
|
+
* Stopped shapshot distributor.
|
|
17977
|
+
* @event DISTRIBUTOR_STOPPED
|
|
17978
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
17979
|
+
*/
|
|
17980
|
+
DISTRIBUTOR_STOPPED: 'Distributor stopped',
|
|
17903
17981
|
|
|
17904
|
-
|
|
17905
|
-
|
|
17906
|
-
|
|
17907
|
-
|
|
17908
|
-
|
|
17909
|
-
|
|
17982
|
+
/**
|
|
17983
|
+
* Publish stream is not ready, try again later.
|
|
17984
|
+
* @event PUBLISH_STREAM_IS_NOT_READY
|
|
17985
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
17986
|
+
*/
|
|
17987
|
+
PUBLISH_STREAM_IS_NOT_READY: 'Publish stream is not ready',
|
|
17910
17988
|
|
|
17911
|
-
|
|
17912
|
-
|
|
17913
|
-
|
|
17914
|
-
|
|
17915
|
-
|
|
17916
|
-
|
|
17989
|
+
/**
|
|
17990
|
+
* Stream with this name is not found, check the correct of the name.
|
|
17991
|
+
* @event STREAM_NOT_FOUND
|
|
17992
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
17993
|
+
*/
|
|
17994
|
+
STREAM_NOT_FOUND: 'Stream not found',
|
|
17917
17995
|
|
|
17918
|
-
|
|
17919
|
-
|
|
17920
|
-
|
|
17921
|
-
|
|
17922
|
-
|
|
17923
|
-
|
|
17996
|
+
/**
|
|
17997
|
+
* Server already has a publish stream with the same name, try using different one.
|
|
17998
|
+
* @event STREAM_NAME_ALREADY_IN_USE
|
|
17999
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18000
|
+
*/
|
|
18001
|
+
STREAM_NAME_ALREADY_IN_USE: 'Stream name is already in use',
|
|
17924
18002
|
|
|
17925
|
-
|
|
17926
|
-
|
|
17927
|
-
|
|
17928
|
-
|
|
17929
|
-
|
|
17930
|
-
|
|
18003
|
+
/**
|
|
18004
|
+
* Error indicates that stream object received by server has empty mediaSessionId field.
|
|
18005
|
+
* @event MEDIASESSION_ID_NULL
|
|
18006
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18007
|
+
*/
|
|
18008
|
+
MEDIASESSION_ID_NULL: 'MediaSessionId is null',
|
|
17931
18009
|
|
|
17932
|
-
|
|
17933
|
-
|
|
17934
|
-
|
|
17935
|
-
|
|
17936
|
-
|
|
17937
|
-
|
|
18010
|
+
/**
|
|
18011
|
+
* Published or subscribed sessions used this MediaSessionId.
|
|
18012
|
+
* @event MEDIASESSION_ID_ALREADY_IN_USE
|
|
18013
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18014
|
+
*/
|
|
18015
|
+
MEDIASESSION_ID_ALREADY_IN_USE: 'MediaSessionId is already in use',
|
|
17938
18016
|
|
|
17939
|
-
|
|
17940
|
-
|
|
17941
|
-
|
|
17942
|
-
|
|
17943
|
-
|
|
17944
|
-
|
|
18017
|
+
/**
|
|
18018
|
+
* Session is not initialized or terminated on play ordinary stream.
|
|
18019
|
+
* @event SESSION_NOT_READY
|
|
18020
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18021
|
+
*/
|
|
18022
|
+
SESSION_NOT_READY: 'Session not ready',
|
|
17945
18023
|
|
|
17946
|
-
|
|
17947
|
-
|
|
17948
|
-
|
|
17949
|
-
|
|
17950
|
-
|
|
17951
|
-
|
|
18024
|
+
/**
|
|
18025
|
+
* Actual session does not exist.
|
|
18026
|
+
* @event SESSION_DOES_NOT_EXIST
|
|
18027
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18028
|
+
*/
|
|
18029
|
+
SESSION_DOES_NOT_EXIST: 'Session does not exist',
|
|
17952
18030
|
|
|
17953
|
-
|
|
17954
|
-
|
|
17955
|
-
|
|
17956
|
-
|
|
17957
|
-
|
|
17958
|
-
|
|
18031
|
+
/**
|
|
18032
|
+
* RTSP has wrong format on play stream, check the RTSP url validity.
|
|
18033
|
+
* @event RTSP_HAS_WRONG_FORMAT
|
|
18034
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18035
|
+
*/
|
|
18036
|
+
RTSP_HAS_WRONG_FORMAT: 'Rtsp has wrong format',
|
|
17959
18037
|
|
|
17960
|
-
|
|
17961
|
-
|
|
17962
|
-
|
|
17963
|
-
|
|
17964
|
-
|
|
17965
|
-
|
|
18038
|
+
/**
|
|
18039
|
+
* Failed to play vod stream, this format is not supported.
|
|
18040
|
+
* @event FILE_HAS_WRONG_FORMAT
|
|
18041
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18042
|
+
*/
|
|
18043
|
+
FILE_HAS_WRONG_FORMAT: 'File has wrong format',
|
|
17966
18044
|
|
|
17967
|
-
|
|
17968
|
-
|
|
17969
|
-
|
|
17970
|
-
|
|
17971
|
-
|
|
17972
|
-
|
|
18045
|
+
/**
|
|
18046
|
+
* Failed to connect to rtsp stream.
|
|
18047
|
+
* @event FAILED_TO_CONNECT_TO_RTSP_STREAM
|
|
18048
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18049
|
+
*/
|
|
18050
|
+
FAILED_TO_CONNECT_TO_RTSP_STREAM: 'Failed to connect to rtsp stream',
|
|
17973
18051
|
|
|
17974
|
-
|
|
17975
|
-
|
|
17976
|
-
|
|
17977
|
-
|
|
17978
|
-
|
|
17979
|
-
|
|
18052
|
+
/**
|
|
18053
|
+
* Rtsp stream is not found, agent received "404-Not Found".
|
|
18054
|
+
* @event RTSP_STREAM_NOT_FOUND
|
|
18055
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18056
|
+
*/
|
|
18057
|
+
RTSP_STREAM_NOT_FOUND: 'Rtsp stream not found',
|
|
17980
18058
|
|
|
17981
|
-
|
|
17982
|
-
|
|
17983
|
-
|
|
17984
|
-
|
|
17985
|
-
|
|
17986
|
-
|
|
18059
|
+
/**
|
|
18060
|
+
* On shutdown RTSP agent.
|
|
18061
|
+
* @event RTSPAGENT_SHUTDOWN
|
|
18062
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18063
|
+
*/
|
|
18064
|
+
RTSPAGENT_SHUTDOWN: 'RtspAgent shutdown',
|
|
17987
18065
|
|
|
17988
|
-
|
|
17989
|
-
|
|
17990
|
-
|
|
17991
|
-
|
|
17992
|
-
|
|
17993
|
-
|
|
18066
|
+
/**
|
|
18067
|
+
* Stream failed
|
|
18068
|
+
* @event STREAM_FAILED
|
|
18069
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18070
|
+
*/
|
|
18071
|
+
STREAM_FAILED: 'Stream failed',
|
|
17994
18072
|
|
|
17995
|
-
|
|
17996
|
-
|
|
17997
|
-
|
|
17998
|
-
|
|
17999
|
-
|
|
18000
|
-
|
|
18073
|
+
/**
|
|
18074
|
+
* No common codecs on setup track, did not found corresponding trackId->mediaPort.
|
|
18075
|
+
* @event NO_COMMON_CODECS
|
|
18076
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18077
|
+
*/
|
|
18078
|
+
NO_COMMON_CODECS: 'No common codecs',
|
|
18001
18079
|
|
|
18002
|
-
|
|
18003
|
-
|
|
18004
|
-
|
|
18005
|
-
|
|
18006
|
-
|
|
18007
|
-
|
|
18080
|
+
/**
|
|
18081
|
+
* Bad referenced rtsp link, check for correct, example: rtsp://user:b@d_password@127.0.0.1/stream.
|
|
18082
|
+
* @event BAD_URI
|
|
18083
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18084
|
+
*/
|
|
18085
|
+
BAD_URI: 'Bad URI',
|
|
18008
18086
|
|
|
18009
|
-
|
|
18010
|
-
|
|
18011
|
-
|
|
18012
|
-
|
|
18013
|
-
|
|
18014
|
-
|
|
18087
|
+
/**
|
|
18088
|
+
* General VOD error, indicates that Exception occurred while reading/processing media file.
|
|
18089
|
+
* @event GOT_EXCEPTION_WHILE_STREAMING_FILE
|
|
18090
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18091
|
+
*/
|
|
18092
|
+
GOT_EXCEPTION_WHILE_STREAMING_FILE: 'Got exception while streaming file',
|
|
18015
18093
|
|
|
18016
|
-
|
|
18017
|
-
|
|
18018
|
-
|
|
18019
|
-
|
|
18020
|
-
|
|
18021
|
-
|
|
18094
|
+
/**
|
|
18095
|
+
* Requested stream shutdown.
|
|
18096
|
+
* @event REQUESTED_STREAM_SHUTDOWN
|
|
18097
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18098
|
+
*/
|
|
18099
|
+
REQUESTED_STREAM_SHUTDOWN: 'Requested stream shutdown',
|
|
18022
18100
|
|
|
18023
|
-
|
|
18024
|
-
|
|
18025
|
-
|
|
18026
|
-
|
|
18027
|
-
|
|
18028
|
-
|
|
18101
|
+
/**
|
|
18102
|
+
* Failed to create movie, file can not be read.
|
|
18103
|
+
* @event FAILED_TO_READ_FILE
|
|
18104
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18105
|
+
*/
|
|
18106
|
+
FAILED_TO_READ_FILE: 'Failed to read file',
|
|
18029
18107
|
|
|
18030
|
-
|
|
18031
|
-
|
|
18032
|
-
|
|
18033
|
-
|
|
18034
|
-
|
|
18035
|
-
|
|
18108
|
+
/**
|
|
18109
|
+
* File does not exist, check filename.
|
|
18110
|
+
* @event FILE_NOT_FOUND
|
|
18111
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18112
|
+
*/
|
|
18113
|
+
FILE_NOT_FOUND: 'File not found',
|
|
18036
18114
|
|
|
18037
|
-
|
|
18038
|
-
|
|
18039
|
-
|
|
18040
|
-
|
|
18041
|
-
|
|
18042
|
-
|
|
18115
|
+
/**
|
|
18116
|
+
* Server failed to establish websocket connection with origin server.
|
|
18117
|
+
* @event FAILED_TO_CONNECT_TO_ORIGIN_STREAM
|
|
18118
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18119
|
+
*/
|
|
18120
|
+
FAILED_TO_CONNECT_TO_ORIGIN_STREAM: 'Failed to connect to origin stream',
|
|
18043
18121
|
|
|
18044
|
-
|
|
18045
|
-
|
|
18046
|
-
|
|
18047
|
-
|
|
18048
|
-
|
|
18049
|
-
|
|
18050
|
-
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18051
|
-
*/
|
|
18122
|
+
/**
|
|
18123
|
+
* CDN stream not found.
|
|
18124
|
+
* @event CDN_STREAM_NOT_FOUND
|
|
18125
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18126
|
+
*/
|
|
18127
|
+
CDN_STREAM_NOT_FOUND: 'CDN stream not found',
|
|
18052
18128
|
|
|
18053
|
-
|
|
18054
|
-
|
|
18055
|
-
|
|
18056
|
-
|
|
18057
|
-
|
|
18058
|
-
|
|
18129
|
+
/**
|
|
18130
|
+
* Indicates that provided URL protocol in stream name is invalid.
|
|
18131
|
+
* Valid: vod://file.mp4
|
|
18132
|
+
* Invalid: dov://file.mp4
|
|
18133
|
+
* @event FAILED_TO_GET_AGENT_STORAGE
|
|
18134
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18135
|
+
*/
|
|
18136
|
+
FAILED_TO_GET_AGENT_STORAGE: 'Failed to get agent storage',
|
|
18059
18137
|
|
|
18060
|
-
|
|
18061
|
-
|
|
18062
|
-
|
|
18063
|
-
|
|
18064
|
-
|
|
18065
|
-
|
|
18138
|
+
/**
|
|
18139
|
+
* Shutdown agent servicing origin stream.
|
|
18140
|
+
* @event AGENT_SERVICING_ORIGIN_STREAM_IS_SHUTTING_DOWN
|
|
18141
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18142
|
+
*/
|
|
18143
|
+
AGENT_SERVICING_ORIGIN_STREAM_IS_SHUTTING_DOWN: 'Agent servicing origin stream is shutting down',
|
|
18066
18144
|
|
|
18067
|
-
|
|
18068
|
-
|
|
18069
|
-
|
|
18070
|
-
|
|
18071
|
-
|
|
18072
|
-
|
|
18145
|
+
/**
|
|
18146
|
+
* Terminated by keep-alive on walk through subscribers.
|
|
18147
|
+
* @event TERMINATED_BY_KEEP_ALIVE
|
|
18148
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18149
|
+
*/
|
|
18150
|
+
TERMINATED_BY_KEEP_ALIVE: 'Terminated by keep-alive',
|
|
18073
18151
|
|
|
18074
|
-
|
|
18075
|
-
|
|
18076
|
-
|
|
18077
|
-
|
|
18078
|
-
|
|
18079
|
-
|
|
18152
|
+
/**
|
|
18153
|
+
* Transcoding required, but disabled in server settings
|
|
18154
|
+
* @event TRANSCODING_REQUIRED_BUT_DISABLED
|
|
18155
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18156
|
+
*/
|
|
18157
|
+
TRANSCODING_REQUIRED_BUT_DISABLED: 'Transcoding required, but disabled',
|
|
18080
18158
|
|
|
18081
|
-
|
|
18082
|
-
|
|
18083
|
-
|
|
18084
|
-
|
|
18085
|
-
|
|
18086
|
-
|
|
18159
|
+
/**
|
|
18160
|
+
* Access restricted by access list
|
|
18161
|
+
* @event RESTRICTED_ACCESS
|
|
18162
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18163
|
+
*/
|
|
18164
|
+
RESTRICTED_ACCESS: 'Restricted access',
|
|
18087
18165
|
|
|
18088
|
-
|
|
18166
|
+
/**
|
|
18167
|
+
* No available transcoders for stream
|
|
18168
|
+
* @event NO_AVAILABLE_TRANSCODERS
|
|
18169
|
+
* @memberof Flashphoner.constants.STREAM_STATUS_INFO
|
|
18170
|
+
*/
|
|
18171
|
+
NO_AVAILABLE_TRANSCODERS: 'No available transcoders'
|
|
18172
|
+
});
|
|
18089
18173
|
/**
|
|
18090
18174
|
* @namespace Flashphoner.constants.CALL_STATUS_INFO
|
|
18091
18175
|
* @see Call
|
|
18092
18176
|
*/
|
|
18093
18177
|
|
|
18094
|
-
var
|
|
18095
|
-
/**
|
|
18096
|
-
|
|
18097
|
-
|
|
18098
|
-
|
|
18099
|
-
|
|
18100
|
-
|
|
18101
|
-
define(callStatusInfo, 'NORMAL_CALL_CLEARING', 'Normal call clearing');
|
|
18102
|
-
/**
|
|
18103
|
-
* Error occurred on session creation.
|
|
18104
|
-
* @event FAILED_BY_SESSION_CREATION
|
|
18105
|
-
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
18106
|
-
*/
|
|
18178
|
+
var CALL_STATUS_INFO = Object.freeze({
|
|
18179
|
+
/**
|
|
18180
|
+
* Normal call hangup.
|
|
18181
|
+
* @event NORMAL_CALL_CLEARING
|
|
18182
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
18183
|
+
*/
|
|
18184
|
+
NORMAL_CALL_CLEARING: 'Normal call clearing',
|
|
18107
18185
|
|
|
18108
|
-
|
|
18109
|
-
|
|
18110
|
-
|
|
18111
|
-
|
|
18112
|
-
|
|
18113
|
-
|
|
18186
|
+
/**
|
|
18187
|
+
* Error occurred while creating a session
|
|
18188
|
+
* @event FAILED_BY_SESSION_CREATION
|
|
18189
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
18190
|
+
*/
|
|
18191
|
+
FAILED_BY_SESSION_CREATION: 'Failed by session creation',
|
|
18114
18192
|
|
|
18115
|
-
|
|
18116
|
-
|
|
18117
|
-
|
|
18118
|
-
|
|
18119
|
-
|
|
18120
|
-
|
|
18193
|
+
/**
|
|
18194
|
+
* Failed by error during ICE establishment.
|
|
18195
|
+
* @event FAILED_BY_ICE_ERROR
|
|
18196
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
18197
|
+
*/
|
|
18198
|
+
FAILED_BY_ICE_ERROR: 'Failed by ICE error',
|
|
18121
18199
|
|
|
18122
|
-
|
|
18123
|
-
|
|
18124
|
-
|
|
18125
|
-
|
|
18126
|
-
|
|
18127
|
-
|
|
18200
|
+
/**
|
|
18201
|
+
* RTP session failed by RTP activity timer.
|
|
18202
|
+
* @event FAILED_BY_RTP_ACTIVITY
|
|
18203
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
18204
|
+
*/
|
|
18205
|
+
FAILED_BY_RTP_ACTIVITY: 'Failed by RTP activity',
|
|
18128
18206
|
|
|
18129
|
-
|
|
18130
|
-
|
|
18131
|
-
|
|
18132
|
-
|
|
18133
|
-
|
|
18134
|
-
|
|
18207
|
+
/**
|
|
18208
|
+
* FF writer was failed on RTMP.
|
|
18209
|
+
* @event FAILED_BY_RTMP_WRITER_ERROR
|
|
18210
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
18211
|
+
*/
|
|
18212
|
+
FAILED_BY_RTMP_WRITER_ERROR: 'Failed by RTMP writer error',
|
|
18135
18213
|
|
|
18136
|
-
|
|
18137
|
-
|
|
18138
|
-
|
|
18139
|
-
|
|
18140
|
-
|
|
18141
|
-
|
|
18214
|
+
/**
|
|
18215
|
+
* DTLS wrong fingerprint.
|
|
18216
|
+
* @event FAILED_BY_DTLS_FINGERPRINT_ERROR
|
|
18217
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
18218
|
+
*/
|
|
18219
|
+
FAILED_BY_DTLS_FINGERPRINT_ERROR: 'Failed by DTLS fingerprint error',
|
|
18142
18220
|
|
|
18143
|
-
|
|
18144
|
-
|
|
18145
|
-
|
|
18146
|
-
|
|
18147
|
-
|
|
18148
|
-
|
|
18221
|
+
/**
|
|
18222
|
+
* No common codecs in sdp
|
|
18223
|
+
* @event NO_COMMON_CODECS
|
|
18224
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
18225
|
+
*/
|
|
18226
|
+
NO_COMMON_CODECS: 'No common codecs',
|
|
18149
18227
|
|
|
18150
|
-
|
|
18151
|
-
|
|
18152
|
-
|
|
18153
|
-
|
|
18154
|
-
|
|
18155
|
-
|
|
18228
|
+
/**
|
|
18229
|
+
* Client did not send DTLS packets or packets were lost/corrupted during transmission.
|
|
18230
|
+
* @event FAILED_BY_DTLS_ERROR
|
|
18231
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
18232
|
+
*/
|
|
18233
|
+
FAILED_BY_DTLS_ERROR: 'Failed by DTLS error',
|
|
18156
18234
|
|
|
18157
|
-
|
|
18158
|
-
|
|
18159
|
-
|
|
18160
|
-
|
|
18161
|
-
|
|
18162
|
-
|
|
18235
|
+
/**
|
|
18236
|
+
* Error occurred during the call
|
|
18237
|
+
* @event FAILED_BY_ERROR
|
|
18238
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
18239
|
+
*/
|
|
18240
|
+
FAILED_BY_ERROR: 'Failed by error',
|
|
18163
18241
|
|
|
18164
|
-
|
|
18165
|
-
|
|
18166
|
-
|
|
18167
|
-
|
|
18168
|
-
|
|
18169
|
-
|
|
18242
|
+
/**
|
|
18243
|
+
* Call failed by request timeout
|
|
18244
|
+
* @event FAILED_BY_REQUEST_TIMEOUT
|
|
18245
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
18246
|
+
*/
|
|
18247
|
+
FAILED_BY_REQUEST_TIMEOUT: 'Failed by request timeout',
|
|
18170
18248
|
|
|
18171
|
-
|
|
18249
|
+
/**
|
|
18250
|
+
* Transcoding required, but disabled in settings
|
|
18251
|
+
* @event TRANSCODING_REQUIRED_BUT_DISABLED
|
|
18252
|
+
* @memberof Flashphoner.constants.CALL_STATUS_INFO
|
|
18253
|
+
*/
|
|
18254
|
+
TRANSCODING_REQUIRED_BUT_DISABLED: 'Transcoding required, but disabled'
|
|
18255
|
+
});
|
|
18172
18256
|
/**
|
|
18173
18257
|
* @namespace Flashphoner.constants.ERROR_INFO
|
|
18174
18258
|
*/
|
|
18175
18259
|
|
|
18176
|
-
var
|
|
18177
|
-
/**
|
|
18178
|
-
|
|
18179
|
-
|
|
18180
|
-
|
|
18181
|
-
|
|
18260
|
+
var ERROR_INFO = Object.freeze({
|
|
18261
|
+
/**
|
|
18262
|
+
* Error if none of MediaProviders available
|
|
18263
|
+
* @event NONE_OF_MEDIAPROVIDERS_AVAILABLE
|
|
18264
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
18265
|
+
*/
|
|
18266
|
+
NONE_OF_MEDIAPROVIDERS_AVAILABLE: 'None of MediaProviders available',
|
|
18267
|
+
|
|
18268
|
+
/**
|
|
18269
|
+
* Error if none of preferred MediaProviders available
|
|
18270
|
+
* @event NONE_OF_PREFERRED_MEDIAPROVIDERS_AVAILABLE
|
|
18271
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
18272
|
+
*/
|
|
18273
|
+
NONE_OF_PREFERRED_MEDIAPROVIDERS_AVAILABLE: 'None of preferred MediaProviders available',
|
|
18182
18274
|
|
|
18183
|
-
|
|
18275
|
+
/**
|
|
18276
|
+
* Error if API is not initialized
|
|
18277
|
+
* @event FLASHPHONER_API_NOT_INITIALIZED
|
|
18278
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
18279
|
+
*/
|
|
18280
|
+
FLASHPHONER_API_NOT_INITIALIZED: 'Flashphoner API is not initialized',
|
|
18281
|
+
|
|
18282
|
+
/**
|
|
18283
|
+
* Error if options.urlServer is not specified
|
|
18284
|
+
* @event OPTIONS_URLSERVER_MUST_BE_PROVIDED
|
|
18285
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
18286
|
+
*/
|
|
18287
|
+
OPTIONS_URLSERVER_MUST_BE_PROVIDED: 'options.urlServer must be provided',
|
|
18288
|
+
|
|
18289
|
+
/**
|
|
18290
|
+
* Error if session state is not valid
|
|
18291
|
+
* @event INVALID_SESSION_STATE
|
|
18292
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
18293
|
+
*/
|
|
18294
|
+
INVALID_SESSION_STATE: 'Invalid session state',
|
|
18295
|
+
|
|
18296
|
+
/**
|
|
18297
|
+
* Error if no options provided
|
|
18298
|
+
* @event OPTIONS_MUST_BE_PROVIDED
|
|
18299
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
18300
|
+
*/
|
|
18301
|
+
OPTIONS_MUST_BE_PROVIDED: 'options must be provided',
|
|
18302
|
+
|
|
18303
|
+
/**
|
|
18304
|
+
* Error if call status is not {@link Flashphoner.constants.CALL_STATUS.NEW}
|
|
18305
|
+
* @event INVALID_CALL_STATE
|
|
18306
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
18307
|
+
*/
|
|
18308
|
+
INVALID_CALL_STATE: 'Invalid call state',
|
|
18309
|
+
|
|
18310
|
+
/**
|
|
18311
|
+
* Error if event is not specified
|
|
18312
|
+
* @event EVENT_CANT_BE_NULL
|
|
18313
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
18314
|
+
*/
|
|
18315
|
+
EVENT_CANT_BE_NULL: 'Event can\'t be null',
|
|
18316
|
+
|
|
18317
|
+
/**
|
|
18318
|
+
* Error if callback is not a valid function
|
|
18319
|
+
* @event CALLBACK_NEEDS_TO_BE_A_VALID_FUNCTION
|
|
18320
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
18321
|
+
*/
|
|
18322
|
+
CALLBACK_NEEDS_TO_BE_A_VALID_FUNCTION: 'Callback needs to be a valid function',
|
|
18323
|
+
|
|
18324
|
+
/**
|
|
18325
|
+
* Error if options.name is not specified
|
|
18326
|
+
* @event OPTIONS_NAME_MUST_BE_PROVIDED
|
|
18327
|
+
* @memberof Flashphoner.constants.ERROR_INFO
|
|
18328
|
+
*/
|
|
18329
|
+
OPTIONS_NAME_MUST_BE_PROVIDED: 'options.name must be provided',
|
|
18330
|
+
|
|
18331
|
+
/**
|
|
18332
|
+
* Error if number of cams is less than 2 or camera is already used by other application
|
|
18333
|
+
* @event CAN_NOT_SWITCH_CAM
|
|
18334
|
+
* @memberOf Flashphoner.constants.ERROR_INFO
|
|
18335
|
+
*/
|
|
18336
|
+
CAN_NOT_SWITCH_CAM: 'Number of cams is less than 2 or camera is already used by other application',
|
|
18337
|
+
|
|
18338
|
+
/**
|
|
18339
|
+
* Error if number of mics is less than 2 or microphone is already used by other application
|
|
18340
|
+
* @event CAN_NOT_SWITCH_MIC
|
|
18341
|
+
* @memberOf Flashphoner.constants.ERROR_INFO
|
|
18342
|
+
*/
|
|
18343
|
+
CAN_NOT_SWITCH_MIC: 'Number of mics is less than 2 or microphone is already used by other application',
|
|
18344
|
+
|
|
18345
|
+
/**
|
|
18346
|
+
* Local browser error detected
|
|
18347
|
+
* @event LOCAL_ERROR
|
|
18348
|
+
* @memberOf Flashphoner.constants.ERROR_INFO
|
|
18349
|
+
*/
|
|
18350
|
+
LOCAL_ERROR: 'Local error'
|
|
18351
|
+
});
|
|
18184
18352
|
/**
|
|
18185
|
-
*
|
|
18186
|
-
* @
|
|
18187
|
-
* @memberof Flashphoner.constants.ERROR_INFO
|
|
18353
|
+
* Local media devices type
|
|
18354
|
+
* @namespace Flashphoner.constants.MEDIA_DEVICE_KIND
|
|
18188
18355
|
*/
|
|
18189
18356
|
|
|
18190
|
-
|
|
18357
|
+
var MEDIA_DEVICE_KIND = Object.freeze({
|
|
18358
|
+
/**
|
|
18359
|
+
* List local media output devices
|
|
18360
|
+
* @see Flashphoner.getMediaDevices
|
|
18361
|
+
* @memberOf Flashphoner.constants.MEDIA_DEVICE_KIND
|
|
18362
|
+
*/
|
|
18363
|
+
OUTPUT: 'output',
|
|
18364
|
+
|
|
18365
|
+
/**
|
|
18366
|
+
* List local media input devices
|
|
18367
|
+
* @see Flashphoner.getMediaDevices
|
|
18368
|
+
* @memberOf Flashphoner.constants.MEDIA_DEVICE_KIND
|
|
18369
|
+
*/
|
|
18370
|
+
INPUT: 'input',
|
|
18371
|
+
|
|
18372
|
+
/**
|
|
18373
|
+
* List local media devices
|
|
18374
|
+
* @see Flashphoner.getMediaDevices
|
|
18375
|
+
* @memberOf Flashphoner.constants.MEDIA_DEVICE_KIND
|
|
18376
|
+
*/
|
|
18377
|
+
ALL: 'all'
|
|
18378
|
+
});
|
|
18191
18379
|
/**
|
|
18192
|
-
*
|
|
18193
|
-
* @
|
|
18194
|
-
* @memberof Flashphoner.constants.ERROR_INFO
|
|
18380
|
+
* WebRTC transport type
|
|
18381
|
+
* @namespace Flashphoner.constants.TRANSPORT_TYPE
|
|
18195
18382
|
*/
|
|
18196
18383
|
|
|
18197
|
-
|
|
18384
|
+
var TRANSPORT_TYPE = Object.freeze({
|
|
18385
|
+
/**
|
|
18386
|
+
* WebRTC RTP traffic goes over UDP (default)
|
|
18387
|
+
* @see Stream
|
|
18388
|
+
* @memberOf Flashphoner.constants.TRANSPORT_TYPE
|
|
18389
|
+
*/
|
|
18390
|
+
UDP: 'UDP',
|
|
18391
|
+
|
|
18392
|
+
/**
|
|
18393
|
+
* WebRTC RTP traffic goes over TCP
|
|
18394
|
+
* @see Stream
|
|
18395
|
+
* @memberOf Flashphoner.constants.TRANSPORT_TYPE
|
|
18396
|
+
*/
|
|
18397
|
+
TCP: 'TCP'
|
|
18398
|
+
});
|
|
18198
18399
|
/**
|
|
18199
|
-
*
|
|
18200
|
-
* @
|
|
18201
|
-
* @memberof Flashphoner.constants.ERROR_INFO
|
|
18400
|
+
* WebRTC connection quality type
|
|
18401
|
+
* @namespace Flashphoner.constants.CONNECTION_QUALITY
|
|
18202
18402
|
*/
|
|
18203
18403
|
|
|
18204
|
-
|
|
18205
|
-
/**
|
|
18206
|
-
|
|
18207
|
-
|
|
18208
|
-
|
|
18209
|
-
|
|
18404
|
+
var CONNECTION_QUALITY = Object.freeze({
|
|
18405
|
+
/**
|
|
18406
|
+
* Channel bandwidth is perfect
|
|
18407
|
+
* @see Stream
|
|
18408
|
+
* @memberOf Flashphoner.constants.CONNECTION_QUALITY
|
|
18409
|
+
*/
|
|
18410
|
+
PERFECT: 'PERFECT',
|
|
18411
|
+
|
|
18412
|
+
/**
|
|
18413
|
+
* Channel bandwidth is good
|
|
18414
|
+
* @see Stream
|
|
18415
|
+
* @memberOf Flashphoner.constants.CONNECTION_QUALITY
|
|
18416
|
+
*/
|
|
18417
|
+
GOOD: 'GOOD',
|
|
18210
18418
|
|
|
18211
|
-
|
|
18212
|
-
|
|
18213
|
-
|
|
18214
|
-
|
|
18215
|
-
|
|
18216
|
-
|
|
18419
|
+
/**
|
|
18420
|
+
* Channel bandwidth is bad
|
|
18421
|
+
* @see Stream
|
|
18422
|
+
* @memberOf Flashphoner.constants.CONNECTION_QUALITY
|
|
18423
|
+
*/
|
|
18424
|
+
BAD: 'BAD',
|
|
18217
18425
|
|
|
18218
|
-
|
|
18219
|
-
|
|
18220
|
-
|
|
18221
|
-
|
|
18222
|
-
|
|
18223
|
-
|
|
18426
|
+
/**
|
|
18427
|
+
* Channel bandwidth is unknown (initial state)
|
|
18428
|
+
* @see Stream
|
|
18429
|
+
* @memberOf Flashphoner.constants.CONNECTION_QUALITY
|
|
18430
|
+
*/
|
|
18431
|
+
UNKNOWN: 'UNKNOWN',
|
|
18224
18432
|
|
|
18225
|
-
|
|
18433
|
+
/**
|
|
18434
|
+
* Channel bandwidth is updating
|
|
18435
|
+
* @see Stream
|
|
18436
|
+
* @memberOf Flashphoner.constants.CONNECTION_QUALITY
|
|
18437
|
+
*/
|
|
18438
|
+
UPDATE: 'UPDATE'
|
|
18439
|
+
});
|
|
18226
18440
|
/**
|
|
18227
|
-
*
|
|
18228
|
-
* @
|
|
18229
|
-
* @
|
|
18441
|
+
* Websocket signaling stream event
|
|
18442
|
+
* @see Stream
|
|
18443
|
+
* @memberOf Flashphoner.constants
|
|
18230
18444
|
*/
|
|
18231
18445
|
|
|
18232
|
-
|
|
18446
|
+
var STREAM_EVENT = 'STREAM_EVENT';
|
|
18233
18447
|
/**
|
|
18234
|
-
*
|
|
18235
|
-
* @
|
|
18236
|
-
* @memberof Flashphoner.constants.ERROR_INFO
|
|
18448
|
+
* Websocket signaling stream event type
|
|
18449
|
+
* @namespace Flashphoner.constants.STREAM_EVENT_TYPE
|
|
18237
18450
|
*/
|
|
18238
18451
|
|
|
18239
|
-
|
|
18240
|
-
/**
|
|
18241
|
-
|
|
18242
|
-
|
|
18243
|
-
|
|
18244
|
-
|
|
18452
|
+
var STREAM_EVENT_TYPE = Object.freeze({
|
|
18453
|
+
/**
|
|
18454
|
+
* Stream audio is muted
|
|
18455
|
+
* @see Stream
|
|
18456
|
+
* @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
|
|
18457
|
+
*/
|
|
18458
|
+
AUDIO_MUTED: 'audioMuted',
|
|
18245
18459
|
|
|
18246
|
-
|
|
18247
|
-
|
|
18248
|
-
|
|
18249
|
-
|
|
18250
|
-
|
|
18251
|
-
|
|
18460
|
+
/**
|
|
18461
|
+
* Stream audio is unmuted
|
|
18462
|
+
* @see Stream
|
|
18463
|
+
* @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
|
|
18464
|
+
*/
|
|
18465
|
+
AUDIO_UNMUTED: 'audioUnmuted',
|
|
18252
18466
|
|
|
18253
|
-
|
|
18254
|
-
|
|
18255
|
-
|
|
18256
|
-
|
|
18257
|
-
|
|
18258
|
-
|
|
18467
|
+
/**
|
|
18468
|
+
* Stream video is muted
|
|
18469
|
+
* @see Stream
|
|
18470
|
+
* @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
|
|
18471
|
+
*/
|
|
18472
|
+
VIDEO_MUTED: 'videoMuted',
|
|
18259
18473
|
|
|
18260
|
-
|
|
18261
|
-
|
|
18262
|
-
|
|
18263
|
-
|
|
18264
|
-
|
|
18265
|
-
|
|
18474
|
+
/**
|
|
18475
|
+
* Stream videoo is unmuted
|
|
18476
|
+
* @see Stream
|
|
18477
|
+
* @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
|
|
18478
|
+
*/
|
|
18479
|
+
VIDEO_UNMUTED: 'videoUnmuted',
|
|
18266
18480
|
|
|
18267
|
-
|
|
18481
|
+
/**
|
|
18482
|
+
* Data bound to the stream are received
|
|
18483
|
+
* @see Stream
|
|
18484
|
+
* @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
|
|
18485
|
+
*/
|
|
18486
|
+
DATA: 'data'
|
|
18487
|
+
});
|
|
18268
18488
|
/**
|
|
18269
|
-
*
|
|
18270
|
-
* @
|
|
18271
|
-
* @memberOf Flashphoner.constants.ERROR_INFO
|
|
18489
|
+
* WebRTC video content hint type
|
|
18490
|
+
* @namespace Flashphoner.constants.CONTENT_HINT_TYPE
|
|
18272
18491
|
*/
|
|
18273
18492
|
|
|
18274
|
-
|
|
18275
|
-
|
|
18276
|
-
|
|
18277
|
-
|
|
18278
|
-
|
|
18279
|
-
|
|
18280
|
-
|
|
18281
|
-
|
|
18282
|
-
|
|
18283
|
-
|
|
18284
|
-
|
|
18285
|
-
|
|
18286
|
-
|
|
18287
|
-
|
|
18288
|
-
var streamEventType = {};
|
|
18289
|
-
define(streamEventType, 'AUDIO_MUTED', 'audioMuted');
|
|
18290
|
-
define(streamEventType, 'AUDIO_UNMUTED', 'audioUnmuted');
|
|
18291
|
-
define(streamEventType, 'VIDEO_MUTED', 'videoMuted');
|
|
18292
|
-
define(streamEventType, 'VIDEO_UNMUTED', 'videoUnmuted');
|
|
18293
|
-
define(streamEventType, 'DATA', 'data');
|
|
18294
|
-
var contentHintType = {};
|
|
18295
|
-
define(contentHintType, 'MOTION', 'motion');
|
|
18296
|
-
define(contentHintType, 'DETAIL', 'detail');
|
|
18297
|
-
define(contentHintType, 'TEXT', 'text');
|
|
18298
|
-
var constants = {};
|
|
18299
|
-
define(constants, 'SESSION_STATUS', sessionStatus);
|
|
18300
|
-
define(constants, 'STREAM_EVENT_TYPE', streamEventType);
|
|
18301
|
-
define(constants, 'STREAM_EVENT', 'STREAM_EVENT');
|
|
18302
|
-
define(constants, 'STREAM_STATUS', streamStatus);
|
|
18303
|
-
define(constants, 'CALL_STATUS', callStatus);
|
|
18304
|
-
define(constants, 'STREAM_STATUS_INFO', streamStatusInfo);
|
|
18305
|
-
define(constants, 'CALL_STATUS_INFO', callStatusInfo);
|
|
18306
|
-
define(constants, 'ERROR_INFO', errorInfo);
|
|
18307
|
-
define(constants, 'MEDIA_DEVICE_KIND', mediaDeviceKind);
|
|
18308
|
-
define(constants, 'TRANSPORT_TYPE', transportType);
|
|
18309
|
-
define(constants, 'CONNECTION_QUALITY', connectionQuality);
|
|
18310
|
-
define(constants, 'CONTENT_HINT_TYPE', contentHintType); //define helper
|
|
18311
|
-
|
|
18312
|
-
function define(obj, name, value) {
|
|
18313
|
-
Object.defineProperty(obj, name, {
|
|
18314
|
-
value: value,
|
|
18315
|
-
enumerable: true
|
|
18316
|
-
});
|
|
18317
|
-
}
|
|
18493
|
+
var CONTENT_HINT_TYPE = Object.freeze({
|
|
18494
|
+
/**
|
|
18495
|
+
* Video content is motion (webcam case): keep FPS, resolution and bitrate may change
|
|
18496
|
+
* @see Stream
|
|
18497
|
+
* @memberOf Flashphoner.constants.CONTENT_HINT_TYPE
|
|
18498
|
+
*/
|
|
18499
|
+
MOTION: 'motion',
|
|
18500
|
+
|
|
18501
|
+
/**
|
|
18502
|
+
* Video content is detail (sreen sharing case): keep resolution, bitrate may change, FPS may drop
|
|
18503
|
+
* @see Stream
|
|
18504
|
+
* @memberOf Flashphoner.constants.CONTENT_HINT_TYPE
|
|
18505
|
+
*/
|
|
18506
|
+
DETAIL: 'detail',
|
|
18318
18507
|
|
|
18319
|
-
|
|
18508
|
+
/**
|
|
18509
|
+
* Video content is text (sreen sharing case): keep resolution and bitrate, FPS may drop
|
|
18510
|
+
* @see Stream
|
|
18511
|
+
* @memberOf Flashphoner.constants.CONTENT_HINT_TYPE
|
|
18512
|
+
*/
|
|
18513
|
+
TEXT: 'text'
|
|
18514
|
+
});
|
|
18515
|
+
module.exports = {
|
|
18516
|
+
SESSION_STATUS: SESSION_STATUS,
|
|
18517
|
+
STREAM_STATUS: STREAM_STATUS,
|
|
18518
|
+
CALL_STATUS: CALL_STATUS,
|
|
18519
|
+
STREAM_STATUS_INFO: STREAM_STATUS_INFO,
|
|
18520
|
+
CALL_STATUS_INFO: CALL_STATUS_INFO,
|
|
18521
|
+
ERROR_INFO: ERROR_INFO,
|
|
18522
|
+
MEDIA_DEVICE_KIND: MEDIA_DEVICE_KIND,
|
|
18523
|
+
TRANSPORT_TYPE: TRANSPORT_TYPE,
|
|
18524
|
+
CONNECTION_QUALITY: CONNECTION_QUALITY,
|
|
18525
|
+
STREAM_EVENT: STREAM_EVENT,
|
|
18526
|
+
STREAM_EVENT_TYPE: STREAM_EVENT_TYPE,
|
|
18527
|
+
CONTENT_HINT_TYPE: CONTENT_HINT_TYPE
|
|
18528
|
+
};
|
|
18320
18529
|
|
|
18321
18530
|
},{}],42:[function(require,module,exports){
|
|
18322
18531
|
'use strict';
|
|
@@ -18344,7 +18553,12 @@ var createConnection = function createConnection(options) {
|
|
|
18344
18553
|
var id = options.id;
|
|
18345
18554
|
var authToken = options.authToken;
|
|
18346
18555
|
var display = options.display || options.localDisplay;
|
|
18347
|
-
var flashBufferTime = options.flashBufferTime || 0;
|
|
18556
|
+
var flashBufferTime = options.flashBufferTime || 0; // Set connection logger #WCS-2434
|
|
18557
|
+
|
|
18558
|
+
if (options.logger) {
|
|
18559
|
+
logger = options.logger;
|
|
18560
|
+
}
|
|
18561
|
+
|
|
18348
18562
|
var url = getConnectionUrl(options.mainUrl, options.flashProto, options.flashPort); //todo state from flash instance
|
|
18349
18563
|
|
|
18350
18564
|
var state = function state() {
|
|
@@ -18965,8 +19179,9 @@ var constants = require("./constants");
|
|
|
18965
19179
|
|
|
18966
19180
|
var util = require('./util');
|
|
18967
19181
|
|
|
18968
|
-
var
|
|
19182
|
+
var LoggerObject = require('./util').logger;
|
|
18969
19183
|
|
|
19184
|
+
var coreLogger;
|
|
18970
19185
|
var loggerConf = {
|
|
18971
19186
|
push: false,
|
|
18972
19187
|
severity: "INFO"
|
|
@@ -19014,7 +19229,7 @@ var disableConnectionQualityCalculation;
|
|
|
19014
19229
|
* @param {String=} options.decoderLocation Location of video-worker2.js file
|
|
19015
19230
|
* @param {String=} options.screenSharingExtensionId Chrome screen sharing extension id
|
|
19016
19231
|
* @param {Object=} options.constraints Default local media constraints
|
|
19017
|
-
* @param {Object=} options.logger
|
|
19232
|
+
* @param {Object=} options.logger Core logger options
|
|
19018
19233
|
* @throws {Error} Error if none of MediaProviders available
|
|
19019
19234
|
* @memberof Flashphoner
|
|
19020
19235
|
*/
|
|
@@ -19023,16 +19238,10 @@ var init = function init(options) {
|
|
|
19023
19238
|
if (!initialized) {
|
|
19024
19239
|
if (!options) {
|
|
19025
19240
|
options = {};
|
|
19026
|
-
}
|
|
19027
|
-
|
|
19028
|
-
loggerConf = options.logger || loggerConf;
|
|
19241
|
+
} // init global logger
|
|
19029
19242
|
|
|
19030
|
-
if (options.logger !== null) {
|
|
19031
|
-
loggerConf.enableLogs = true;
|
|
19032
|
-
} // init logger
|
|
19033
19243
|
|
|
19034
|
-
|
|
19035
|
-
logger.init(loggerConf.severity || "INFO", loggerConf.push || false, loggerConf.customLogger, loggerConf.enableLogs);
|
|
19244
|
+
coreLogger = createLogger(options.logger);
|
|
19036
19245
|
var waitingTemasys = false;
|
|
19037
19246
|
|
|
19038
19247
|
try {
|
|
@@ -19053,7 +19262,7 @@ var init = function init(options) {
|
|
|
19053
19262
|
constraints: options.constraints || getDefaultMediaConstraints(),
|
|
19054
19263
|
extensionId: options.screenSharingExtensionId,
|
|
19055
19264
|
audioContext: audioContext,
|
|
19056
|
-
logger:
|
|
19265
|
+
logger: coreLogger,
|
|
19057
19266
|
createMicGainNode: enableGainNode
|
|
19058
19267
|
};
|
|
19059
19268
|
webRtcProvider.configure(webRtcConf);
|
|
@@ -19070,7 +19279,7 @@ var init = function init(options) {
|
|
|
19070
19279
|
var webRtcConf = {
|
|
19071
19280
|
constraints: options.constraints || getDefaultMediaConstraints(),
|
|
19072
19281
|
extensionId: options.screenSharingExtensionId,
|
|
19073
|
-
logger:
|
|
19282
|
+
logger: coreLogger
|
|
19074
19283
|
};
|
|
19075
19284
|
webRtcProvider.configure(webRtcConf); // Just reorder media provider list
|
|
19076
19285
|
|
|
@@ -19098,7 +19307,7 @@ var init = function init(options) {
|
|
|
19098
19307
|
var flashConf = {
|
|
19099
19308
|
constraints: options.constraints || getDefaultMediaConstraints(),
|
|
19100
19309
|
flashMediaProviderSwfLocation: options.flashMediaProviderSwfLocation,
|
|
19101
|
-
logger:
|
|
19310
|
+
logger: coreLogger
|
|
19102
19311
|
};
|
|
19103
19312
|
flashProvider.configure(flashConf);
|
|
19104
19313
|
}
|
|
@@ -19122,7 +19331,7 @@ var init = function init(options) {
|
|
|
19122
19331
|
receiverLocation: options.receiverLocation,
|
|
19123
19332
|
decoderLocation: options.decoderLocation,
|
|
19124
19333
|
audioContext: audioContext,
|
|
19125
|
-
logger:
|
|
19334
|
+
logger: coreLogger
|
|
19126
19335
|
};
|
|
19127
19336
|
websocketProvider.configure(wsConf);
|
|
19128
19337
|
} //check at least 1 provider available
|
|
@@ -19144,7 +19353,7 @@ var init = function init(options) {
|
|
|
19144
19353
|
MediaProvider = _MediaProvider;
|
|
19145
19354
|
}
|
|
19146
19355
|
} else {
|
|
19147
|
-
|
|
19356
|
+
corelogger.warn(LOG_PREFIX, "Preferred media provider is not available.");
|
|
19148
19357
|
}
|
|
19149
19358
|
}
|
|
19150
19359
|
|
|
@@ -19172,7 +19381,7 @@ var init = function init(options) {
|
|
|
19172
19381
|
options.mediaProvidersReadyCallback(Object.keys(MediaProvider));
|
|
19173
19382
|
}
|
|
19174
19383
|
|
|
19175
|
-
|
|
19384
|
+
coreLogger.info(LOG_PREFIX, "Initialized");
|
|
19176
19385
|
initialized = true;
|
|
19177
19386
|
}
|
|
19178
19387
|
};
|
|
@@ -19211,7 +19420,7 @@ var playFirstVideo = function playFirstVideo(display, isLocal, src) {
|
|
|
19211
19420
|
}
|
|
19212
19421
|
};
|
|
19213
19422
|
/**
|
|
19214
|
-
* Get logger
|
|
19423
|
+
* Get core logger
|
|
19215
19424
|
*
|
|
19216
19425
|
* @returns {Object} Logger
|
|
19217
19426
|
* @memberof Flashphoner
|
|
@@ -19222,7 +19431,7 @@ var getLogger = function getLogger() {
|
|
|
19222
19431
|
if (!initialized) {
|
|
19223
19432
|
console.warn("Initialize API first.");
|
|
19224
19433
|
} else {
|
|
19225
|
-
return
|
|
19434
|
+
return coreLogger;
|
|
19226
19435
|
}
|
|
19227
19436
|
};
|
|
19228
19437
|
/**
|
|
@@ -19395,6 +19604,31 @@ var getSessions = function getSessions() {
|
|
|
19395
19604
|
|
|
19396
19605
|
var getSession = function getSession(id) {
|
|
19397
19606
|
return sessions[id];
|
|
19607
|
+
}; // Get logger configuration from options
|
|
19608
|
+
|
|
19609
|
+
|
|
19610
|
+
var getLoggerConf = function getLoggerConf(loggerOptions) {
|
|
19611
|
+
var conf = loggerOptions || loggerConf;
|
|
19612
|
+
|
|
19613
|
+
if (loggerOptions !== null) {
|
|
19614
|
+
conf.enableLogs = true;
|
|
19615
|
+
}
|
|
19616
|
+
|
|
19617
|
+
return conf;
|
|
19618
|
+
}; // Create a new logger object
|
|
19619
|
+
|
|
19620
|
+
|
|
19621
|
+
var createLogger = function createLogger(loggerOptions) {
|
|
19622
|
+
var parentLogger = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : coreLogger;
|
|
19623
|
+
var newLogger = parentLogger;
|
|
19624
|
+
|
|
19625
|
+
if (newLogger === undefined || loggerOptions != undefined) {
|
|
19626
|
+
var loggerConf = getLoggerConf(loggerOptions);
|
|
19627
|
+
newLogger = new LoggerObject();
|
|
19628
|
+
newLogger.init(loggerConf.severity || "INFO", loggerConf.push || false, loggerConf.customLogger, loggerConf.enableLogs);
|
|
19629
|
+
}
|
|
19630
|
+
|
|
19631
|
+
return newLogger;
|
|
19398
19632
|
};
|
|
19399
19633
|
/**
|
|
19400
19634
|
* Create new session and connect to server.
|
|
@@ -19414,6 +19648,7 @@ var getSession = function getSession(id) {
|
|
|
19414
19648
|
* @param {Integer=} options.pingInterval Server ping interval in milliseconds [0]
|
|
19415
19649
|
* @param {Integer=} options.receiveProbes A maximum subsequental pings received missing count [0]
|
|
19416
19650
|
* @param {Integer=} options.probesInterval Interval to check subsequental pings received [0]
|
|
19651
|
+
* @param {Object=} options.logger Session logger options
|
|
19417
19652
|
* @returns {Session} Created session
|
|
19418
19653
|
* @throws {Error} Error if API is not initialized
|
|
19419
19654
|
* @throws {TypeError} Error if options.urlServer is not specified
|
|
@@ -19428,8 +19663,12 @@ var createSession = function createSession(options) {
|
|
|
19428
19663
|
|
|
19429
19664
|
if (!options || !options.urlServer) {
|
|
19430
19665
|
throw new TypeError("options.urlServer must be provided");
|
|
19431
|
-
}
|
|
19666
|
+
} // Set session logger #WCS-2434
|
|
19667
|
+
|
|
19432
19668
|
|
|
19669
|
+
var sessionLogger = createLogger(options.logger); // Override logger for all low level operations
|
|
19670
|
+
|
|
19671
|
+
var logger = sessionLogger;
|
|
19433
19672
|
var id_ = uuid_v1();
|
|
19434
19673
|
var sessionStatus = SESSION_STATUS.PENDING;
|
|
19435
19674
|
var urlServer = options.urlServer;
|
|
@@ -19535,7 +19774,7 @@ var createSession = function createSession(options) {
|
|
|
19535
19774
|
if (timeout != undefined && timeout > 0) {
|
|
19536
19775
|
connectionTimeout = setTimeout(function () {
|
|
19537
19776
|
if (wsConnection.readyState == 0) {
|
|
19538
|
-
|
|
19777
|
+
logger.warn(LOG_PREFIX, "WS connection timeout");
|
|
19539
19778
|
wsConnection.close();
|
|
19540
19779
|
}
|
|
19541
19780
|
}, timeout);
|
|
@@ -19559,7 +19798,7 @@ var createSession = function createSession(options) {
|
|
|
19559
19798
|
mediaProviders: Object.keys(MediaProvider),
|
|
19560
19799
|
keepAlive: keepAlive,
|
|
19561
19800
|
authToken: authToken,
|
|
19562
|
-
clientVersion: "2.0.
|
|
19801
|
+
clientVersion: "2.0.217",
|
|
19563
19802
|
clientOSVersion: window.navigator.appVersion,
|
|
19564
19803
|
clientBrowserVersion: window.navigator.userAgent,
|
|
19565
19804
|
msePacketizationVersion: 2,
|
|
@@ -19865,6 +20104,7 @@ var createSession = function createSession(options) {
|
|
|
19865
20104
|
* @param {Array<string>=} options.sipSDP Array of custom SDP params (ex. bandwidth (b=))
|
|
19866
20105
|
* @param {Array<string>=} options.sipHeaders Array of custom SIP headers
|
|
19867
20106
|
* @param {string=} options.videoContentHint Video content hint for browser ('detail' by default to maintain resolution), {@link Flashphoner.constants.CONTENT_HINT_TYPE}
|
|
20107
|
+
* @param {Object=} options.logger Call logger options
|
|
19868
20108
|
* @param {sdpHook} sdpHook The callback that handles sdp from the server
|
|
19869
20109
|
* @returns {Call} Call
|
|
19870
20110
|
* @throws {TypeError} Error if no options provided
|
|
@@ -19877,15 +20117,18 @@ var createSession = function createSession(options) {
|
|
|
19877
20117
|
var createCall = function createCall(options) {
|
|
19878
20118
|
//check session state
|
|
19879
20119
|
if (sessionStatus !== SESSION_STATUS.REGISTERED && sessionStatus !== SESSION_STATUS.ESTABLISHED) {
|
|
19880
|
-
|
|
19881
|
-
throw new Error('Invalid session state');
|
|
20120
|
+
throw new Error('Invalid session state ' + sessionStatus);
|
|
19882
20121
|
} //check options
|
|
19883
20122
|
|
|
19884
20123
|
|
|
19885
20124
|
if (!options) {
|
|
19886
20125
|
throw new TypeError("options must be provided");
|
|
19887
|
-
}
|
|
20126
|
+
} // Set call logger #WCS-2434
|
|
20127
|
+
|
|
20128
|
+
|
|
20129
|
+
var callLogger = createLogger(options.logger, sessionLogger); // Override logger for all low level operations
|
|
19888
20130
|
|
|
20131
|
+
var logger = callLogger;
|
|
19889
20132
|
var login = appKey == 'clickToCallApp' ? '' : cConfig.sipLogin;
|
|
19890
20133
|
var caller_ = options.incoming ? options.caller : login;
|
|
19891
20134
|
var callee_ = options.callee;
|
|
@@ -20031,7 +20274,8 @@ var createSession = function createSession(options) {
|
|
|
20031
20274
|
constraints: constraints,
|
|
20032
20275
|
connectionConfig: mediaOptions,
|
|
20033
20276
|
audioOutputId: audioOutputId,
|
|
20034
|
-
videoContentHint: videoContentHint
|
|
20277
|
+
videoContentHint: videoContentHint,
|
|
20278
|
+
logger: logger
|
|
20035
20279
|
}).then(function (newConnection) {
|
|
20036
20280
|
mediaConnection = newConnection;
|
|
20037
20281
|
return mediaConnection.createOffer({
|
|
@@ -20617,7 +20861,7 @@ var createSession = function createSession(options) {
|
|
|
20617
20861
|
/**
|
|
20618
20862
|
* Get call info
|
|
20619
20863
|
* @returns {string} Info
|
|
20620
|
-
* @memberof
|
|
20864
|
+
* @memberof Call
|
|
20621
20865
|
* @inner
|
|
20622
20866
|
*/
|
|
20623
20867
|
|
|
@@ -20628,7 +20872,7 @@ var createSession = function createSession(options) {
|
|
|
20628
20872
|
/**
|
|
20629
20873
|
* Get stream error info
|
|
20630
20874
|
* @returns {string} Error info
|
|
20631
|
-
* @memberof
|
|
20875
|
+
* @memberof Call
|
|
20632
20876
|
* @inner
|
|
20633
20877
|
*/
|
|
20634
20878
|
|
|
@@ -20636,6 +20880,17 @@ var createSession = function createSession(options) {
|
|
|
20636
20880
|
var getErrorInfo = function getErrorInfo() {
|
|
20637
20881
|
return errorInfo_;
|
|
20638
20882
|
};
|
|
20883
|
+
/**
|
|
20884
|
+
* Get call logger
|
|
20885
|
+
*
|
|
20886
|
+
* @returns {Object} Logger
|
|
20887
|
+
* @memberof Call
|
|
20888
|
+
*/
|
|
20889
|
+
|
|
20890
|
+
|
|
20891
|
+
var getLogger = function getLogger() {
|
|
20892
|
+
return callLogger;
|
|
20893
|
+
};
|
|
20639
20894
|
|
|
20640
20895
|
call.call = call_;
|
|
20641
20896
|
call.answer = answer;
|
|
@@ -20667,6 +20922,7 @@ var createSession = function createSession(options) {
|
|
|
20667
20922
|
call.switchMic = switchMic;
|
|
20668
20923
|
call.switchToScreen = switchToScreen;
|
|
20669
20924
|
call.switchToCam = switchToCam;
|
|
20925
|
+
call.getLogger = getLogger;
|
|
20670
20926
|
calls[id_] = call;
|
|
20671
20927
|
return call;
|
|
20672
20928
|
};
|
|
@@ -20713,6 +20969,7 @@ var createSession = function createSession(options) {
|
|
|
20713
20969
|
* @param {string=} options.useCanvasMediaStream EXPERIMENTAL: when publish bind browser's media stream to the canvas. It can be useful for image filtering
|
|
20714
20970
|
* @param {string=} options.videoContentHint Video content hint for browser ('detail' by default to maintain resolution), {@link Flashphoner.constants.CONTENT_HINT_TYPE}
|
|
20715
20971
|
* @param {Boolean=} options.unmutePlayOnStart Unmute playback on start. May be used after user gesture only, so set 'unmutePlayOnStart: false' for autoplay
|
|
20972
|
+
* @param {Object=} options.logger Stream logger options
|
|
20716
20973
|
* @param {sdpHook} sdpHook The callback that handles sdp from the server
|
|
20717
20974
|
* @returns {Stream} Stream
|
|
20718
20975
|
* @throws {TypeError} Error if no options provided
|
|
@@ -20728,7 +20985,7 @@ var createSession = function createSession(options) {
|
|
|
20728
20985
|
var availableCallbacks = []; //check session state
|
|
20729
20986
|
|
|
20730
20987
|
if (sessionStatus !== SESSION_STATUS.ESTABLISHED) {
|
|
20731
|
-
throw new Error('Invalid session state');
|
|
20988
|
+
throw new Error('Invalid session state ' + sessionStatus);
|
|
20732
20989
|
} //check options
|
|
20733
20990
|
|
|
20734
20991
|
|
|
@@ -20738,8 +20995,12 @@ var createSession = function createSession(options) {
|
|
|
20738
20995
|
|
|
20739
20996
|
if (!options.name) {
|
|
20740
20997
|
throw new TypeError("options.name must be provided");
|
|
20741
|
-
}
|
|
20998
|
+
} // Set stream logger #WCS-2434
|
|
20742
20999
|
|
|
21000
|
+
|
|
21001
|
+
var streamLogger = createLogger(options.logger, sessionLogger); // Override logger for all low level operations
|
|
21002
|
+
|
|
21003
|
+
var logger = streamLogger;
|
|
20743
21004
|
var clientKf = new KalmanFilter();
|
|
20744
21005
|
var serverKf = new KalmanFilter();
|
|
20745
21006
|
var id_ = uuid_v1();
|
|
@@ -20983,7 +21244,7 @@ var createSession = function createSession(options) {
|
|
|
20983
21244
|
logger.debug(LOG_PREFIX, "Play stream " + name_);
|
|
20984
21245
|
|
|
20985
21246
|
if (status_ !== STREAM_STATUS.NEW) {
|
|
20986
|
-
throw new Error("Invalid stream state");
|
|
21247
|
+
throw new Error("Invalid stream state " + status_);
|
|
20987
21248
|
}
|
|
20988
21249
|
|
|
20989
21250
|
status_ = STREAM_STATUS.PENDING; //create mediaProvider connection
|
|
@@ -21002,7 +21263,8 @@ var createSession = function createSession(options) {
|
|
|
21002
21263
|
audioOutputId: audioOutputId,
|
|
21003
21264
|
remoteVideo: remoteVideo,
|
|
21004
21265
|
playoutDelay: playoutDelay,
|
|
21005
|
-
unmutePlayOnStart: unmutePlayOnStart
|
|
21266
|
+
unmutePlayOnStart: unmutePlayOnStart,
|
|
21267
|
+
logger: logger
|
|
21006
21268
|
}, streamRefreshHandlers[id_]).then(function (newConnection) {
|
|
21007
21269
|
mediaConnection = newConnection;
|
|
21008
21270
|
|
|
@@ -21066,7 +21328,7 @@ var createSession = function createSession(options) {
|
|
|
21066
21328
|
logger.debug(LOG_PREFIX, "Publish stream " + name_);
|
|
21067
21329
|
|
|
21068
21330
|
if (status_ !== STREAM_STATUS.NEW) {
|
|
21069
|
-
throw new Error("Invalid stream state");
|
|
21331
|
+
throw new Error("Invalid stream state " + status_);
|
|
21070
21332
|
}
|
|
21071
21333
|
|
|
21072
21334
|
status_ = STREAM_STATUS.PENDING;
|
|
@@ -21100,7 +21362,8 @@ var createSession = function createSession(options) {
|
|
|
21100
21362
|
connectionConfig: mediaOptions,
|
|
21101
21363
|
connectionConstraints: mediaConnectionConstraints,
|
|
21102
21364
|
customStream: constraints && constraints.customStream ? constraints.customStream : false,
|
|
21103
|
-
videoContentHint: videoContentHint
|
|
21365
|
+
videoContentHint: videoContentHint,
|
|
21366
|
+
logger: logger
|
|
21104
21367
|
}).then(function (newConnection) {
|
|
21105
21368
|
mediaConnection = newConnection;
|
|
21106
21369
|
return mediaConnection.createOffer({
|
|
@@ -21730,6 +21993,17 @@ var createSession = function createSession(options) {
|
|
|
21730
21993
|
availableCallbacks.push(promise);
|
|
21731
21994
|
});
|
|
21732
21995
|
};
|
|
21996
|
+
/**
|
|
21997
|
+
* Get stream logger
|
|
21998
|
+
*
|
|
21999
|
+
* @returns {Object} Logger
|
|
22000
|
+
* @memberof Stream
|
|
22001
|
+
*/
|
|
22002
|
+
|
|
22003
|
+
|
|
22004
|
+
var getLogger = function getLogger() {
|
|
22005
|
+
return streamLogger;
|
|
22006
|
+
};
|
|
21733
22007
|
|
|
21734
22008
|
stream.play = play;
|
|
21735
22009
|
stream.publish = publish;
|
|
@@ -21769,6 +22043,7 @@ var createSession = function createSession(options) {
|
|
|
21769
22043
|
stream.switchToScreen = switchToScreen;
|
|
21770
22044
|
stream.switchToCam = switchToCam;
|
|
21771
22045
|
stream.sendData = sendData;
|
|
22046
|
+
stream.getLogger = getLogger;
|
|
21772
22047
|
streams[id_] = stream;
|
|
21773
22048
|
return stream;
|
|
21774
22049
|
};
|
|
@@ -21977,6 +22252,17 @@ var createSession = function createSession(options) {
|
|
|
21977
22252
|
}
|
|
21978
22253
|
|
|
21979
22254
|
return sdp;
|
|
22255
|
+
};
|
|
22256
|
+
/**
|
|
22257
|
+
* Get session logger
|
|
22258
|
+
*
|
|
22259
|
+
* @returns {Object} Logger
|
|
22260
|
+
* @memberof Session
|
|
22261
|
+
*/
|
|
22262
|
+
|
|
22263
|
+
|
|
22264
|
+
var getLogger = function getLogger() {
|
|
22265
|
+
return sessionLogger;
|
|
21980
22266
|
}; //export Session
|
|
21981
22267
|
|
|
21982
22268
|
|
|
@@ -21992,7 +22278,8 @@ var createSession = function createSession(options) {
|
|
|
21992
22278
|
session.submitBugReport = submitBugReport;
|
|
21993
22279
|
session.startDebug = startDebug;
|
|
21994
22280
|
session.stopDebug = stopDebug;
|
|
21995
|
-
session.on = on;
|
|
22281
|
+
session.on = on;
|
|
22282
|
+
session.getLogger = getLogger; //save interface to global map
|
|
21996
22283
|
|
|
21997
22284
|
sessions[id_] = session;
|
|
21998
22285
|
return session;
|
|
@@ -22058,6 +22345,11 @@ var Promise = require('es6-promise').Promise;
|
|
|
22058
22345
|
|
|
22059
22346
|
var createConnection = function createConnection(options) {
|
|
22060
22347
|
return new Promise(function (resolve, reject) {
|
|
22348
|
+
// Set connection logger #WCS-2434
|
|
22349
|
+
if (options.logger) {
|
|
22350
|
+
logger = options.logger;
|
|
22351
|
+
}
|
|
22352
|
+
|
|
22061
22353
|
var id = options.id;
|
|
22062
22354
|
var connectionConfig = options.connectionConfig || {
|
|
22063
22355
|
"iceServers": []
|
|
@@ -22693,165 +22985,171 @@ module.exports = {
|
|
|
22693
22985
|
},{"./util":46,"es6-promise":2,"uuid":10,"webrtc-adapter":25}],46:[function(require,module,exports){
|
|
22694
22986
|
'use strict';
|
|
22695
22987
|
|
|
22696
|
-
|
|
22697
|
-
|
|
22698
|
-
|
|
22699
|
-
|
|
22700
|
-
}
|
|
22988
|
+
var isEmptyObject = function isEmptyObject(obj) {
|
|
22989
|
+
for (var name in obj) {
|
|
22990
|
+
return false;
|
|
22991
|
+
}
|
|
22701
22992
|
|
|
22702
|
-
|
|
22703
|
-
|
|
22993
|
+
return true;
|
|
22994
|
+
};
|
|
22995
|
+
/**
|
|
22996
|
+
* Copy values of object own properties to array.
|
|
22997
|
+
*
|
|
22998
|
+
* @param obj
|
|
22999
|
+
* @returns {Array}
|
|
23000
|
+
*/
|
|
22704
23001
|
|
|
22705
|
-
/**
|
|
22706
|
-
* Copy values of object own properties to array.
|
|
22707
|
-
*
|
|
22708
|
-
* @param obj
|
|
22709
|
-
* @returns {Array}
|
|
22710
|
-
*/
|
|
22711
|
-
copyObjectToArray: function copyObjectToArray(obj) {
|
|
22712
|
-
var ret = [];
|
|
22713
23002
|
|
|
22714
|
-
|
|
22715
|
-
|
|
22716
|
-
|
|
22717
|
-
|
|
23003
|
+
var copyObjectToArray = function copyObjectToArray(obj) {
|
|
23004
|
+
var ret = [];
|
|
23005
|
+
|
|
23006
|
+
for (var prop in obj) {
|
|
23007
|
+
if (obj.hasOwnProperty(prop)) {
|
|
23008
|
+
ret.push(obj[prop]);
|
|
22718
23009
|
}
|
|
23010
|
+
}
|
|
22719
23011
|
|
|
22720
|
-
|
|
22721
|
-
|
|
23012
|
+
return ret;
|
|
23013
|
+
};
|
|
23014
|
+
/**
|
|
23015
|
+
* Copy src properties to dst object.
|
|
23016
|
+
* Will overwrite dst prop with src prop in case of dst prop exist.
|
|
23017
|
+
*/
|
|
22722
23018
|
|
|
22723
|
-
|
|
22724
|
-
|
|
22725
|
-
|
|
22726
|
-
|
|
22727
|
-
|
|
22728
|
-
for (var prop in src) {
|
|
22729
|
-
if (src.hasOwnProperty(prop)) {
|
|
22730
|
-
dst[prop] = src[prop];
|
|
22731
|
-
}
|
|
23019
|
+
|
|
23020
|
+
var copyObjectPropsToAnotherObject = function copyObjectPropsToAnotherObject(src, dst) {
|
|
23021
|
+
for (var prop in src) {
|
|
23022
|
+
if (src.hasOwnProperty(prop)) {
|
|
23023
|
+
dst[prop] = src[prop];
|
|
22732
23024
|
}
|
|
22733
|
-
}
|
|
22734
|
-
|
|
22735
|
-
var result = {};
|
|
23025
|
+
}
|
|
23026
|
+
};
|
|
22736
23027
|
|
|
22737
|
-
|
|
22738
|
-
|
|
22739
|
-
* Report types: googComponent, googCandidatePair, googCertificate, googLibjingleSession, googTrack, ssrc
|
|
22740
|
-
*/
|
|
22741
|
-
var gotResult = false;
|
|
23028
|
+
var processRtcStatsReport = function processRtcStatsReport(browser, report) {
|
|
23029
|
+
var result = {};
|
|
22742
23030
|
|
|
22743
|
-
|
|
22744
|
-
|
|
22745
|
-
|
|
22746
|
-
|
|
22747
|
-
|
|
22748
|
-
}
|
|
23031
|
+
if (browser == "chrome") {
|
|
23032
|
+
/**
|
|
23033
|
+
* Report types: googComponent, googCandidatePair, googCertificate, googLibjingleSession, googTrack, ssrc
|
|
23034
|
+
*/
|
|
23035
|
+
var gotResult = false;
|
|
22749
23036
|
|
|
22750
|
-
|
|
23037
|
+
if (report.type && report.type == "googCandidatePair") {
|
|
23038
|
+
//check if this is active pair
|
|
23039
|
+
if (report.googActiveConnection == "true") {
|
|
22751
23040
|
gotResult = true;
|
|
22752
23041
|
}
|
|
23042
|
+
}
|
|
22753
23043
|
|
|
22754
|
-
|
|
22755
|
-
|
|
22756
|
-
|
|
22757
|
-
|
|
22758
|
-
|
|
23044
|
+
if (report.type && report.type == "ssrc") {
|
|
23045
|
+
gotResult = true;
|
|
23046
|
+
}
|
|
23047
|
+
|
|
23048
|
+
if (gotResult) {
|
|
23049
|
+
for (var k in report) {
|
|
23050
|
+
if (report.hasOwnProperty(k)) {
|
|
23051
|
+
result[k] = report[k];
|
|
22759
23052
|
}
|
|
22760
23053
|
}
|
|
23054
|
+
}
|
|
22761
23055
|
|
|
22762
|
-
|
|
22763
|
-
|
|
22764
|
-
|
|
22765
|
-
|
|
22766
|
-
|
|
22767
|
-
|
|
22768
|
-
|
|
22769
|
-
|
|
22770
|
-
|
|
22771
|
-
|
|
22772
|
-
|
|
22773
|
-
}
|
|
23056
|
+
return result;
|
|
23057
|
+
} else if (browser == "firefox") {
|
|
23058
|
+
/**
|
|
23059
|
+
* RTCStatsReport http://mxr.mozilla.org/mozilla-central/source/dom/webidl/RTCStatsReport.webidl
|
|
23060
|
+
*/
|
|
23061
|
+
if (report.type && (report.type == "outboundrtp" || report.type == "inboundrtp") && report.id.indexOf("rtcp") == -1) {
|
|
23062
|
+
result = {};
|
|
23063
|
+
|
|
23064
|
+
for (var k in report) {
|
|
23065
|
+
if (report.hasOwnProperty(k)) {
|
|
23066
|
+
result[k] = report[k];
|
|
22774
23067
|
}
|
|
22775
23068
|
}
|
|
22776
|
-
|
|
22777
|
-
return result;
|
|
22778
|
-
} else {
|
|
22779
|
-
return result;
|
|
22780
23069
|
}
|
|
22781
23070
|
|
|
22782
|
-
;
|
|
23071
|
+
return result;
|
|
23072
|
+
} else {
|
|
23073
|
+
return result;
|
|
23074
|
+
}
|
|
23075
|
+
};
|
|
23076
|
+
|
|
23077
|
+
var Browser = {
|
|
23078
|
+
isIE: function isIE() {
|
|
23079
|
+
return (
|
|
23080
|
+
/*@cc_on!@*/
|
|
23081
|
+
false || !!document.documentMode
|
|
23082
|
+
);
|
|
22783
23083
|
},
|
|
22784
|
-
|
|
22785
|
-
|
|
22786
|
-
return (
|
|
22787
|
-
/*@cc_on!@*/
|
|
22788
|
-
false || !!document.documentMode
|
|
22789
|
-
);
|
|
22790
|
-
},
|
|
22791
|
-
isFirefox: function isFirefox() {
|
|
22792
|
-
return typeof InstallTrigger !== 'undefined';
|
|
22793
|
-
},
|
|
22794
|
-
isChrome: function isChrome() {
|
|
22795
|
-
return !!window.chrome && /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor) && !/OPR/.test(navigator.userAgent);
|
|
22796
|
-
},
|
|
22797
|
-
isEdge: function isEdge() {
|
|
22798
|
-
return !isIE && !!window.StyleMedia;
|
|
22799
|
-
},
|
|
22800
|
-
isOpera: function isOpera() {
|
|
22801
|
-
return !!window.opr && !!opr.addons || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
|
|
22802
|
-
},
|
|
22803
|
-
isiOS: function isiOS() {
|
|
22804
|
-
return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
|
22805
|
-
},
|
|
22806
|
-
isSafari: function isSafari() {
|
|
22807
|
-
var userAgent = navigator.userAgent.toLowerCase();
|
|
22808
|
-
return /(safari|applewebkit)/i.test(userAgent) && !userAgent.includes("chrome") && !userAgent.includes("android");
|
|
22809
|
-
},
|
|
22810
|
-
isAndroid: function isAndroid() {
|
|
22811
|
-
return navigator.userAgent.toLowerCase().indexOf("android") > -1;
|
|
22812
|
-
},
|
|
22813
|
-
isSafariWebRTC: function isSafariWebRTC() {
|
|
22814
|
-
return navigator.mediaDevices && this.isSafari();
|
|
22815
|
-
},
|
|
22816
|
-
isSamsungBrowser: function isSamsungBrowser() {
|
|
22817
|
-
return /SamsungBrowser/i.test(navigator.userAgent);
|
|
22818
|
-
},
|
|
22819
|
-
isAndroidFirefox: function isAndroidFirefox() {
|
|
22820
|
-
return this.isAndroid() && /Firefox/i.test(navigator.userAgent);
|
|
22821
|
-
}
|
|
23084
|
+
isFirefox: function isFirefox() {
|
|
23085
|
+
return typeof InstallTrigger !== 'undefined';
|
|
22822
23086
|
},
|
|
22823
|
-
|
|
22824
|
-
|
|
22825
|
-
|
|
22826
|
-
|
|
22827
|
-
|
|
22828
|
-
|
|
22829
|
-
|
|
22830
|
-
|
|
22831
|
-
|
|
22832
|
-
|
|
22833
|
-
|
|
22834
|
-
|
|
23087
|
+
isChrome: function isChrome() {
|
|
23088
|
+
return !!window.chrome && /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor) && !/OPR/.test(navigator.userAgent);
|
|
23089
|
+
},
|
|
23090
|
+
isEdge: function isEdge() {
|
|
23091
|
+
return !isIE && !!window.StyleMedia;
|
|
23092
|
+
},
|
|
23093
|
+
isOpera: function isOpera() {
|
|
23094
|
+
return !!window.opr && !!opr.addons || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
|
|
23095
|
+
},
|
|
23096
|
+
isiOS: function isiOS() {
|
|
23097
|
+
return /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
|
23098
|
+
},
|
|
23099
|
+
isSafari: function isSafari() {
|
|
23100
|
+
var userAgent = navigator.userAgent.toLowerCase();
|
|
23101
|
+
return /(safari|applewebkit)/i.test(userAgent) && !userAgent.includes("chrome") && !userAgent.includes("android");
|
|
23102
|
+
},
|
|
23103
|
+
isAndroid: function isAndroid() {
|
|
23104
|
+
return navigator.userAgent.toLowerCase().indexOf("android") > -1;
|
|
23105
|
+
},
|
|
23106
|
+
isSafariWebRTC: function isSafariWebRTC() {
|
|
23107
|
+
return navigator.mediaDevices && this.isSafari();
|
|
23108
|
+
},
|
|
23109
|
+
isSamsungBrowser: function isSamsungBrowser() {
|
|
23110
|
+
return /SamsungBrowser/i.test(navigator.userAgent);
|
|
23111
|
+
},
|
|
23112
|
+
isAndroidFirefox: function isAndroidFirefox() {
|
|
23113
|
+
return this.isAndroid() && /Firefox/i.test(navigator.userAgent);
|
|
23114
|
+
},
|
|
23115
|
+
isChromiumEdge: function isChromiumEdge() {
|
|
23116
|
+
return /Chrome/i.test(navigator.userAgent) && /Edg/i.test(navigator.userAgent);
|
|
23117
|
+
}
|
|
23118
|
+
};
|
|
23119
|
+
var SDP = {
|
|
23120
|
+
matchPrefix: function matchPrefix(sdp, prefix) {
|
|
23121
|
+
var parts = sdp.trim().split('\n').map(function (line) {
|
|
23122
|
+
return line.trim();
|
|
23123
|
+
});
|
|
23124
|
+
return parts.filter(function (line) {
|
|
23125
|
+
return line.indexOf(prefix) === 0;
|
|
23126
|
+
});
|
|
23127
|
+
},
|
|
23128
|
+
writeFmtp: function writeFmtp(sdp, param, codec) {
|
|
23129
|
+
var sdpArray = sdp.split("\n");
|
|
23130
|
+
var i;
|
|
22835
23131
|
|
|
22836
|
-
|
|
22837
|
-
|
|
22838
|
-
|
|
22839
|
-
|
|
22840
|
-
|
|
23132
|
+
for (i = 0; i < sdpArray.length; i++) {
|
|
23133
|
+
if (sdpArray[i].search(codec) != -1 && sdpArray[i].indexOf("a=rtpmap") == 0) {
|
|
23134
|
+
sdpArray[i] += "\na=fmtp:" + sdpArray[i].match(/[0-9]+/)[0] + " " + param + "\r";
|
|
23135
|
+
}
|
|
23136
|
+
} //normalize sdp after modifications
|
|
22841
23137
|
|
|
22842
23138
|
|
|
22843
|
-
|
|
23139
|
+
var result = "";
|
|
22844
23140
|
|
|
22845
|
-
|
|
22846
|
-
|
|
22847
|
-
|
|
22848
|
-
}
|
|
23141
|
+
for (i = 0; i < sdpArray.length; i++) {
|
|
23142
|
+
if (sdpArray[i] != "") {
|
|
23143
|
+
result += sdpArray[i] + "\n";
|
|
22849
23144
|
}
|
|
22850
|
-
|
|
22851
|
-
return result;
|
|
22852
23145
|
}
|
|
22853
|
-
|
|
22854
|
-
|
|
23146
|
+
|
|
23147
|
+
return result;
|
|
23148
|
+
}
|
|
23149
|
+
};
|
|
23150
|
+
|
|
23151
|
+
var logger = function logger() {
|
|
23152
|
+
return {
|
|
22855
23153
|
init: function init(verbosity, enablePushLogs, customLogger, enableLogs) {
|
|
22856
23154
|
switch (verbosity.toUpperCase()) {
|
|
22857
23155
|
case "DEBUG":
|
|
@@ -23032,92 +23330,104 @@ module.exports = {
|
|
|
23032
23330
|
default:
|
|
23033
23331
|
this.verbosity = 2;
|
|
23034
23332
|
}
|
|
23035
|
-
|
|
23036
|
-
;
|
|
23037
23333
|
}
|
|
23038
|
-
}
|
|
23039
|
-
|
|
23040
|
-
if (!codecs.length) return sdp;
|
|
23041
|
-
var sdpArray = sdp.split("\n");
|
|
23042
|
-
var codecsArray = codecs.split(","); //search and delete codecs line
|
|
23334
|
+
};
|
|
23335
|
+
};
|
|
23043
23336
|
|
|
23044
|
-
|
|
23045
|
-
|
|
23337
|
+
var stripCodecs = function stripCodecs(sdp, codecs) {
|
|
23338
|
+
if (!codecs.length) return sdp;
|
|
23339
|
+
var sdpArray = sdp.split("\n");
|
|
23340
|
+
var codecsArray = codecs.split(","); //search and delete codecs line
|
|
23046
23341
|
|
|
23047
|
-
|
|
23048
|
-
|
|
23342
|
+
var pt = [];
|
|
23343
|
+
var i;
|
|
23049
23344
|
|
|
23050
|
-
|
|
23051
|
-
|
|
23052
|
-
|
|
23053
|
-
|
|
23054
|
-
|
|
23055
|
-
|
|
23345
|
+
for (var p = 0; p < codecsArray.length; p++) {
|
|
23346
|
+
console.log("Searching for codec " + codecsArray[p]);
|
|
23347
|
+
|
|
23348
|
+
for (i = 0; i < sdpArray.length; i++) {
|
|
23349
|
+
if (sdpArray[i].search(new RegExp(codecsArray[p], 'i')) != -1 && sdpArray[i].indexOf("a=rtpmap") == 0) {
|
|
23350
|
+
console.log(codecsArray[p] + " detected");
|
|
23351
|
+
pt.push(sdpArray[i].match(/[0-9]+/)[0]);
|
|
23352
|
+
sdpArray[i] = "";
|
|
23056
23353
|
}
|
|
23057
23354
|
}
|
|
23355
|
+
}
|
|
23058
23356
|
|
|
23059
|
-
|
|
23060
|
-
|
|
23061
|
-
|
|
23062
|
-
|
|
23063
|
-
|
|
23064
|
-
|
|
23065
|
-
}
|
|
23357
|
+
if (pt.length) {
|
|
23358
|
+
//searching for fmtp
|
|
23359
|
+
for (p = 0; p < pt.length; p++) {
|
|
23360
|
+
for (i = 0; i < sdpArray.length; i++) {
|
|
23361
|
+
if (sdpArray[i].search("a=fmtp:" + pt[p]) != -1 || sdpArray[i].search("a=rtcp-fb:" + pt[p]) != -1) {
|
|
23362
|
+
sdpArray[i] = "";
|
|
23066
23363
|
}
|
|
23067
|
-
}
|
|
23364
|
+
}
|
|
23365
|
+
} //delete entries from m= line
|
|
23068
23366
|
|
|
23069
23367
|
|
|
23070
|
-
|
|
23071
|
-
|
|
23072
|
-
|
|
23073
|
-
|
|
23368
|
+
for (i = 0; i < sdpArray.length; i++) {
|
|
23369
|
+
if (sdpArray[i].search("m=audio") != -1 || sdpArray[i].search("m=video") != -1) {
|
|
23370
|
+
var mLineSplitted = sdpArray[i].split(" ");
|
|
23371
|
+
var newMLine = "";
|
|
23074
23372
|
|
|
23075
|
-
|
|
23076
|
-
|
|
23077
|
-
|
|
23373
|
+
for (var m = 0; m < mLineSplitted.length; m++) {
|
|
23374
|
+
if (pt.indexOf(mLineSplitted[m].trim()) == -1 || m <= 2) {
|
|
23375
|
+
newMLine += mLineSplitted[m];
|
|
23078
23376
|
|
|
23079
|
-
|
|
23080
|
-
|
|
23081
|
-
}
|
|
23377
|
+
if (m < mLineSplitted.length - 1) {
|
|
23378
|
+
newMLine = newMLine + " ";
|
|
23082
23379
|
}
|
|
23083
23380
|
}
|
|
23084
|
-
|
|
23085
|
-
sdpArray[i] = newMLine;
|
|
23086
23381
|
}
|
|
23382
|
+
|
|
23383
|
+
sdpArray[i] = newMLine;
|
|
23087
23384
|
}
|
|
23088
|
-
}
|
|
23385
|
+
}
|
|
23386
|
+
} //normalize sdp after modifications
|
|
23089
23387
|
|
|
23090
23388
|
|
|
23091
|
-
|
|
23389
|
+
var result = "";
|
|
23092
23390
|
|
|
23093
|
-
|
|
23094
|
-
|
|
23095
|
-
|
|
23096
|
-
}
|
|
23391
|
+
for (i = 0; i < sdpArray.length; i++) {
|
|
23392
|
+
if (sdpArray[i] != "") {
|
|
23393
|
+
result += sdpArray[i] + "\n";
|
|
23097
23394
|
}
|
|
23395
|
+
}
|
|
23098
23396
|
|
|
23099
|
-
|
|
23100
|
-
|
|
23101
|
-
getCurrentCodecAndSampleRate: function getCurrentCodecAndSampleRate(sdp, mediaType) {
|
|
23102
|
-
var rows = sdp.split("\n");
|
|
23103
|
-
var codecPt;
|
|
23397
|
+
return result;
|
|
23398
|
+
};
|
|
23104
23399
|
|
|
23105
|
-
|
|
23106
|
-
|
|
23107
|
-
|
|
23108
|
-
ret.name = rows[i].split(" ")[1].split("/")[0];
|
|
23109
|
-
ret.sampleRate = rows[i].split(" ")[1].split("/")[1];
|
|
23110
|
-
return ret;
|
|
23111
|
-
} //WCS-2136. WebRTC statistics doesn't work for VP8
|
|
23400
|
+
var getCurrentCodecAndSampleRate = function getCurrentCodecAndSampleRate(sdp, mediaType) {
|
|
23401
|
+
var rows = sdp.split("\n");
|
|
23402
|
+
var codecPt;
|
|
23112
23403
|
|
|
23404
|
+
for (var i = 0; i < rows.length; i++) {
|
|
23405
|
+
if (codecPt && rows[i].indexOf("a=rtpmap:" + codecPt) != -1) {
|
|
23406
|
+
var ret = {};
|
|
23407
|
+
ret.name = rows[i].split(" ")[1].split("/")[0];
|
|
23408
|
+
ret.sampleRate = rows[i].split(" ")[1].split("/")[1];
|
|
23409
|
+
return ret;
|
|
23410
|
+
} //WCS-2136. WebRTC statistics doesn't work for VP8
|
|
23113
23411
|
|
|
23114
|
-
|
|
23115
|
-
|
|
23116
|
-
|
|
23412
|
+
|
|
23413
|
+
if (rows[i].indexOf("m=" + mediaType) != -1) {
|
|
23414
|
+
codecPt = rows[i].split(" ")[3].trim();
|
|
23117
23415
|
}
|
|
23118
23416
|
}
|
|
23119
23417
|
};
|
|
23120
23418
|
|
|
23419
|
+
module.exports = {
|
|
23420
|
+
isEmptyObject: isEmptyObject,
|
|
23421
|
+
copyObjectToArray: copyObjectToArray,
|
|
23422
|
+
copyObjectPropsToAnotherObject: copyObjectPropsToAnotherObject,
|
|
23423
|
+
processRtcStatsReport: processRtcStatsReport,
|
|
23424
|
+
Browser: Browser,
|
|
23425
|
+
SDP: SDP,
|
|
23426
|
+
logger: logger,
|
|
23427
|
+
stripCodecs: stripCodecs,
|
|
23428
|
+
getCurrentCodecAndSampleRate: getCurrentCodecAndSampleRate
|
|
23429
|
+
};
|
|
23430
|
+
|
|
23121
23431
|
},{}],47:[function(require,module,exports){
|
|
23122
23432
|
'use strict';
|
|
23123
23433
|
|
|
@@ -23137,7 +23447,12 @@ var audioContext;
|
|
|
23137
23447
|
var createConnection = function createConnection(options, handlers) {
|
|
23138
23448
|
return new Promise(function (resolve, reject) {
|
|
23139
23449
|
var id = options.id;
|
|
23140
|
-
var display = options.display;
|
|
23450
|
+
var display = options.display; // Set connection logger #WCS-2434
|
|
23451
|
+
|
|
23452
|
+
if (options.logger) {
|
|
23453
|
+
logger = options.logger;
|
|
23454
|
+
}
|
|
23455
|
+
|
|
23141
23456
|
var canvas = document.createElement("canvas");
|
|
23142
23457
|
display.appendChild(canvas);
|
|
23143
23458
|
canvas.id = id;
|