|
|
@@ -755,56 +755,6 @@ function handleLocalStream(streams, resolution) {
|
|
755
|
755
|
return res;
|
|
756
|
756
|
}
|
|
757
|
757
|
|
|
758
|
|
-/**
|
|
759
|
|
- * Represents a default implementation of setting a <tt>MediaStream</tt> as the
|
|
760
|
|
- * source of a video element that tries to be browser-agnostic through feature
|
|
761
|
|
- * checking. Note though that it was not completely clear from the predating
|
|
762
|
|
- * browser-specific implementations what "videoSrc" was because one
|
|
763
|
|
- * implementation of {@link RTCUtils#getVideoSrc} would return
|
|
764
|
|
- * <tt>MediaStream</tt> (e.g. Firefox), another a <tt>string</tt> representation
|
|
765
|
|
- * of the <tt>URL</tt> of the <tt>MediaStream</tt> (e.g. Chrome) and the return
|
|
766
|
|
- * value was only used by {@link RTCUIHelper#getVideoId} which itself did not
|
|
767
|
|
- * appear to be used anywhere. Generally, the implementation will try to follow
|
|
768
|
|
- * the related standards i.e. work with the <tt>srcObject</tt> and <tt>src</tt>
|
|
769
|
|
- * properties of the specified <tt>element</tt> taking into account vender
|
|
770
|
|
- * prefixes.
|
|
771
|
|
- *
|
|
772
|
|
- * @param element the element whose video source/src is to be set to the
|
|
773
|
|
- * specified <tt>stream</tt>
|
|
774
|
|
- * @param {MediaStream} stream the <tt>MediaStream</tt> to set as the video
|
|
775
|
|
- * source/src of <tt>element</tt>
|
|
776
|
|
- */
|
|
777
|
|
-function defaultSetVideoSrc(element, stream) {
|
|
778
|
|
- // srcObject
|
|
779
|
|
- let srcObjectPropertyName = 'srcObject';
|
|
780
|
|
-
|
|
781
|
|
- if (!(srcObjectPropertyName in element)) {
|
|
782
|
|
- srcObjectPropertyName = 'mozSrcObject';
|
|
783
|
|
- if (!(srcObjectPropertyName in element)) {
|
|
784
|
|
- srcObjectPropertyName = null;
|
|
785
|
|
- }
|
|
786
|
|
- }
|
|
787
|
|
- if (srcObjectPropertyName) {
|
|
788
|
|
- element[srcObjectPropertyName] = stream;
|
|
789
|
|
-
|
|
790
|
|
- return;
|
|
791
|
|
- }
|
|
792
|
|
-
|
|
793
|
|
- // src
|
|
794
|
|
- let src;
|
|
795
|
|
-
|
|
796
|
|
- if (stream) {
|
|
797
|
|
- src = stream.jitsiObjectURL;
|
|
798
|
|
-
|
|
799
|
|
- // Save the created URL for stream so we can reuse it and not keep
|
|
800
|
|
- // creating URLs.
|
|
801
|
|
- if (!src) {
|
|
802
|
|
- stream.jitsiObjectURL = src = URL.createObjectURL(stream);
|
|
803
|
|
- }
|
|
804
|
|
- }
|
|
805
|
|
- element.src = src || '';
|
|
806
|
|
-}
|
|
807
|
|
-
|
|
808
|
758
|
/**
|
|
809
|
759
|
*
|
|
810
|
760
|
*/
|
|
|
@@ -865,22 +815,13 @@ class RTCUtils extends Listenable {
|
|
865
|
815
|
|
|
866
|
816
|
this.getStreamID = ({ id }) => id;
|
|
867
|
817
|
this.getTrackID = ({ id }) => id;
|
|
868
|
|
- } else if (browser.isChromiumBased() // this is chrome < 61
|
|
869
|
|
- || browser.isReactNative()) {
|
|
870
|
|
-
|
|
|
818
|
+ } else if (browser.isReactNative()) {
|
|
871
|
819
|
this.RTCPeerConnectionType = RTCPeerConnection;
|
|
872
|
820
|
|
|
873
|
|
- this.attachMediaStream
|
|
874
|
|
- = wrapAttachMediaStream((element, stream) => {
|
|
875
|
|
- defaultSetVideoSrc(element, stream);
|
|
876
|
|
-
|
|
877
|
|
- return element;
|
|
878
|
|
- });
|
|
|
821
|
+ this.attachMediaStream = undefined; // Unused on React Native.
|
|
879
|
822
|
|
|
880
|
823
|
this.getStreamID = function({ id }) {
|
|
881
|
|
- // A. MediaStreams from FF endpoints have the characters '{' and
|
|
882
|
|
- // '}' that make jQuery choke.
|
|
883
|
|
- // B. The react-native-webrtc implementation that we use at the
|
|
|
824
|
+ // The react-native-webrtc implementation that we use at the
|
|
884
|
825
|
// time of this writing returns a number for the id of
|
|
885
|
826
|
// MediaStream. Let's just say that a number contains no special
|
|
886
|
827
|
// characters.
|
|
|
@@ -890,17 +831,6 @@ class RTCUtils extends Listenable {
|
|
890
|
831
|
: SDPUtil.filterSpecialChars(id));
|
|
891
|
832
|
};
|
|
892
|
833
|
this.getTrackID = ({ id }) => id;
|
|
893
|
|
-
|
|
894
|
|
- if (!MediaStream.prototype.getVideoTracks) {
|
|
895
|
|
- MediaStream.prototype.getVideoTracks = function() {
|
|
896
|
|
- return this.videoTracks;
|
|
897
|
|
- };
|
|
898
|
|
- }
|
|
899
|
|
- if (!MediaStream.prototype.getAudioTracks) {
|
|
900
|
|
- MediaStream.prototype.getAudioTracks = function() {
|
|
901
|
|
- return this.audioTracks;
|
|
902
|
|
- };
|
|
903
|
|
- }
|
|
904
|
834
|
} else {
|
|
905
|
835
|
const message = 'Endpoint does not appear to be WebRTC-capable';
|
|
906
|
836
|
|
|
|
@@ -1492,14 +1422,6 @@ class RTCUtils extends Listenable {
|
|
1492
|
1422
|
if (mediaStream.release) {
|
|
1493
|
1423
|
mediaStream.release();
|
|
1494
|
1424
|
}
|
|
1495
|
|
-
|
|
1496
|
|
- // if we have done createObjectURL, lets clean it
|
|
1497
|
|
- const url = mediaStream.jitsiObjectURL;
|
|
1498
|
|
-
|
|
1499
|
|
- if (url) {
|
|
1500
|
|
- delete mediaStream.jitsiObjectURL;
|
|
1501
|
|
- URL.revokeObjectURL(url);
|
|
1502
|
|
- }
|
|
1503
|
1425
|
}
|
|
1504
|
1426
|
|
|
1505
|
1427
|
/**
|