Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
* @Author: Adam Ullman (http://github.com/aullman)
* @Copyright (c) 2014 Adam Ullman
* @License: Released under the MIT license (http://opensource.org/licenses/MIT)
**/
if (!window.OT) throw new Error('You must include the OT library before the OT_Angular library');
var ng;
if (typeof angular === 'undefined' && typeof require !== 'undefined') {
ng = require('angular');
} else {
ng = angular;
}
var initLayoutContainer;
if (!window.hasOwnProperty('initLayoutContainer') && typeof require !== 'undefined') {
initLayoutContainer = require('opentok-layout-js').initLayoutContainer;
} else {
initLayoutContainer = window.initLayoutContainer;
}
ng.module('opentok', [])
.factory('OT', function() {
return OT;
})
.factory('OTSession', ['OT', '$rootScope',
function(OT, $rootScope) {
var OTSession = {
streams: [],
connections: [],
publishers: [],
init: function(apiKey, sessionId, token, cb) {
this.session = OT.initSession(apiKey, sessionId);