瀏覽代碼

Removes getVideoId and getVideoSrc as no longer used by tests.

master
damencho 9 年之前
父節點
當前提交
421483fc73
共有 3 個文件被更改,包括 0 次插入87 次删除
  1. 0
    4
      modules/RTC/RTC.js
  2. 0
    10
      modules/RTC/RTCUIHelper.js
  3. 0
    73
      modules/RTC/RTCUtils.js

+ 0
- 4
modules/RTC/RTC.js 查看文件

313
     return RTCUtils.getStreamID(stream);
313
     return RTCUtils.getStreamID(stream);
314
 };
314
 };
315
 
315
 
316
-RTC.getVideoSrc = function (element) {
317
-    return RTCUtils.getVideoSrc(element);
318
-};
319
-
320
 /**
316
 /**
321
  * Returns true if retrieving the the list of input devices is supported and
317
  * Returns true if retrieving the the list of input devices is supported and
322
  * false if not.
318
  * false if not.

+ 0
- 10
modules/RTC/RTCUIHelper.js 查看文件

60
         if (!RTCBrowserType.isIExplorer()) {
60
         if (!RTCBrowserType.isIExplorer()) {
61
             streamElement.autoplay = true;
61
             streamElement.autoplay = true;
62
         }
62
         }
63
-    },
64
-
65
-    /**
66
-     * Extract video stream id from the video element.
67
-     * @param {Element} element
68
-     * @returns {string} video stream id or empty string
69
-     */
70
-    getVideoId: function (element) {
71
-        var src = RTC.getVideoSrc(element);
72
-        return src ? String(src) : '';
73
     }
63
     }
74
 };
64
 };
75
 
65
 

+ 0
- 73
modules/RTC/RTCUtils.js 查看文件

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
  * Represents a default implementation of setting a <tt>MediaStream</tt> as the
646
  * Represents a default implementation of setting a <tt>MediaStream</tt> as the
700
  * source of a video element that tries to be browser-agnostic through feature
647
  * source of a video element that tries to be browser-agnostic through feature
799
                     }
746
                     }
800
                     return SDPUtil.filter_special_chars(id);
747
                     return SDPUtil.filter_special_chars(id);
801
                 };
748
                 };
802
-                this.getVideoSrc = defaultGetVideoSrc;
803
                 RTCSessionDescription = mozRTCSessionDescription;
749
                 RTCSessionDescription = mozRTCSessionDescription;
804
                 RTCIceCandidate = mozRTCIceCandidate;
750
                 RTCIceCandidate = mozRTCIceCandidate;
805
             } else if (RTCBrowserType.isChrome() ||
751
             } else if (RTCBrowserType.isChrome() ||
837
                             ? id
783
                             ? id
838
                             : SDPUtil.filter_special_chars(id));
784
                             : SDPUtil.filter_special_chars(id));
839
                 };
785
                 };
840
-                this.getVideoSrc = defaultGetVideoSrc;
841
                 // DTLS should now be enabled by default but..
786
                 // DTLS should now be enabled by default but..
842
                 this.pc_constraints = {'optional': [
787
                 this.pc_constraints = {'optional': [
843
                     {'DtlsSrtpKeyAgreement': 'true'}
788
                     {'DtlsSrtpKeyAgreement': 'true'}
898
                     self.getStreamID = function (stream) {
843
                     self.getStreamID = function (stream) {
899
                         return SDPUtil.filter_special_chars(stream.label);
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
                     onReady(options, self.getUserMediaWithConstraints);
847
                     onReady(options, self.getUserMediaWithConstraints);
921
                     resolve();
848
                     resolve();

Loading…
取消
儲存