Table of Contents

forceHttps()

Some browsers like Chrome limit access to local microphone and camera to secure webpages loaded using https protocol only. A webpage loaded using ordinary http cannot gain access to local media.

wrtc.forceHttps() function reloads http webpages using https to allow media access. If webpage was loaded using https wrtc.forceHttps() does nothing.

Arguments

None.

Returns

Nothing if page was already loaded using https.
"stop" if page was loaded using http, reload to https has begun.

Usage

As page reload is asynchronous it is important to stop wrtc from continue running until page has been reloaded. wrtc.init() must return "stop" to do that. A correct call to forceHttps() is therefore:

wrtc.init = function() {
  if (wrtc.forceHttps())
    return "stop";
  ...
}

Events

None.