Skip to content

How to integrate the IE and Safari Plugin into your SkyWay Application

Dan Ozawa edited this page Aug 18, 2015 · 10 revisions

#How to integrate the IE and Safari Plugin into your SkyWay Application

##NOTE This function is test version(β version) now, so it is not guaranteed to work.

##Abstract This page explains how to integrate the IE and Safari Plugin supported by Temasys Communications Pte. Ltd. (https://www.temasys.com.sg/) into your SkyWay App, making it compatible with Safari and Internet Explorer.

##1. Import the AdapterJS in your HTML code and Install the Plugin Temasys provides a polyfill named AdapterJS. AdapterJS provides polyfills and cross-browser helpers for WebRTC. It wraps around the native APIs in Chrome, Opera and Firefox and provides support for WebRTC in Internet Explorer and Safari on Mac and Windows through the available Temasys IE and Safari Plugins. Please get it from below(github or cdn) and import in your HTML code.

<html>
<head>
  <title>PeerJS - Video chat example</title>
  <link rel="stylesheet" href="style.css">
  <script type="text/javascript" src="//cdn.temasys.com.sg/adapterjs/0.11.x/adapter.min.js"></script>
  <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script>

In versions of IE and Safari that don't support WebRTC natively, AdapterJS will suggest to the user to install the Temasys WebRTC plugin for Mac or Windows when you try to access getUserMedia or RTCPeerConnection. After installing plugin, please restart your browser.

Plugin Install Bar in IE and Safari

##2. Changes your JavaScript code

AdapterJS.webRTCReady function

Your browser might take a bit of time to load up the plugin (~100ms). So We strongly recommend only executing any WebRTC related code in the callback of the AdapterJS.webRTCReady function. It is triggered whenever the browser or the IE and Safari plugin is ready to be used.

AdapterJS.webRTCReady(function(isUsingPlugin) {
    // The WebRTC API is ready.
    //isUsingPlugin: true is the WebRTC plugin is being used, false otherwise
    getUserMedia(constraints, successCb, failCb);
});

Click here for details

attachMediaStream(element, stream) function

You can attach MediaStream objects to video and audio tags using the attachMediaStream function.

Example

//$('#my-video').prop('src', URL.createObjectURL(stream));
attachMediaStream( $('#my-video')[0], stream );

※ AttachMediaStream MUST be called AFTER the element was injected into the DOM. You CANNOT call attachMediaStream on a element you are creating in your JS code but haven't injected yet.

Sample app

Other functions

Other functions(for example DataChanel) are work in progress. Please wait momentarily.