Example check WebRTC support enabled in Chrome Browser Linux


WebRTC is hot trends right know. We can test it on Fedora 18 with the latest google chrome. At this example, I use Chrome 28. First, we need to enable getUserMedia() in Google Chrome by enter URL “chrome://flags” and find for “getUserMedia”. Then we can enable and relaunch the browser.

Now, we can test if this browser have capabilites in WebRTC, especially in getUserMedia() by :

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<html>
    <head>
        <title>Getting started with RTC</title>
        <script type="text/javascript">
            navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
            window.URL = window.URL || window.webkitURL || window.mozURL || window.msURL;
           
            if(navigator.getUserMedia) {
                navigator.getUserMedia({
                    video: true,
                    audio: true,
                }, onSuccess, onError);
            } else {
                console.log("GetUserMedia not supported");
            }
           
            function onSuccess() {
                console.log("GetUserMedia success");
            }
           
            function onError() {
                console.log("getUserMedia not supported");
            }
        </script>
    </head>
    <body>

    </body>
</html>

Then save this into “rtc.html” and open it from chrome browser. If everything works, we should see :


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.