@flashphoner/websdk 2.0.216 → 2.0.219

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.
@@ -7728,717 +7728,957 @@ function filterStats(result, track, outbound) {
7728
7728
  * @see Session
7729
7729
  */
7730
7730
 
7731
- var sessionStatus = {};
7732
- /**
7733
- * Fires when {@link Session} ws socket opens.
7734
- * @event CONNECTED
7735
- * @memberof Flashphoner.constants.SESSION_STATUS
7736
- */
7731
+ var SESSION_STATUS = Object.freeze({
7732
+ /**
7733
+ * Fires when {@link Session} ws socket opens.
7734
+ * @event CONNECTED
7735
+ * @memberof Flashphoner.constants.SESSION_STATUS
7736
+ */
7737
+ CONNECTED: 'CONNECTED',
7737
7738
 
7738
- define(sessionStatus, 'CONNECTED', 'CONNECTED');
7739
- /**
7740
- * Fires when {@link Session} receives connect ack from REST App.
7741
- * @event ESTABLISHED
7742
- * @memberof Flashphoner.constants.SESSION_STATUS
7743
- */
7739
+ /**
7740
+ * Fires when {@link Session} receives connect ack from REST App.
7741
+ * @event ESTABLISHED
7742
+ * @memberof Flashphoner.constants.SESSION_STATUS
7743
+ */
7744
+ ESTABLISHED: 'ESTABLISHED',
7744
7745
 
7745
- define(sessionStatus, 'ESTABLISHED', 'ESTABLISHED');
7746
- /**
7747
- * Fires when {@link Session} disconnects.
7748
- * @event DISCONNECTED
7749
- * @memberof Flashphoner.constants.SESSION_STATUS
7750
- */
7746
+ /**
7747
+ * Fires when {@link Session} disconnects.
7748
+ * @event DISCONNECTED
7749
+ * @memberof Flashphoner.constants.SESSION_STATUS
7750
+ */
7751
+ DISCONNECTED: 'DISCONNECTED',
7751
7752
 
7752
- define(sessionStatus, 'DISCONNECTED', 'DISCONNECTED');
7753
- /**
7754
- * Fires if {@link Session} call of rest method error.
7755
- * @event WARN
7756
- * @memberof Flashphoner.constants.SESSION_STATUS
7757
- */
7753
+ /**
7754
+ * Fires if {@link Session} call of rest method error.
7755
+ * @event WARN
7756
+ * @memberof Flashphoner.constants.SESSION_STATUS
7757
+ */
7758
+ WARN: 'WARN',
7758
7759
 
7759
- define(sessionStatus, 'WARN', 'WARN');
7760
- /**
7761
- * Fires if {@link Session} connection failed.
7762
- * Some of the reasons can be network connection failed, REST App failed
7763
- * @event FAILED
7764
- * @memberof Flashphoner.constants.SESSION_STATUS
7765
- */
7760
+ /**
7761
+ * Fires if {@link Session} connection failed.
7762
+ * Some of the reasons can be network connection failed, REST App failed
7763
+ * @event FAILED
7764
+ * @memberof Flashphoner.constants.SESSION_STATUS
7765
+ */
7766
+ FAILED: 'FAILED',
7766
7767
 
7767
- define(sessionStatus, 'FAILED', 'FAILED');
7768
- /**
7769
- * Fires wneh {@link Session} receives debug event
7770
- * @event DEBUG
7771
- * @memberof Flashphoner.constants.SESSION_STATUS
7772
- */
7768
+ /**
7769
+ * Fires wneh {@link Session} receives debug event
7770
+ * @event DEBUG
7771
+ * @memberof Flashphoner.constants.SESSION_STATUS
7772
+ */
7773
+ DEBUG: 'DEBUG',
7773
7774
 
7774
- define(sessionStatus, 'DEBUG', 'DEBUG');
7775
- /**
7776
- * Fires when {@link Session} receives custom REST App message.
7777
- *
7778
- * @event APP_DATA
7779
- * @memberof Flashphoner.constants.SESSION_STATUS
7780
- */
7775
+ /**
7776
+ * Fires when {@link Session} receives custom REST App message.
7777
+ *
7778
+ * @event APP_DATA
7779
+ * @memberof Flashphoner.constants.SESSION_STATUS
7780
+ */
7781
+ APP_DATA: 'APP_DATA',
7781
7782
 
7782
- define(sessionStatus, 'APP_DATA', 'APP_DATA');
7783
- /**
7784
- * Fires when {@link Session} receives status of sendData operation.
7785
- *
7786
- * @event SEND_DATA_STATUS
7787
- * @memberof Flashphoner.constants.SESSION_STATUS
7788
- */
7783
+ /**
7784
+ * Fires when {@link Session} receives status of sendData operation.
7785
+ *
7786
+ * @event SEND_DATA_STATUS
7787
+ * @memberof Flashphoner.constants.SESSION_STATUS
7788
+ */
7789
+ SEND_DATA_STATUS: 'SEND_DATA_STATUS',
7789
7790
 
7790
- define(sessionStatus, 'SEND_DATA_STATUS', 'SEND_DATA_STATUS'); //State of newly created Session
7791
+ /**
7792
+ * State of newly created {@link Session}.
7793
+ *
7794
+ * @event PENDING
7795
+ * @memberof Flashphoner.constants.SESSION_STATUS
7796
+ */
7797
+ PENDING: 'PENDING',
7791
7798
 
7792
- define(sessionStatus, 'PENDING', 'PENDING');
7793
- /**
7794
- * Fires when {@link Session} registers as sip client.
7795
- *
7796
- * @event APP_DATA
7797
- * @memberof Flashphoner.constants.SESSION_STATUS
7798
- */
7799
+ /**
7800
+ * Fires when {@link Session} registers as sip client.
7801
+ *
7802
+ * @event REGISTERED
7803
+ * @memberof Flashphoner.constants.SESSION_STATUS
7804
+ */
7805
+ REGISTERED: 'REGISTERED',
7799
7806
 
7800
- define(sessionStatus, 'REGISTERED', 'REGISTERED');
7801
- /**
7802
- * Fires when {@link Session} unregisters as sip client.
7803
- *
7804
- * @event APP_DATA
7805
- * @memberof Flashphoner.constants.SESSION_STATUS
7806
- */
7807
+ /**
7808
+ * Fires when {@link Session} unregisters as sip client.
7809
+ *
7810
+ * @event UNREGISTERED
7811
+ * @memberof Flashphoner.constants.SESSION_STATUS
7812
+ */
7813
+ UNREGISTERED: 'UNREGISTERED',
7807
7814
 
7808
- define(sessionStatus, 'UNREGISTERED', 'UNREGISTERED');
7809
- define(sessionStatus, 'INCOMING_CALL', 'INCOMING_CALL');
7815
+ /**
7816
+ * Fires when {@link Session} receives an incoming call.
7817
+ *
7818
+ * @event INCOMING_CALL
7819
+ * @memberof Flashphoner.constants.SESSION_STATUS
7820
+ */
7821
+ INCOMING_CALL: 'INCOMING_CALL'
7822
+ });
7810
7823
  /**
7811
7824
  * @namespace Flashphoner.constants.STREAM_STATUS
7812
7825
  * @see Stream
7813
7826
  */
7814
7827
 
7815
- var streamStatus = {}; //State of newly created Stream
7816
-
7817
- define(streamStatus, 'NEW', 'NEW'); //State between publish/play and server response
7828
+ var STREAM_STATUS = Object.freeze({
7829
+ /**
7830
+ * State of newly created {@link Stream}.
7831
+ *
7832
+ * @event NEW
7833
+ * @memberof Flashphoner.constants.STREAM_STATUS
7834
+ */
7835
+ NEW: 'NEW',
7818
7836
 
7819
- define(streamStatus, 'PENDING', 'PENDING');
7820
- /**
7821
- * Fires when {@link Stream} starts publishing.
7822
- * @event PUBLISHING
7823
- * @memberof Flashphoner.constants.STREAM_STATUS
7824
- */
7837
+ /**
7838
+ * State before {@link Stream} publishing/playing.
7839
+ *
7840
+ * @event PENDING
7841
+ * @memberof Flashphoner.constants.STREAM_STATUS
7842
+ */
7843
+ PENDING: 'PENDING',
7825
7844
 
7826
- define(streamStatus, 'PUBLISHING', 'PUBLISHING');
7827
- /**
7828
- * Fires when {@link Stream} starts playing.
7829
- * @event PLAYING
7830
- * @memberof Flashphoner.constants.STREAM_STATUS
7831
- */
7845
+ /**
7846
+ * Fires when {@link Stream} starts publishing.
7847
+ * @event PUBLISHING
7848
+ * @memberof Flashphoner.constants.STREAM_STATUS
7849
+ */
7850
+ PUBLISHING: 'PUBLISHING',
7832
7851
 
7833
- define(streamStatus, 'PLAYING', 'PLAYING');
7834
- /**
7835
- * Fires if {@link Stream} paused.
7836
- * @event PAUSED
7837
- * @memberof Flashphoner.constants.STREAM_STATUS
7838
- */
7852
+ /**
7853
+ * Fires when {@link Stream} starts playing.
7854
+ * @event PLAYING
7855
+ * @memberof Flashphoner.constants.STREAM_STATUS
7856
+ */
7857
+ PLAYING: 'PLAYING',
7839
7858
 
7840
- define(streamStatus, 'PAUSED', 'PAUSED');
7841
- /**
7842
- * Fires if {@link Stream} was unpublished.
7843
- * @event UNPUBLISHING
7844
- * @memberof Flashphoner.constants.STREAM_STATUS
7845
- */
7859
+ /**
7860
+ * Fires if {@link Stream} paused.
7861
+ * @event PAUSED
7862
+ * @memberof Flashphoner.constants.STREAM_STATUS
7863
+ */
7864
+ PAUSED: 'PAUSED',
7846
7865
 
7847
- define(streamStatus, 'UNPUBLISHED', 'UNPUBLISHED');
7848
- /**
7849
- * Fires if {@link Stream} was stopped.
7850
- * @event STOPPED
7851
- * @memberof Flashphoner.constants.STREAM_STATUS
7852
- */
7866
+ /**
7867
+ * Fires if {@link Stream} was unpublished.
7868
+ * @event UNPUBLISHED
7869
+ * @memberof Flashphoner.constants.STREAM_STATUS
7870
+ */
7871
+ UNPUBLISHED: 'UNPUBLISHED',
7853
7872
 
7854
- define(streamStatus, 'STOPPED', 'STOPPED');
7855
- /**
7856
- * Fires if {@link Stream} failed.
7857
- * @event FAILED
7858
- * @memberof Flashphoner.constants.STREAM_STATUS
7859
- */
7873
+ /**
7874
+ * Fires if playing {@link Stream} was stopped.
7875
+ * @event STOPPED
7876
+ * @memberof Flashphoner.constants.STREAM_STATUS
7877
+ */
7878
+ STOPPED: 'STOPPED',
7860
7879
 
7861
- define(streamStatus, 'FAILED', 'FAILED');
7862
- /**
7863
- * Fires if {@link Stream} playback problem.
7864
- * @event PLAYBACK_PROBLEM
7865
- * @memberof Flashphoner.constants.STREAM_STATUS
7866
- */
7880
+ /**
7881
+ * Fires if {@link Stream} failed.
7882
+ * @event FAILED
7883
+ * @memberof Flashphoner.constants.STREAM_STATUS
7884
+ */
7885
+ FAILED: 'FAILED',
7867
7886
 
7868
- define(streamStatus, 'PLAYBACK_PROBLEM', 'PLAYBACK_PROBLEM');
7869
- /**
7870
- * Fires if {@link Stream} resize.
7871
- * @event RESIZE
7872
- * @memberof Flashphoner.constants.STREAM_STATUS
7873
- */
7887
+ /**
7888
+ * Fires if {@link Stream} playback problem.
7889
+ * @event PLAYBACK_PROBLEM
7890
+ * @memberof Flashphoner.constants.STREAM_STATUS
7891
+ */
7892
+ PLAYBACK_PROBLEM: 'PLAYBACK_PROBLEM',
7874
7893
 
7875
- define(streamStatus, 'RESIZE', 'RESIZE');
7876
- /**
7877
- * Fires when {@link Stream} snapshot becomes available.
7878
- * Snapshot is base64 encoded png available through {@link Stream.getInfo}
7879
- * @event SNAPSHOT_COMPLETE
7880
- * @memberof Flashphoner.constants.STREAM_STATUS
7881
- */
7894
+ /**
7895
+ * @deprecated WCS-3228 moved to {@link STREAM_EVENT_TYPE}
7896
+ * Fires if playing {@link Stream} picture resizing.
7897
+ * @event RESIZE
7898
+ * @memberof Flashphoner.constants.STREAM_STATUS
7899
+ */
7900
+ RESIZE: 'RESIZE',
7882
7901
 
7883
- define(streamStatus, 'SNAPSHOT_COMPLETE', 'SNAPSHOT_COMPLETE');
7884
- /**
7885
- * Fires on subscribe {@link Stream} if bitrate is higher than available network bandwidth.
7886
- * @event NOT_ENOUGH_BANDWIDTH
7887
- * @memberof Flashphoner.constants.NOT_ENOUGH_BANDWIDTH
7888
- */
7902
+ /**
7903
+ * @deprecated WCS-3228 moved to {@link STREAM_EVENT_TYPE}
7904
+ * Fires when {@link Stream} snapshot becomes available.
7905
+ * Snapshot is base64 encoded png available through {@link Stream.getInfo}
7906
+ * @event SNAPSHOT_COMPLETE
7907
+ * @memberof Flashphoner.constants.STREAM_STATUS
7908
+ */
7909
+ SNAPSHOT_COMPLETE: 'SNAPSHOT_COMPLETE',
7889
7910
 
7890
- define(streamStatus, 'NOT_ENOUGH_BANDWIDTH', 'NOT_ENOUGH_BANDWIDTH');
7911
+ /**
7912
+ * @deprecated WCS-3228 moved to {@link STREAM_EVENT_TYPE}
7913
+ * Fires on playing {@link Stream} if bitrate is higher than available network bandwidth.
7914
+ * @event NOT_ENOUGH_BANDWIDTH
7915
+ * @memberof Flashphoner.constants.NOT_ENOUGH_BANDWIDTH
7916
+ */
7917
+ NOT_ENOUGH_BANDWIDTH: 'NOT_ENOUGH_BANDWIDTH'
7918
+ });
7891
7919
  /**
7892
7920
  * @namespace Flashphoner.constants.CALL_STATUS
7893
7921
  * @see Call
7894
7922
  */
7895
7923
 
7896
- var callStatus = {}; //State of newly created Call
7897
-
7898
- define(callStatus, 'NEW', 'NEW');
7899
- define(callStatus, 'RING', 'RING');
7900
- define(callStatus, 'RING_MEDIA', 'RING_MEDIA');
7901
- define(callStatus, 'HOLD', 'HOLD');
7902
- define(callStatus, 'ESTABLISHED', 'ESTABLISHED');
7903
- define(callStatus, 'FINISH', 'FINISH');
7904
- define(callStatus, 'BUSY', 'BUSY');
7905
- define(callStatus, 'SESSION_PROGRESS', 'SESSION_PROGRESS');
7906
- define(callStatus, 'FAILED', 'FAILED');
7907
- define(callStatus, 'PENDING', 'PENDING');
7908
- define(callStatus, 'TRYING', 'TRYING');
7924
+ var CALL_STATUS = Object.freeze({
7925
+ /**
7926
+ * State of newly created {@link Call}
7927
+ * @event NEW
7928
+ * @memberof Flashphoner.constants.CALL_STATUS
7929
+ */
7930
+ NEW: 'NEW',
7931
+
7932
+ /**
7933
+ * The server is ringing to the callee
7934
+ * @event RING
7935
+ * @memberof Flashphoner.constants.CALL_STATUS
7936
+ */
7937
+ RING: 'RING',
7938
+ RING_MEDIA: 'RING_MEDIA',
7939
+
7940
+ /**
7941
+ * The {@link Call} was put on hold
7942
+ * @event HOLD
7943
+ * @memberof Flashphoner.constants.CALL_STATUS
7944
+ */
7945
+ HOLD: 'HOLD',
7946
+
7947
+ /**
7948
+ * The {@link Call} is established
7949
+ * @event ESTABLISHED
7950
+ * @memberof Flashphoner.constants.CALL_STATUS
7951
+ */
7952
+ ESTABLISHED: 'ESTABLISHED',
7953
+
7954
+ /**
7955
+ * The {@link Call} is finished
7956
+ * @event FINISH
7957
+ * @memberof Flashphoner.constants.CALL_STATUS
7958
+ */
7959
+ FINISH: 'FINISH',
7960
+
7961
+ /**
7962
+ * Callee is busy
7963
+ * @event BUSY
7964
+ * @memberof Flashphoner.constants.CALL_STATUS
7965
+ */
7966
+ BUSY: 'BUSY',
7967
+
7968
+ /**
7969
+ * SIP session is in progress
7970
+ * @event SESSION_PROGRESS
7971
+ * @memberof Flashphoner.constants.CALL_STATUS
7972
+ */
7973
+ SESSION_PROGRESS: 'SESSION_PROGRESS',
7974
+
7975
+ /**
7976
+ * The {@link Call} is failed
7977
+ * @event FAILED
7978
+ * @memberof Flashphoner.constants.CALL_STATUS
7979
+ */
7980
+ FAILED: 'FAILED',
7981
+
7982
+ /**
7983
+ * The {@link Call} state before ringing
7984
+ * @event PENDING
7985
+ * @memberof Flashphoner.constants.CALL_STATUS
7986
+ */
7987
+ PENDING: 'PENDING',
7988
+
7989
+ /**
7990
+ * The server trying to establish {@link Call}
7991
+ * @event TRYING
7992
+ * @memberof Flashphoner.constants.CALL_STATUS
7993
+ */
7994
+ TRYING: 'TRYING'
7995
+ });
7909
7996
  /**
7910
7997
  * @namespace Flashphoner.constants.STREAM_STATUS_INFO
7911
7998
  * @see Stream
7912
7999
  */
7913
8000
 
7914
- var streamStatusInfo = {};
7915
- /**
7916
- * Indicates general error during ICE negotiation. Usually occurs if client is behind some exotic nat/firewall.
7917
- * @event FAILED_BY_ICE_ERROR
7918
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
7919
- */
7920
-
7921
- define(streamStatusInfo, 'FAILED_BY_ICE_ERROR', 'Failed by ICE error');
7922
- /**
7923
- * Timeout has been reached during ICE establishment.
7924
- * @event FAILED_BY_ICE_TIMEOUT
7925
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
7926
- */
8001
+ var STREAM_STATUS_INFO = Object.freeze({
8002
+ /**
8003
+ * Indicates general error during ICE negotiation. Usually occurs if client is behind some exotic nat/firewall.
8004
+ * @event FAILED_BY_ICE_ERROR
8005
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8006
+ */
8007
+ FAILED_BY_ICE_ERROR: 'Failed by ICE error',
7927
8008
 
7928
- define(streamStatusInfo, 'FAILED_BY_ICE_TIMEOUT', 'Failed by ICE timeout');
7929
- /**
7930
- * ICE refresh failed on session.
7931
- * @event FAILED_BY_KEEP_ALIVE
7932
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
7933
- */
8009
+ /**
8010
+ * Timeout has been reached during ICE establishment.
8011
+ * @event FAILED_BY_ICE_TIMEOUT
8012
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8013
+ */
8014
+ FAILED_BY_ICE_TIMEOUT: 'Failed by ICE timeout',
7934
8015
 
7935
- define(streamStatusInfo, 'FAILED_BY_KEEP_ALIVE', 'Failed by ICE keep alive');
7936
- /**
7937
- * DTLS has wrong fingerprint.
7938
- * @event FAILED_BY_DTLS_FINGERPRINT_ERROR
7939
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
7940
- */
8016
+ /**
8017
+ * ICE refresh failed on session.
8018
+ * @event FAILED_BY_KEEP_ALIVE
8019
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8020
+ */
8021
+ FAILED_BY_KEEP_ALIVE: 'Failed by ICE keep alive',
7941
8022
 
7942
- define(streamStatusInfo, 'FAILED_BY_DTLS_FINGERPRINT_ERROR', 'Failed by DTLS fingerprint error');
7943
- /**
7944
- * Client did not send DTLS packets or packets were lost/corrupted during transmission.
7945
- * @event FAILED_BY_DTLS_ERROR
7946
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
7947
- */
8023
+ /**
8024
+ * DTLS has wrong fingerprint.
8025
+ * @event FAILED_BY_DTLS_FINGERPRINT_ERROR
8026
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8027
+ */
8028
+ FAILED_BY_DTLS_FINGERPRINT_ERROR: 'Failed by DTLS fingerprint error',
7948
8029
 
7949
- define(streamStatusInfo, 'FAILED_BY_DTLS_ERROR', 'Failed by DTLS error');
7950
- /**
7951
- * Indicates general HLS packetizer error, can occur during initialization or packetization (wrong input or out of disk space).
7952
- * @event FAILED_BY_HLS_WRITER_ERROR
7953
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
7954
- */
8030
+ /**
8031
+ * Client did not send DTLS packets or packets were lost/corrupted during transmission.
8032
+ * @event FAILED_BY_DTLS_ERROR
8033
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8034
+ */
8035
+ FAILED_BY_DTLS_ERROR: 'Failed by DTLS error',
7955
8036
 
7956
- define(streamStatusInfo, 'FAILED_BY_HLS_WRITER_ERROR', 'Failed by HLS writer error');
7957
- /**
7958
- * Indicates general RTMP republishing error, can occur during initialization or rtmp packetization.
7959
- * @event FAILED_BY_RTMP_WRITER_ERROR
7960
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
7961
- */
8037
+ /**
8038
+ * Indicates general HLS packetizer error, can occur during initialization or packetization (wrong input or out of disk space).
8039
+ * @event FAILED_BY_HLS_WRITER_ERROR
8040
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8041
+ */
8042
+ FAILED_BY_HLS_WRITER_ERROR: 'Failed by HLS writer error',
7962
8043
 
7963
- define(streamStatusInfo, 'FAILED_BY_RTMP_WRITER_ERROR', 'Failed by RTMP writer error');
7964
- /**
7965
- * RTP session failed by RTP activity timer.
7966
- * @event FAILED_BY_RTP_ACTIVITY
7967
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
7968
- */
8044
+ /**
8045
+ * Indicates general RTMP republishing error, can occur during initialization or rtmp packetization.
8046
+ * @event FAILED_BY_RTMP_WRITER_ERROR
8047
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8048
+ */
8049
+ FAILED_BY_RTMP_WRITER_ERROR: 'Failed by RTMP writer error',
7969
8050
 
7970
- define(streamStatusInfo, 'FAILED_BY_RTP_ACTIVITY', 'Failed by RTP activity');
7971
- /**
7972
- * Related session was disconnected.
7973
- * @event STOPPED_BY_SESSION_DISCONNECT
7974
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
7975
- */
8051
+ /**
8052
+ * RTP session failed by RTP activity timer.
8053
+ * @event FAILED_BY_RTP_ACTIVITY
8054
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8055
+ */
8056
+ FAILED_BY_RTP_ACTIVITY: 'Failed by RTP activity',
7976
8057
 
7977
- define(streamStatusInfo, 'STOPPED_BY_SESSION_DISCONNECT', 'Stopped by session disconnect');
7978
- /**
7979
- * Stream was stopped by rest terminate request.
7980
- * @event STOPPED_BY_REST_TERMINATE
7981
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
7982
- */
8058
+ /**
8059
+ * Related session was disconnected.
8060
+ * @event STOPPED_BY_SESSION_DISCONNECT
8061
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8062
+ */
8063
+ STOPPED_BY_SESSION_DISCONNECT: 'Stopped by session disconnect',
7983
8064
 
7984
- define(streamStatusInfo, 'STOPPED_BY_REST_TERMINATE', 'Stopped by rest /terminate');
7985
- /**
7986
- * Related publisher stopped its stream or lost connection.
7987
- * @event STOPPED_BY_PUBLISHER_STOP
7988
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
7989
- */
8065
+ /**
8066
+ * Stream was stopped by rest terminate request.
8067
+ * @event STOPPED_BY_REST_TERMINATE
8068
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8069
+ */
8070
+ STOPPED_BY_REST_TERMINATE: 'Stopped by rest /terminate',
7990
8071
 
7991
- define(streamStatusInfo, 'STOPPED_BY_PUBLISHER_STOP', 'Stopped by publisher stop');
7992
- /**
7993
- * Stop the media session by user after call was finished or unpublish stream.
7994
- * @event STOPPED_BY_USER
7995
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
7996
- */
8072
+ /**
8073
+ * Related publisher stopped its stream or lost connection.
8074
+ * @event STOPPED_BY_PUBLISHER_STOP
8075
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8076
+ */
8077
+ STOPPED_BY_PUBLISHER_STOP: 'Stopped by publisher stop',
7997
8078
 
7998
- define(streamStatusInfo, 'STOPPED_BY_USER', 'Stopped by user');
7999
- /**
8000
- * Error occurred on the stream.
8001
- * @event FAILED_BY_ERROR
8002
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8003
- */
8079
+ /**
8080
+ * Stop the media session by user after call was finished or unpublish stream.
8081
+ * @event STOPPED_BY_USER
8082
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8083
+ */
8084
+ STOPPED_BY_USER: 'Stopped by user',
8004
8085
 
8005
- define(streamStatusInfo, 'FAILED_BY_ERROR', 'Failed by error');
8006
- /**
8007
- * Indicates that error occurred during media session creation. This might be SDP parsing error, all ports are busy, wrong session related config etc.
8008
- * @event FAILED_TO_ADD_STREAM_TO_PROXY
8009
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8010
- */
8086
+ /**
8087
+ * Error occurred on the stream.
8088
+ * @event FAILED_BY_ERROR
8089
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8090
+ */
8091
+ FAILED_BY_ERROR: 'Failed by error',
8011
8092
 
8012
- define(streamStatusInfo, 'FAILED_TO_ADD_STREAM_TO_PROXY', 'Failed to add stream to proxy');
8013
- /**
8014
- * Stopped shapshot distributor.
8015
- * @event DISTRIBUTOR_STOPPED
8016
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8017
- */
8093
+ /**
8094
+ * Indicates that error occurred during media session creation. This might be SDP parsing error, all ports are busy, wrong session related config etc.
8095
+ * @event FAILED_TO_ADD_STREAM_TO_PROXY
8096
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8097
+ */
8098
+ FAILED_TO_ADD_STREAM_TO_PROXY: 'Failed to add stream to proxy',
8018
8099
 
8019
- define(streamStatusInfo, 'DISTRIBUTOR_STOPPED', 'Distributor stopped');
8020
- /**
8021
- * Publish stream is not ready, try again later.
8022
- * @event PUBLISH_STREAM_IS_NOT_READY
8023
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8024
- */
8100
+ /**
8101
+ * Stopped shapshot distributor.
8102
+ * @event DISTRIBUTOR_STOPPED
8103
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8104
+ */
8105
+ DISTRIBUTOR_STOPPED: 'Distributor stopped',
8025
8106
 
8026
- define(streamStatusInfo, 'PUBLISH_STREAM_IS_NOT_READY', 'Publish stream is not ready');
8027
- /**
8028
- * Stream with this name is not found, check the correct of the name.
8029
- * @event STREAM_NOT_FOUND
8030
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8031
- */
8107
+ /**
8108
+ * Publish stream is not ready, try again later.
8109
+ * @event PUBLISH_STREAM_IS_NOT_READY
8110
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8111
+ */
8112
+ PUBLISH_STREAM_IS_NOT_READY: 'Publish stream is not ready',
8032
8113
 
8033
- define(streamStatusInfo, 'STREAM_NOT_FOUND', 'Stream not found');
8034
- /**
8035
- * Server already has a publish stream with the same name, try using different one.
8036
- * @event STREAM_NAME_ALREADY_IN_USE
8037
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8038
- */
8114
+ /**
8115
+ * Stream with this name is not found, check the correct of the name.
8116
+ * @event STREAM_NOT_FOUND
8117
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8118
+ */
8119
+ STREAM_NOT_FOUND: 'Stream not found',
8039
8120
 
8040
- define(streamStatusInfo, 'STREAM_NAME_ALREADY_IN_USE', 'Stream name is already in use');
8041
- /**
8042
- * Error indicates that stream object received by server has empty mediaSessionId field.
8043
- * @event MEDIASESSION_ID_NULL
8044
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8045
- */
8121
+ /**
8122
+ * Server already has a publish stream with the same name, try using different one.
8123
+ * @event STREAM_NAME_ALREADY_IN_USE
8124
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8125
+ */
8126
+ STREAM_NAME_ALREADY_IN_USE: 'Stream name is already in use',
8046
8127
 
8047
- define(streamStatusInfo, 'MEDIASESSION_ID_NULL', 'MediaSessionId is null');
8048
- /**
8049
- * Published or subscribed sessions used this MediaSessionId.
8050
- * @event MEDIASESSION_ID_ALREADY_IN_USE
8051
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8052
- */
8128
+ /**
8129
+ * Error indicates that stream object received by server has empty mediaSessionId field.
8130
+ * @event MEDIASESSION_ID_NULL
8131
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8132
+ */
8133
+ MEDIASESSION_ID_NULL: 'MediaSessionId is null',
8053
8134
 
8054
- define(streamStatusInfo, 'MEDIASESSION_ID_ALREADY_IN_USE', 'MediaSessionId is already in use');
8055
- /**
8056
- * Session is not initialized or terminated on play ordinary stream.
8057
- * @event SESSION_NOT_READY
8058
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8059
- */
8135
+ /**
8136
+ * Published or subscribed sessions used this MediaSessionId.
8137
+ * @event MEDIASESSION_ID_ALREADY_IN_USE
8138
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8139
+ */
8140
+ MEDIASESSION_ID_ALREADY_IN_USE: 'MediaSessionId is already in use',
8060
8141
 
8061
- define(streamStatusInfo, 'SESSION_NOT_READY', 'Session not ready');
8062
- /**
8063
- * Actual session does not exist.
8064
- * @event SESSION_DOES_NOT_EXIST
8065
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8066
- */
8142
+ /**
8143
+ * Session is not initialized or terminated on play ordinary stream.
8144
+ * @event SESSION_NOT_READY
8145
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8146
+ */
8147
+ SESSION_NOT_READY: 'Session not ready',
8067
8148
 
8068
- define(streamStatusInfo, 'SESSION_DOES_NOT_EXIST', 'Session does not exist');
8069
- /**
8070
- * RTSP has wrong format on play stream, check correct of the RTSP url.
8071
- * @event RTSP_HAS_WRONG_FORMAT
8072
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8073
- */
8149
+ /**
8150
+ * Actual session does not exist.
8151
+ * @event SESSION_DOES_NOT_EXIST
8152
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8153
+ */
8154
+ SESSION_DOES_NOT_EXIST: 'Session does not exist',
8074
8155
 
8075
- define(streamStatusInfo, 'RTSP_HAS_WRONG_FORMAT', 'Rtsp has wrong format');
8076
- /**
8077
- * Failed to play vod stream, this format is not supported.
8078
- * @event FILE_HAS_WRONG_FORMAT
8079
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8080
- */
8156
+ /**
8157
+ * RTSP has wrong format on play stream, check the RTSP url validity.
8158
+ * @event RTSP_HAS_WRONG_FORMAT
8159
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8160
+ */
8161
+ RTSP_HAS_WRONG_FORMAT: 'Rtsp has wrong format',
8081
8162
 
8082
- define(streamStatusInfo, 'FILE_HAS_WRONG_FORMAT', 'File has wrong format');
8083
- /**
8084
- * Failed to connect to rtsp stream.
8085
- * @event FAILED_TO_CONNECT_TO_RTSP_STREAM
8086
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8087
- */
8163
+ /**
8164
+ * Failed to play vod stream, this format is not supported.
8165
+ * @event FILE_HAS_WRONG_FORMAT
8166
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8167
+ */
8168
+ FILE_HAS_WRONG_FORMAT: 'File has wrong format',
8088
8169
 
8089
- define(streamStatusInfo, 'FAILED_TO_CONNECT_TO_RTSP_STREAM', 'Failed to connect to rtsp stream');
8090
- /**
8091
- * Rtsp stream is not found, agent received "404-Not Found".
8092
- * @event RTSP_STREAM_NOT_FOUND
8093
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8094
- */
8170
+ /**
8171
+ * Failed to connect to rtsp stream.
8172
+ * @event FAILED_TO_CONNECT_TO_RTSP_STREAM
8173
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8174
+ */
8175
+ FAILED_TO_CONNECT_TO_RTSP_STREAM: 'Failed to connect to rtsp stream',
8095
8176
 
8096
- define(streamStatusInfo, 'RTSP_STREAM_NOT_FOUND', 'Rtsp stream not found');
8097
- /**
8098
- * On shutdown RTSP agent.
8099
- * @event RTSPAGENT_SHUTDOWN
8100
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8101
- */
8177
+ /**
8178
+ * Rtsp stream is not found, agent received "404-Not Found".
8179
+ * @event RTSP_STREAM_NOT_FOUND
8180
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8181
+ */
8182
+ RTSP_STREAM_NOT_FOUND: 'Rtsp stream not found',
8102
8183
 
8103
- define(streamStatusInfo, 'RTSPAGENT_SHUTDOWN', 'RtspAgent shutdown');
8104
- /**
8105
- * Stream failed
8106
- * @event STREAM_FAILED
8107
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8108
- */
8184
+ /**
8185
+ * On shutdown RTSP agent.
8186
+ * @event RTSPAGENT_SHUTDOWN
8187
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8188
+ */
8189
+ RTSPAGENT_SHUTDOWN: 'RtspAgent shutdown',
8109
8190
 
8110
- define(streamStatusInfo, 'STREAM_FAILED', 'Stream failed');
8111
- /**
8112
- * No common codecs on setup track, did not found corresponding trackId->mediaPort.
8113
- * @event NO_COMMON_CODECS
8114
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8115
- */
8191
+ /**
8192
+ * Stream failed
8193
+ * @event STREAM_FAILED
8194
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8195
+ */
8196
+ STREAM_FAILED: 'Stream failed',
8116
8197
 
8117
- define(streamStatusInfo, 'NO_COMMON_CODECS', 'No common codecs');
8118
- /**
8119
- * Bad referenced rtsp link, check for correct, example: rtsp://user:b@d_password@127.0.0.1/stream.
8120
- * @event BAD_URI
8121
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8122
- */
8198
+ /**
8199
+ * No common codecs on setup track, did not found corresponding trackId->mediaPort.
8200
+ * @event NO_COMMON_CODECS
8201
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8202
+ */
8203
+ NO_COMMON_CODECS: 'No common codecs',
8123
8204
 
8124
- define(streamStatusInfo, 'BAD_URI', 'Bad URI');
8125
- /**
8126
- * General VOD error, indicates that Exception occurred while reading/processing media file.
8127
- * @event GOT_EXCEPTION_WHILE_STREAMING_FILE
8128
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8129
- */
8205
+ /**
8206
+ * Bad referenced rtsp link, check for correct, example: rtsp://user:b@d_password@127.0.0.1/stream.
8207
+ * @event BAD_URI
8208
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8209
+ */
8210
+ BAD_URI: 'Bad URI',
8130
8211
 
8131
- define(streamStatusInfo, 'GOT_EXCEPTION_WHILE_STREAMING_FILE', 'Got exception while streaming file');
8132
- /**
8133
- * Requested stream shutdown.
8134
- * @event REQUESTED_STREAM_SHUTDOWN
8135
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8136
- */
8212
+ /**
8213
+ * General VOD error, indicates that Exception occurred while reading/processing media file.
8214
+ * @event GOT_EXCEPTION_WHILE_STREAMING_FILE
8215
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8216
+ */
8217
+ GOT_EXCEPTION_WHILE_STREAMING_FILE: 'Got exception while streaming file',
8137
8218
 
8138
- define(streamStatusInfo, 'REQUESTED_STREAM_SHUTDOWN', 'Requested stream shutdown');
8139
- /**
8140
- * Failed to create movie, file can not be read.
8141
- * @event FAILED_TO_READ_FILE
8142
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8143
- */
8219
+ /**
8220
+ * Requested stream shutdown.
8221
+ * @event REQUESTED_STREAM_SHUTDOWN
8222
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8223
+ */
8224
+ REQUESTED_STREAM_SHUTDOWN: 'Requested stream shutdown',
8144
8225
 
8145
- define(streamStatusInfo, 'FAILED_TO_READ_FILE', 'Failed to read file');
8146
- /**
8147
- * File does not exist, check filename.
8148
- * @event FILE_NOT_FOUND
8149
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8150
- */
8226
+ /**
8227
+ * Failed to create movie, file can not be read.
8228
+ * @event FAILED_TO_READ_FILE
8229
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8230
+ */
8231
+ FAILED_TO_READ_FILE: 'Failed to read file',
8151
8232
 
8152
- define(streamStatusInfo, 'FILE_NOT_FOUND', 'File not found');
8153
- /**
8154
- * Server failed to establish websocket connection with origin server.
8155
- * @event FAILED_TO_CONNECT_TO_ORIGIN_STREAM
8156
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8157
- */
8233
+ /**
8234
+ * File does not exist, check filename.
8235
+ * @event FILE_NOT_FOUND
8236
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8237
+ */
8238
+ FILE_NOT_FOUND: 'File not found',
8158
8239
 
8159
- define(streamStatusInfo, 'FAILED_TO_CONNECT_TO_ORIGIN_STREAM', 'Failed to connect to origin stream');
8160
- /**
8161
- * CDN stream not found.
8162
- * @event CDN_STREAM_NOT_FOUND
8163
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8164
- */
8240
+ /**
8241
+ * Server failed to establish websocket connection with origin server.
8242
+ * @event FAILED_TO_CONNECT_TO_ORIGIN_STREAM
8243
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8244
+ */
8245
+ FAILED_TO_CONNECT_TO_ORIGIN_STREAM: 'Failed to connect to origin stream',
8165
8246
 
8166
- define(streamStatusInfo, 'CDN_STREAM_NOT_FOUND', 'CDN stream not found');
8167
- /**
8168
- * Indicates that provided URL protocol in stream name is invalid.
8169
- * Valid: vod://file.mp4
8170
- * Invalid: dov://file.mp4
8171
- * @event FAILED_TO_GET_AGENT_STORAGE
8172
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8173
- */
8247
+ /**
8248
+ * CDN stream not found.
8249
+ * @event CDN_STREAM_NOT_FOUND
8250
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8251
+ */
8252
+ CDN_STREAM_NOT_FOUND: 'CDN stream not found',
8174
8253
 
8175
- define(streamStatusInfo, 'FAILED_TO_GET_AGENT_STORAGE', 'Failed to get agent storage');
8176
- /**
8177
- * Shutdown agent servicing origin stream.
8178
- * @event AGENT_SERVICING_ORIGIN_STREAM_IS_SHUTTING_DOWN
8179
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8180
- */
8254
+ /**
8255
+ * Indicates that provided URL protocol in stream name is invalid.
8256
+ * Valid: vod://file.mp4
8257
+ * Invalid: dov://file.mp4
8258
+ * @event FAILED_TO_GET_AGENT_STORAGE
8259
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8260
+ */
8261
+ FAILED_TO_GET_AGENT_STORAGE: 'Failed to get agent storage',
8181
8262
 
8182
- define(streamStatusInfo, 'AGENT_SERVICING_ORIGIN_STREAM_IS_SHUTTING_DOWN', 'Agent servicing origin stream is shutting down');
8183
- /**
8184
- * Terminated by keep-alive on walk through subscribers.
8185
- * @event TERMINATED_BY_KEEP_ALIVE
8186
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8187
- */
8263
+ /**
8264
+ * Shutdown agent servicing origin stream.
8265
+ * @event AGENT_SERVICING_ORIGIN_STREAM_IS_SHUTTING_DOWN
8266
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8267
+ */
8268
+ AGENT_SERVICING_ORIGIN_STREAM_IS_SHUTTING_DOWN: 'Agent servicing origin stream is shutting down',
8188
8269
 
8189
- define(streamStatusInfo, 'TERMINATED_BY_KEEP_ALIVE', 'Terminated by keep-alive');
8190
- /**
8191
- * Transcoding required, but disabled in settings
8192
- * @event TRANSCODING_REQUIRED_BUT_DISABLED
8193
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8194
- */
8270
+ /**
8271
+ * Terminated by keep-alive on walk through subscribers.
8272
+ * @event TERMINATED_BY_KEEP_ALIVE
8273
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8274
+ */
8275
+ TERMINATED_BY_KEEP_ALIVE: 'Terminated by keep-alive',
8195
8276
 
8196
- define(streamStatusInfo, 'TRANSCODING_REQUIRED_BUT_DISABLED', 'Transcoding required, but disabled');
8197
- /**
8198
- * Access restricted by access list
8199
- * @event RESTRICTED_ACCESS
8200
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8201
- */
8277
+ /**
8278
+ * Transcoding required, but disabled in server settings
8279
+ * @event TRANSCODING_REQUIRED_BUT_DISABLED
8280
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8281
+ */
8282
+ TRANSCODING_REQUIRED_BUT_DISABLED: 'Transcoding required, but disabled',
8202
8283
 
8203
- define(streamStatusInfo, 'RESTRICTED_ACCESS', 'Restricted access');
8204
- /**
8205
- * No available transcoders for stream
8206
- * @event RESTRICTED_ACCESS
8207
- * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8208
- */
8284
+ /**
8285
+ * Access restricted by access list
8286
+ * @event RESTRICTED_ACCESS
8287
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8288
+ */
8289
+ RESTRICTED_ACCESS: 'Restricted access',
8209
8290
 
8210
- define(streamStatusInfo, 'NO_AVAILABLE_TRANSCODERS', 'No available transcoders');
8291
+ /**
8292
+ * No available transcoders for stream
8293
+ * @event NO_AVAILABLE_TRANSCODERS
8294
+ * @memberof Flashphoner.constants.STREAM_STATUS_INFO
8295
+ */
8296
+ NO_AVAILABLE_TRANSCODERS: 'No available transcoders'
8297
+ });
8211
8298
  /**
8212
8299
  * @namespace Flashphoner.constants.CALL_STATUS_INFO
8213
8300
  * @see Call
8214
8301
  */
8215
8302
 
8216
- var callStatusInfo = {};
8217
- /**
8218
- * Normal call hangup.
8219
- * @event NORMAL_CALL_CLEARING
8220
- * @memberof Flashphoner.constants.CALL_STATUS_INFO
8221
- */
8222
-
8223
- define(callStatusInfo, 'NORMAL_CALL_CLEARING', 'Normal call clearing');
8224
- /**
8225
- * Error occurred on session creation.
8226
- * @event FAILED_BY_SESSION_CREATION
8227
- * @memberof Flashphoner.constants.CALL_STATUS_INFO
8228
- */
8303
+ var CALL_STATUS_INFO = Object.freeze({
8304
+ /**
8305
+ * Normal call hangup.
8306
+ * @event NORMAL_CALL_CLEARING
8307
+ * @memberof Flashphoner.constants.CALL_STATUS_INFO
8308
+ */
8309
+ NORMAL_CALL_CLEARING: 'Normal call clearing',
8229
8310
 
8230
- define(callStatusInfo, 'FAILED_BY_SESSION_CREATION', 'Failed by session creation');
8231
- /**
8232
- * Failed by error during ICE establishment.
8233
- * @event FAILED_BY_ICE_ERROR
8234
- * @memberof Flashphoner.constants.CALL_STATUS_INFO
8235
- */
8311
+ /**
8312
+ * Error occurred while creating a session
8313
+ * @event FAILED_BY_SESSION_CREATION
8314
+ * @memberof Flashphoner.constants.CALL_STATUS_INFO
8315
+ */
8316
+ FAILED_BY_SESSION_CREATION: 'Failed by session creation',
8236
8317
 
8237
- define(callStatusInfo, 'FAILED_BY_ICE_ERROR', 'Failed by ICE error');
8238
- /**
8239
- * RTP session failed by RTP activity timer.
8240
- * @event FAILED_BY_RTP_ACTIVITY
8241
- * @memberof Flashphoner.constants.CALL_STATUS_INFO
8242
- */
8318
+ /**
8319
+ * Failed by error during ICE establishment.
8320
+ * @event FAILED_BY_ICE_ERROR
8321
+ * @memberof Flashphoner.constants.CALL_STATUS_INFO
8322
+ */
8323
+ FAILED_BY_ICE_ERROR: 'Failed by ICE error',
8243
8324
 
8244
- define(callStatusInfo, 'FAILED_BY_RTP_ACTIVITY', 'Failed by RTP activity');
8245
- /**
8246
- * FF writer was failed on RTMP.
8247
- * @event FAILED_BY_RTMP_WRITER_ERROR
8248
- * @memberof Flashphoner.constants.CALL_STATUS_INFO
8249
- */
8325
+ /**
8326
+ * RTP session failed by RTP activity timer.
8327
+ * @event FAILED_BY_RTP_ACTIVITY
8328
+ * @memberof Flashphoner.constants.CALL_STATUS_INFO
8329
+ */
8330
+ FAILED_BY_RTP_ACTIVITY: 'Failed by RTP activity',
8250
8331
 
8251
- define(callStatusInfo, 'FAILED_BY_RTMP_WRITER_ERROR', 'Failed by RTMP writer error');
8252
- /**
8253
- * DTLS wrong fingerprint.
8254
- * @event FAILED_BY_DTLS_FINGERPRINT_ERROR
8255
- * @memberof Flashphoner.constants.CALL_STATUS_INFO
8256
- */
8332
+ /**
8333
+ * FF writer was failed on RTMP.
8334
+ * @event FAILED_BY_RTMP_WRITER_ERROR
8335
+ * @memberof Flashphoner.constants.CALL_STATUS_INFO
8336
+ */
8337
+ FAILED_BY_RTMP_WRITER_ERROR: 'Failed by RTMP writer error',
8257
8338
 
8258
- define(callStatusInfo, 'FAILED_BY_DTLS_FINGERPRINT_ERROR', 'Failed by DTLS fingerprint error');
8259
- /**
8260
- * No common codecs in sdp
8261
- * @event NO_COMMON_CODECS
8262
- * @memberof Flashphoner.constants.CALL_STATUS_INFO
8263
- */
8339
+ /**
8340
+ * DTLS wrong fingerprint.
8341
+ * @event FAILED_BY_DTLS_FINGERPRINT_ERROR
8342
+ * @memberof Flashphoner.constants.CALL_STATUS_INFO
8343
+ */
8344
+ FAILED_BY_DTLS_FINGERPRINT_ERROR: 'Failed by DTLS fingerprint error',
8264
8345
 
8265
- define(callStatusInfo, 'NO_COMMON_CODECS', 'No common codecs');
8266
- /**
8267
- * Client did not send DTLS packets or packets were lost/corrupted during transmission.
8268
- * @event FAILED_BY_DTLS_ERROR
8269
- * @memberof Flashphoner.constants.CALL_STATUS_INFO
8270
- */
8346
+ /**
8347
+ * No common codecs in sdp
8348
+ * @event NO_COMMON_CODECS
8349
+ * @memberof Flashphoner.constants.CALL_STATUS_INFO
8350
+ */
8351
+ NO_COMMON_CODECS: 'No common codecs',
8271
8352
 
8272
- define(callStatusInfo, 'FAILED_BY_DTLS_ERROR', 'Failed by DTLS error');
8273
- /**
8274
- * Error occurred during call
8275
- * @event FAILED_BY_ERROR
8276
- * @memberof Flashphoner.constants.CALL_STATUS_INFO
8277
- */
8353
+ /**
8354
+ * Client did not send DTLS packets or packets were lost/corrupted during transmission.
8355
+ * @event FAILED_BY_DTLS_ERROR
8356
+ * @memberof Flashphoner.constants.CALL_STATUS_INFO
8357
+ */
8358
+ FAILED_BY_DTLS_ERROR: 'Failed by DTLS error',
8278
8359
 
8279
- define(callStatusInfo, 'FAILED_BY_ERROR', 'Failed by error');
8280
- /**
8281
- * Call failed by request timeout
8282
- * @event FAILED_BY_REQUEST_TIMEOUT
8283
- * @memberof Flashphoner.constants.CALL_STATUS_INFO
8284
- */
8360
+ /**
8361
+ * Error occurred during the call
8362
+ * @event FAILED_BY_ERROR
8363
+ * @memberof Flashphoner.constants.CALL_STATUS_INFO
8364
+ */
8365
+ FAILED_BY_ERROR: 'Failed by error',
8285
8366
 
8286
- define(callStatusInfo, 'FAILED_BY_REQUEST_TIMEOUT', 'Failed by request timeout');
8287
- /**
8288
- * Transcoding required, but disabled in settings
8289
- * @event TRANSCODING_REQUIRED_BUT_DISABLED
8290
- * @memberof Flashphoner.constants.CALL_STATUS_INFO
8291
- */
8367
+ /**
8368
+ * Call failed by request timeout
8369
+ * @event FAILED_BY_REQUEST_TIMEOUT
8370
+ * @memberof Flashphoner.constants.CALL_STATUS_INFO
8371
+ */
8372
+ FAILED_BY_REQUEST_TIMEOUT: 'Failed by request timeout',
8292
8373
 
8293
- define(callStatusInfo, 'TRANSCODING_REQUIRED_BUT_DISABLED', 'Transcoding required, but disabled');
8374
+ /**
8375
+ * Transcoding required, but disabled in settings
8376
+ * @event TRANSCODING_REQUIRED_BUT_DISABLED
8377
+ * @memberof Flashphoner.constants.CALL_STATUS_INFO
8378
+ */
8379
+ TRANSCODING_REQUIRED_BUT_DISABLED: 'Transcoding required, but disabled'
8380
+ });
8294
8381
  /**
8295
8382
  * @namespace Flashphoner.constants.ERROR_INFO
8296
8383
  */
8297
8384
 
8298
- var errorInfo = {};
8299
- /**
8300
- * Error if none of MediaProviders available
8301
- * @event NONE_OF_MEDIAPROVIDERS_AVAILABLE
8302
- * @memberof Flashphoner.constants.ERROR_INFO
8303
- */
8385
+ var ERROR_INFO = Object.freeze({
8386
+ /**
8387
+ * Error if none of MediaProviders available
8388
+ * @event NONE_OF_MEDIAPROVIDERS_AVAILABLE
8389
+ * @memberof Flashphoner.constants.ERROR_INFO
8390
+ */
8391
+ NONE_OF_MEDIAPROVIDERS_AVAILABLE: 'None of MediaProviders available',
8304
8392
 
8305
- define(errorInfo, 'NONE_OF_MEDIAPROVIDERS_AVAILABLE', 'None of MediaProviders available');
8306
- /**
8307
- * Error if none of preferred MediaProviders available
8308
- * @event NONE_OF_PREFERRED_MEDIAPROVIDERS_AVAILABLE
8309
- * @memberof Flashphoner.constants.ERROR_INFO
8310
- */
8393
+ /**
8394
+ * Error if none of preferred MediaProviders available
8395
+ * @event NONE_OF_PREFERRED_MEDIAPROVIDERS_AVAILABLE
8396
+ * @memberof Flashphoner.constants.ERROR_INFO
8397
+ */
8398
+ NONE_OF_PREFERRED_MEDIAPROVIDERS_AVAILABLE: 'None of preferred MediaProviders available',
8311
8399
 
8312
- define(errorInfo, 'NONE_OF_PREFERRED_MEDIAPROVIDERS_AVAILABLE', 'None of preferred MediaProviders available');
8313
- /**
8314
- * Error if API is not initialized
8315
- * @event FLASHPHONER_API_NOT_INITIALIZED
8316
- * @memberof Flashphoner.constants.ERROR_INFO
8317
- */
8400
+ /**
8401
+ * Error if API is not initialized
8402
+ * @event FLASHPHONER_API_NOT_INITIALIZED
8403
+ * @memberof Flashphoner.constants.ERROR_INFO
8404
+ */
8405
+ FLASHPHONER_API_NOT_INITIALIZED: 'Flashphoner API is not initialized',
8318
8406
 
8319
- define(errorInfo, 'FLASHPHONER_API_NOT_INITIALIZED', 'Flashphoner API is not initialized');
8320
- /**
8321
- * Error if options.urlServer is not specified
8322
- * @event OPTIONS_URLSERVER_MUST_BE_PROVIDED
8323
- * @memberof Flashphoner.constants.ERROR_INFO
8324
- */
8407
+ /**
8408
+ * Error if options.urlServer is not specified
8409
+ * @event OPTIONS_URLSERVER_MUST_BE_PROVIDED
8410
+ * @memberof Flashphoner.constants.ERROR_INFO
8411
+ */
8412
+ OPTIONS_URLSERVER_MUST_BE_PROVIDED: 'options.urlServer must be provided',
8325
8413
 
8326
- define(errorInfo, 'OPTIONS_URLSERVER_MUST_BE_PROVIDED', 'options.urlServer must be provided');
8327
- /**
8328
- * Error if session state is not REGISTERED
8329
- * @event INVALID_SESSION_STATE
8330
- * @memberof Flashphoner.constants.ERROR_INFO
8331
- */
8414
+ /**
8415
+ * Error if session state is not valid
8416
+ * @event INVALID_SESSION_STATE
8417
+ * @memberof Flashphoner.constants.ERROR_INFO
8418
+ */
8419
+ INVALID_SESSION_STATE: 'Invalid session state',
8332
8420
 
8333
- define(errorInfo, 'INVALID_SESSION_STATE', 'Invalid session state');
8334
- /**
8335
- * Error if no options provided
8336
- * @event OPTIONS_MUST_BE_PROVIDED
8337
- * @memberof Flashphoner.constants.ERROR_INFO
8338
- */
8421
+ /**
8422
+ * Error if no options provided
8423
+ * @event OPTIONS_MUST_BE_PROVIDED
8424
+ * @memberof Flashphoner.constants.ERROR_INFO
8425
+ */
8426
+ OPTIONS_MUST_BE_PROVIDED: 'options must be provided',
8339
8427
 
8340
- define(errorInfo, 'OPTIONS_MUST_BE_PROVIDED', 'options must be provided');
8341
- /**
8342
- * Error if call status is not {@link Flashphoner.constants.CALL_STATUS.NEW}
8343
- * @event INVALID_CALL_STATE
8344
- * @memberof Flashphoner.constants.ERROR_INFO
8345
- */
8428
+ /**
8429
+ * Error if call status is not {@link Flashphoner.constants.CALL_STATUS.NEW}
8430
+ * @event INVALID_CALL_STATE
8431
+ * @memberof Flashphoner.constants.ERROR_INFO
8432
+ */
8433
+ INVALID_CALL_STATE: 'Invalid call state',
8346
8434
 
8347
- define(errorInfo, 'INVALID_CALL_STATE', 'Invalid call state');
8348
- /**
8349
- * Error if event is not specified
8350
- * @event EVENT_CANT_BE_NULL
8351
- * @memberof Flashphoner.constants.ERROR_INFO
8352
- */
8435
+ /**
8436
+ * Error if event is not specified
8437
+ * @event EVENT_CANT_BE_NULL
8438
+ * @memberof Flashphoner.constants.ERROR_INFO
8439
+ */
8440
+ EVENT_CANT_BE_NULL: 'Event can\'t be null',
8441
+
8442
+ /**
8443
+ * Error if callback is not a valid function
8444
+ * @event CALLBACK_NEEDS_TO_BE_A_VALID_FUNCTION
8445
+ * @memberof Flashphoner.constants.ERROR_INFO
8446
+ */
8447
+ CALLBACK_NEEDS_TO_BE_A_VALID_FUNCTION: 'Callback needs to be a valid function',
8353
8448
 
8354
- define(errorInfo, 'EVENT_CANT_BE_NULL', 'Event can\'t be null');
8449
+ /**
8450
+ * Error if options.name is not specified
8451
+ * @event OPTIONS_NAME_MUST_BE_PROVIDED
8452
+ * @memberof Flashphoner.constants.ERROR_INFO
8453
+ */
8454
+ OPTIONS_NAME_MUST_BE_PROVIDED: 'options.name must be provided',
8455
+
8456
+ /**
8457
+ * Error if number of cams is less than 2 or camera is already used by other application
8458
+ * @event CAN_NOT_SWITCH_CAM
8459
+ * @memberOf Flashphoner.constants.ERROR_INFO
8460
+ */
8461
+ CAN_NOT_SWITCH_CAM: 'Number of cams is less than 2 or camera is already used by other application',
8462
+
8463
+ /**
8464
+ * Error if number of mics is less than 2 or microphone is already used by other application
8465
+ * @event CAN_NOT_SWITCH_MIC
8466
+ * @memberOf Flashphoner.constants.ERROR_INFO
8467
+ */
8468
+ CAN_NOT_SWITCH_MIC: 'Number of mics is less than 2 or microphone is already used by other application',
8469
+
8470
+ /**
8471
+ * Local browser error detected
8472
+ * @event LOCAL_ERROR
8473
+ * @memberOf Flashphoner.constants.ERROR_INFO
8474
+ */
8475
+ LOCAL_ERROR: 'Local error'
8476
+ });
8355
8477
  /**
8356
- * Error if callback is not a valid function
8357
- * @event CALLBACK_NEEDS_TO_BE_A_VALID_FUNCTION
8358
- * @memberof Flashphoner.constants.ERROR_INFO
8478
+ * Local media devices type
8479
+ * @namespace Flashphoner.constants.MEDIA_DEVICE_KIND
8359
8480
  */
8360
8481
 
8361
- define(errorInfo, 'CALLBACK_NEEDS_TO_BE_A_VALID_FUNCTION', 'Callback needs to be a valid function');
8482
+ var MEDIA_DEVICE_KIND = Object.freeze({
8483
+ /**
8484
+ * List local media output devices
8485
+ * @see Flashphoner.getMediaDevices
8486
+ * @memberOf Flashphoner.constants.MEDIA_DEVICE_KIND
8487
+ */
8488
+ OUTPUT: 'output',
8489
+
8490
+ /**
8491
+ * List local media input devices
8492
+ * @see Flashphoner.getMediaDevices
8493
+ * @memberOf Flashphoner.constants.MEDIA_DEVICE_KIND
8494
+ */
8495
+ INPUT: 'input',
8496
+
8497
+ /**
8498
+ * List local media devices
8499
+ * @see Flashphoner.getMediaDevices
8500
+ * @memberOf Flashphoner.constants.MEDIA_DEVICE_KIND
8501
+ */
8502
+ ALL: 'all'
8503
+ });
8362
8504
  /**
8363
- * Error if session state is not ESTABLISHED
8364
- * @event INVALID_SESSION_STATE
8365
- * @memberof Flashphoner.constants.ERROR_INFO
8505
+ * WebRTC transport type
8506
+ * @namespace Flashphoner.constants.TRANSPORT_TYPE
8366
8507
  */
8367
8508
 
8368
- define(errorInfo, 'INVALID_SESSION_STATE', 'Invalid session state');
8509
+ var TRANSPORT_TYPE = Object.freeze({
8510
+ /**
8511
+ * WebRTC RTP traffic goes over UDP (default)
8512
+ * @see Stream
8513
+ * @memberOf Flashphoner.constants.TRANSPORT_TYPE
8514
+ */
8515
+ UDP: 'UDP',
8516
+
8517
+ /**
8518
+ * WebRTC RTP traffic goes over TCP
8519
+ * @see Stream
8520
+ * @memberOf Flashphoner.constants.TRANSPORT_TYPE
8521
+ */
8522
+ TCP: 'TCP'
8523
+ });
8369
8524
  /**
8370
- * Error if options.name is not specified
8371
- * @event OPTIONS_NAME_MUST_BE_PROVIDED
8372
- * @memberof Flashphoner.constants.ERROR_INFO
8525
+ * WebRTC connection quality type
8526
+ * @namespace Flashphoner.constants.CONNECTION_QUALITY
8373
8527
  */
8374
8528
 
8375
- define(errorInfo, 'OPTIONS_NAME_MUST_BE_PROVIDED', 'options.name must be provided');
8529
+ var CONNECTION_QUALITY = Object.freeze({
8530
+ /**
8531
+ * Channel bandwidth is perfect
8532
+ * @see Stream
8533
+ * @memberOf Flashphoner.constants.CONNECTION_QUALITY
8534
+ */
8535
+ PERFECT: 'PERFECT',
8536
+
8537
+ /**
8538
+ * Channel bandwidth is good
8539
+ * @see Stream
8540
+ * @memberOf Flashphoner.constants.CONNECTION_QUALITY
8541
+ */
8542
+ GOOD: 'GOOD',
8543
+
8544
+ /**
8545
+ * Channel bandwidth is bad
8546
+ * @see Stream
8547
+ * @memberOf Flashphoner.constants.CONNECTION_QUALITY
8548
+ */
8549
+ BAD: 'BAD',
8550
+
8551
+ /**
8552
+ * Channel bandwidth is unknown (initial state)
8553
+ * @see Stream
8554
+ * @memberOf Flashphoner.constants.CONNECTION_QUALITY
8555
+ */
8556
+ UNKNOWN: 'UNKNOWN',
8557
+
8558
+ /**
8559
+ * Channel bandwidth is updating
8560
+ * @see Stream
8561
+ * @memberOf Flashphoner.constants.CONNECTION_QUALITY
8562
+ */
8563
+ UPDATE: 'UPDATE'
8564
+ });
8376
8565
  /**
8377
- * Error if number of cams is less than 2 or already used custom stream
8378
- * @event CAN_NOT_SWITCH_CAM
8379
- * @memberOf Flashphoner.constants.ERROR_INFO
8566
+ * Websocket signaling stream event
8567
+ * @see Stream
8568
+ * @memberOf Flashphoner.constants
8380
8569
  */
8381
8570
 
8382
- define(errorInfo, 'CAN_NOT_SWITCH_CAM', 'Number of cams is less than 2 or already used custom stream');
8571
+ var STREAM_EVENT = 'STREAM_EVENT';
8383
8572
  /**
8384
- * Error if number of mics is less than 2 or already used custom stream
8385
- * @event CAN_NOT_SWITCH_MIC
8386
- * @memberOf Flashphoner.constants.ERROR_INFO
8573
+ * Websocket signaling stream event type
8574
+ * @namespace Flashphoner.constants.STREAM_EVENT_TYPE
8387
8575
  */
8388
8576
 
8389
- define(errorInfo, 'CAN_NOT_SWITCH_MIC', 'Number of mics is less than 2 or already used custom stream');
8577
+ var STREAM_EVENT_TYPE = Object.freeze({
8578
+ /**
8579
+ * Stream audio is muted
8580
+ * @see Stream
8581
+ * @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
8582
+ */
8583
+ AUDIO_MUTED: 'audioMuted',
8584
+
8585
+ /**
8586
+ * Stream audio is unmuted
8587
+ * @see Stream
8588
+ * @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
8589
+ */
8590
+ AUDIO_UNMUTED: 'audioUnmuted',
8591
+
8592
+ /**
8593
+ * Stream video is muted
8594
+ * @see Stream
8595
+ * @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
8596
+ */
8597
+ VIDEO_MUTED: 'videoMuted',
8598
+
8599
+ /**
8600
+ * Stream videoo is unmuted
8601
+ * @see Stream
8602
+ * @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
8603
+ */
8604
+ VIDEO_UNMUTED: 'videoUnmuted',
8605
+
8606
+ /**
8607
+ * Data bound to the stream are received
8608
+ * @see Stream
8609
+ * @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
8610
+ */
8611
+ DATA: 'data',
8612
+
8613
+ /**
8614
+ * Stream snapshot is completed
8615
+ * @see Stream
8616
+ * @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
8617
+ */
8618
+ SNAPSHOT_COMPLETED: 'snapshotCompleted',
8619
+
8620
+ /**
8621
+ * Stream snapshot is failed
8622
+ * @see Stream
8623
+ * @memberOf Flashphoner.constants.STREAM_EVENT_TYPE
8624
+ */
8625
+ SNAPSHOT_FAILED: 'snapshotFailed',
8626
+
8627
+ /**
8628
+ * Fires if playing {@link Stream} picture resizing.
8629
+ * @event RESIZE
8630
+ * @memberof Flashphoner.constants.STREAM_STATUS
8631
+ */
8632
+ RESIZE: 'resize',
8633
+
8634
+ /**
8635
+ * Fires on playing {@link Stream} if bitrate is higher than available network bandwidth.
8636
+ * @event NOT_ENOUGH_BANDWIDTH
8637
+ * @memberof Flashphoner.constants.NOT_ENOUGH_BANDWIDTH
8638
+ */
8639
+ NOT_ENOUGH_BANDWIDTH: 'notEnoughBandwidth'
8640
+ });
8390
8641
  /**
8391
- * Error if recived local error
8392
- * @event CAN_NOT_SWITCH_MIC
8393
- * @memberOf Flashphoner.constants.ERROR_INFO
8642
+ * WebRTC video content hint type
8643
+ * @namespace Flashphoner.constants.CONTENT_HINT_TYPE
8394
8644
  */
8395
8645
 
8396
- define(errorInfo, 'LOCAL_ERROR', 'Local error');
8397
- var mediaDeviceKind = {};
8398
- define(mediaDeviceKind, 'OUTPUT', 'output');
8399
- define(mediaDeviceKind, 'INPUT', 'input');
8400
- define(mediaDeviceKind, 'ALL', 'all');
8401
- var transportType = {};
8402
- define(transportType, 'UDP', 'UDP');
8403
- define(transportType, 'TCP', 'TCP');
8404
- var connectionQuality = {};
8405
- define(connectionQuality, 'PERFECT', 'PERFECT');
8406
- define(connectionQuality, 'GOOD', 'GOOD');
8407
- define(connectionQuality, 'BAD', 'BAD');
8408
- define(connectionQuality, 'UNKNOWN', 'UNKNOWN');
8409
- define(connectionQuality, 'UPDATE', 'UPDATE');
8410
- var streamEventType = {};
8411
- define(streamEventType, 'AUDIO_MUTED', 'audioMuted');
8412
- define(streamEventType, 'AUDIO_UNMUTED', 'audioUnmuted');
8413
- define(streamEventType, 'VIDEO_MUTED', 'videoMuted');
8414
- define(streamEventType, 'VIDEO_UNMUTED', 'videoUnmuted');
8415
- define(streamEventType, 'DATA', 'data');
8416
- var contentHintType = {};
8417
- define(contentHintType, 'MOTION', 'motion');
8418
- define(contentHintType, 'DETAIL', 'detail');
8419
- define(contentHintType, 'TEXT', 'text');
8420
- var constants = {};
8421
- define(constants, 'SESSION_STATUS', sessionStatus);
8422
- define(constants, 'STREAM_EVENT_TYPE', streamEventType);
8423
- define(constants, 'STREAM_EVENT', 'STREAM_EVENT');
8424
- define(constants, 'STREAM_STATUS', streamStatus);
8425
- define(constants, 'CALL_STATUS', callStatus);
8426
- define(constants, 'STREAM_STATUS_INFO', streamStatusInfo);
8427
- define(constants, 'CALL_STATUS_INFO', callStatusInfo);
8428
- define(constants, 'ERROR_INFO', errorInfo);
8429
- define(constants, 'MEDIA_DEVICE_KIND', mediaDeviceKind);
8430
- define(constants, 'TRANSPORT_TYPE', transportType);
8431
- define(constants, 'CONNECTION_QUALITY', connectionQuality);
8432
- define(constants, 'CONTENT_HINT_TYPE', contentHintType); //define helper
8433
-
8434
- function define(obj, name, value) {
8435
- Object.defineProperty(obj, name, {
8436
- value: value,
8437
- enumerable: true
8438
- });
8439
- }
8646
+ var CONTENT_HINT_TYPE = Object.freeze({
8647
+ /**
8648
+ * Video content is motion (webcam case): keep FPS, resolution and bitrate may change
8649
+ * @see Stream
8650
+ * @memberOf Flashphoner.constants.CONTENT_HINT_TYPE
8651
+ */
8652
+ MOTION: 'motion',
8440
8653
 
8441
- module.exports = constants;
8654
+ /**
8655
+ * Video content is detail (sreen sharing case): keep resolution, bitrate may change, FPS may drop
8656
+ * @see Stream
8657
+ * @memberOf Flashphoner.constants.CONTENT_HINT_TYPE
8658
+ */
8659
+ DETAIL: 'detail',
8660
+
8661
+ /**
8662
+ * Video content is text (sreen sharing case): keep resolution and bitrate, FPS may drop
8663
+ * @see Stream
8664
+ * @memberOf Flashphoner.constants.CONTENT_HINT_TYPE
8665
+ */
8666
+ TEXT: 'text'
8667
+ });
8668
+ module.exports = {
8669
+ SESSION_STATUS: SESSION_STATUS,
8670
+ STREAM_STATUS: STREAM_STATUS,
8671
+ CALL_STATUS: CALL_STATUS,
8672
+ STREAM_STATUS_INFO: STREAM_STATUS_INFO,
8673
+ CALL_STATUS_INFO: CALL_STATUS_INFO,
8674
+ ERROR_INFO: ERROR_INFO,
8675
+ MEDIA_DEVICE_KIND: MEDIA_DEVICE_KIND,
8676
+ TRANSPORT_TYPE: TRANSPORT_TYPE,
8677
+ CONNECTION_QUALITY: CONNECTION_QUALITY,
8678
+ STREAM_EVENT: STREAM_EVENT,
8679
+ STREAM_EVENT_TYPE: STREAM_EVENT_TYPE,
8680
+ CONTENT_HINT_TYPE: CONTENT_HINT_TYPE
8681
+ };
8442
8682
 
8443
8683
  },{}],39:[function(require,module,exports){
8444
8684
  'use strict';
@@ -9071,7 +9311,7 @@ var createSession = function createSession(options) {
9071
9311
  mediaProviders: Object.keys(MediaProvider),
9072
9312
  keepAlive: keepAlive,
9073
9313
  authToken: authToken,
9074
- clientVersion: "2.0.216",
9314
+ clientVersion: "2.0",
9075
9315
  clientOSVersion: window.navigator.appVersion,
9076
9316
  clientBrowserVersion: window.navigator.userAgent,
9077
9317
  msePacketizationVersion: 2,
@@ -10373,6 +10613,15 @@ var createSession = function createSession(options) {
10373
10613
  var stream = {};
10374
10614
 
10375
10615
  streamEventRefreshHandlers[id_] = function (streamEvent) {
10616
+ if (streamEvent.type == STREAM_EVENT_TYPE.NOT_ENOUGH_BANDWIDTH) {
10617
+ var info = streamEvent.payload.info.split("/");
10618
+ remoteBitrate = info[0];
10619
+ networkBandwidth = info[1];
10620
+ } else if (streamEvent.type == STREAM_EVENT_TYPE.RESIZE) {
10621
+ resolution.width = streamEvent.payload.streamerVideoWidth;
10622
+ resolution.height = streamEvent.payload.streamerVideoHeight;
10623
+ }
10624
+
10376
10625
  if (callbacks[STREAM_EVENT]) {
10377
10626
  callbacks[STREAM_EVENT](streamEvent);
10378
10627
  }
@@ -10408,7 +10657,8 @@ var createSession = function createSession(options) {
10408
10657
  if (event == INBOUND_VIDEO_RATE || event == OUTBOUND_VIDEO_RATE) {
10409
10658
  detectConnectionQuality(event, streamInfo);
10410
10659
  return;
10411
- }
10660
+ } //Depricated. WCS-3228: RESIZE, SNAPSHOT_COMPLETE and NOT_ENOUGH_BANDWIDTH moved to STREAM_EVENT
10661
+
10412
10662
 
10413
10663
  if (event == STREAM_STATUS.RESIZE) {
10414
10664
  resolution.width = streamInfo.streamerVideoWidth;