|
|
@@ -642,59 +642,6 @@ function wrapAttachMediaStream(origAttachMediaStream) {
|
|
642
|
642
|
}
|
|
643
|
643
|
}
|
|
644
|
644
|
|
|
645
|
|
-/**
|
|
646
|
|
- * Represents a default implementation of {@link RTCUtils#getVideoSrc} which
|
|
647
|
|
- * tries to be browser-agnostic through feature checking. Note though that it
|
|
648
|
|
- * was not completely clear from the predating browser-specific implementations
|
|
649
|
|
- * what "videoSrc" was because one implementation would return
|
|
650
|
|
- * <tt>MediaStream</tt> (e.g. Firefox), another a <tt>string</tt> representation
|
|
651
|
|
- * of the <tt>URL</tt> of the <tt>MediaStream</tt> (e.g. Chrome) and the return
|
|
652
|
|
- * value was only used by {@link RTCUIHelper#getVideoId} which itself did not
|
|
653
|
|
- * appear to be used anywhere. Generally, the implementation will try to follow
|
|
654
|
|
- * the related standards i.e. work with the <tt>srcObject</tt> and <tt>src</tt>
|
|
655
|
|
- * properties of the specified <tt>element</tt> taking into account vender
|
|
656
|
|
- * prefixes.
|
|
657
|
|
- *
|
|
658
|
|
- * @param element the element to get the associated video source/src of
|
|
659
|
|
- * @return the video source/src of the specified <tt>element</tt>
|
|
660
|
|
- */
|
|
661
|
|
-function defaultGetVideoSrc(element) {
|
|
662
|
|
- // https://www.w3.org/TR/mediacapture-streams/
|
|
663
|
|
- //
|
|
664
|
|
- // User Agents that support this specification must support the srcObject
|
|
665
|
|
- // attribute of the HTMLMediaElement interface defined in [HTML51].
|
|
666
|
|
-
|
|
667
|
|
- // https://www.w3.org/TR/2015/WD-html51-20150506/semantics.html#dom-media-srcobject
|
|
668
|
|
- //
|
|
669
|
|
- // There are three ways to specify a media resource: the srcObject IDL
|
|
670
|
|
- // attribute, the src content attribute, and source elements. The IDL
|
|
671
|
|
- // attribute takes priority, followed by the content attribute, followed by
|
|
672
|
|
- // the elements.
|
|
673
|
|
-
|
|
674
|
|
- // srcObject
|
|
675
|
|
- var srcObject = element.srcObject || element.mozSrcObject;
|
|
676
|
|
- if (srcObject) {
|
|
677
|
|
- // Try the optimized path to the URL of a MediaStream.
|
|
678
|
|
- var url = srcObject.jitsiObjectURL;
|
|
679
|
|
- if (url) {
|
|
680
|
|
- return url.toString();
|
|
681
|
|
- }
|
|
682
|
|
- // Go via the unoptimized path to the URL of a MediaStream then.
|
|
683
|
|
- var URL = (window.URL || webkitURL);
|
|
684
|
|
- if (URL) {
|
|
685
|
|
- url = URL.createObjectURL(srcObject);
|
|
686
|
|
- try {
|
|
687
|
|
- return url.toString();
|
|
688
|
|
- } finally {
|
|
689
|
|
- URL.revokeObjectURL(url);
|
|
690
|
|
- }
|
|
691
|
|
- }
|
|
692
|
|
- }
|
|
693
|
|
-
|
|
694
|
|
- // src
|
|
695
|
|
- return element.src;
|
|
696
|
|
-}
|
|
697
|
|
-
|
|
698
|
645
|
/**
|
|
699
|
646
|
* Represents a default implementation of setting a <tt>MediaStream</tt> as the
|
|
700
|
647
|
* source of a video element that tries to be browser-agnostic through feature
|
|
|
@@ -799,7 +746,6 @@ var RTCUtils = {
|
|
799
|
746
|
}
|
|
800
|
747
|
return SDPUtil.filter_special_chars(id);
|
|
801
|
748
|
};
|
|
802
|
|
- this.getVideoSrc = defaultGetVideoSrc;
|
|
803
|
749
|
RTCSessionDescription = mozRTCSessionDescription;
|
|
804
|
750
|
RTCIceCandidate = mozRTCIceCandidate;
|
|
805
|
751
|
} else if (RTCBrowserType.isChrome() ||
|
|
|
@@ -837,7 +783,6 @@ var RTCUtils = {
|
|
837
|
783
|
? id
|
|
838
|
784
|
: SDPUtil.filter_special_chars(id));
|
|
839
|
785
|
};
|
|
840
|
|
- this.getVideoSrc = defaultGetVideoSrc;
|
|
841
|
786
|
// DTLS should now be enabled by default but..
|
|
842
|
787
|
this.pc_constraints = {'optional': [
|
|
843
|
788
|
{'DtlsSrtpKeyAgreement': 'true'}
|
|
|
@@ -898,24 +843,6 @@ var RTCUtils = {
|
|
898
|
843
|
self.getStreamID = function (stream) {
|
|
899
|
844
|
return SDPUtil.filter_special_chars(stream.label);
|
|
900
|
845
|
};
|
|
901
|
|
- self.getVideoSrc = function (element) {
|
|
902
|
|
- // There's nothing standard about getVideoSrc in the
|
|
903
|
|
- // case of Temasys so there's no point to try to
|
|
904
|
|
- // generalize it through defaultGetVideoSrc.
|
|
905
|
|
- if (!element) {
|
|
906
|
|
- logger.warn(
|
|
907
|
|
- "Attempt to get video SRC of null element");
|
|
908
|
|
- return null;
|
|
909
|
|
- }
|
|
910
|
|
- var children = element.children;
|
|
911
|
|
- for (var i = 0; i !== children.length; ++i) {
|
|
912
|
|
- if (children[i].name === 'streamId') {
|
|
913
|
|
- return children[i].value;
|
|
914
|
|
- }
|
|
915
|
|
- }
|
|
916
|
|
- //logger.info(element.id + " SRC: " + src);
|
|
917
|
|
- return null;
|
|
918
|
|
- };
|
|
919
|
846
|
|
|
920
|
847
|
onReady(options, self.getUserMediaWithConstraints);
|
|
921
|
848
|
resolve();
|