Help me: Error: Cannot read property 'getUserMedia' of undefined (Code and Console Log inside)


Here is the source code, what is wrong with it or me?
<===========>

LiveVideoPrayerSite
    <div class="navbar_links">
        <ul class="menu">
            <li><a href="index.html">Home</a></li>
            <li><a href="About.html">About us</a></li>
            <li><a href="VideoGallery.html">Video Gallery</a></li>
            <li><a href="LiveVideoPrayer.html">Live Video Prayer</a></li>
            <li><a href="ChatContactUs.html">Chat Contact Us</a></li>
        </ul>
    </div>
    </div>
   
        <script src='https://meet.jit.si/external_api.js'></script>
      </head>
      <body>
      
      <button id="start" type="button"><H1>Start</H1></button>
      <div id="jitsi-container">
      </div>
      
      <script>
      var button = document.querySelector('#start');
      var container = document.querySelector('#jitsi-container');
      var api = null;
      
      button.addEventListener('click', () => {
          var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
          var stringLength = 30;
      
          function pickRandom() {
          return possible[Math.floor(Math.random() * possible.length)];
          }
      
      var randomString = Array.apply(null, Array(stringLength)).map(pickRandom).join('');
      
          var domain = "meet.jit.si";
          var options = {
              "roomName": randomString,
              "parentNode": container,
              "width": 600,
              "height": 600,
          };
          api = new JitsiMeetExternalAPI(domain, options);
      });
      
      </script>
      <script>
        (function(d,h,w){var gist=w.gist=w.gist||[];gist.methods=['trackPageView','identify','track','setAppId'];gist.factory=function(t){return function(){var e=Array.prototype.slice.call(arguments);e.unshift(t);gist.push(e);return gist;}};for(var i=0;i<gist.methods.length;i++){var c=gist.methods[i];gist[c]=gist.factory(c)}s=d.createElement('script'),s.src="https://widget.getgist.com",s.async=!0,e=d.getElementsByTagName(h)[0],e.appendChild(s),s.addEventListener('load',function(e){},!1),gist.setAppId("tdsauycj"),gist.trackPageView()})(document,'head',window);
    </script>
    <!-- end Gist JS code-->
      </body>
      </html>![ConsoleError|558x499](upload://gtF1Wpz6YQxlHBvXkVwRiKCx4ic.jpeg)
1 Like

Are you serving this through http or https?

1 Like

Thanks for your response: You mean the javascript link like this?

      </head>
      <body>
      
      <button id="start" type="button"><H1>Start</H1></button>
      <div id="jitsi-container">
      </div>
      
      <script>

I tried the http and that didn’t work either.

1 Like

You should always use https when serving anything related to webrtc, other wise it does not work.

1 Like

Thanks question should I do that in the

      <script>
1 Like

So I should modify this?

1 Like

Your html file where all the code is, that one how are you serving it HTTP or https?

1 Like

https like this check this out in my local host it works well but live LiveVideoPrayerSite check it out.

<script src='https://meet.jit.si/external_api.js'></script>
1 Like

Sir
Thanks for your help on this I tried, the http in the script it didn’t work, still got error then I put back the https still got error. Should I just delete the html page and re-write it from scratch?

1 Like

This is your problem:


You are serving that side through HTTP, you need https.

1 Like

When I manually change it to https it works.

1 Like

WOW your good never thought of that so I can just do https:www.yadaday.site ok I got thank you very much

1 Like

Thanks
I will go to my cpanel and change get the http changed to https. Question when people use this code should I tell them to get their http updated or changed to https?
Thanks

1 Like

Normally http is redirected to https: jitsi-meet/jitsi-meet.example at 687106818a0c4d92c50029759129d9e71325d96f · jitsi/jitsi-meet · GitHub

1 Like

Got it I am at my Cpanel changing the SSL and installed it to https man you were a great help.

1 Like