blob: 130d006e221c02b80223e309e01b3855ad333e94 [file] [log] [blame]
andresp@webrtc.org468516c2014-09-02 10:52:54 +00001// Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
2//
3// Use of this source code is governed by a BSD-style license
4// that can be found in the LICENSE file in the root of the source
5// tree. An additional intellectual property rights grant can be found
6// in the file PATENTS. All contributing project authors may
7// be found in the AUTHORS file in the root of the source tree.
8
9var botExposedApi = {
10 ping: function (callback) {
11 callback("pong");
12 },
13
14 createPeerConnection: function (doneCallback) {
15 console.log("Creating peer connection");
16 var pc = new webkitRTCPeerConnection(null);
17 var obj = {};
18 expose(obj, pc, "close");
19 expose(obj, pc, "createOffer");
20 expose(obj, pc, "createAnswer");
21 expose(obj, pc, "setRemoteDescription", { 0: RTCSessionDescription });
22 expose(obj, pc, "setLocalDescription", { 0: RTCSessionDescription });
23 doneCallback(obj);
24 },
25};
26
27connectToServer(botExposedApi);