Kaynağa Gözat

Fixes example.js

dev1
hristoterezov 10 yıl önce
ebeveyn
işleme
65a3ad3748
2 değiştirilmiş dosya ile 7 ekleme ve 55 silme
  1. 7
    49
      doc/example/example.js
  2. 0
    6
      doc/example/index.html

+ 7
- 49
doc/example/example.js Dosyayı Görüntüle

1
-//var options = {
2
-//    hosts: {
3
-//        domain: "prod-us-east-1-app-xmpp1.internal.meet.hipchat.ninja",
4
-//        focus: "focus.prod-us-east-1-app-xmpp1.internal.meet.hipchat.ninja",
5
-//        muc: "conference.prod-us-east-1-app-xmpp1.internal.meet.hipchat.ninja", // FIXME: use XEP-0030
6
-//    },
7
-//    bosh: "https://xmpp1-meet.hipchat.me/http-bind", // FIXME: use xep-0156 for that
8
-//    clientNode: "http://prod-us-east-1-app-xmpp1.internal.meet.hipchat.ninja/jitsimeet" // The name of client node advertised in XEP-0115 'c' stanza
9
-//};
10
-
11
 var options = {
1
 var options = {
12
     hosts: {
2
     hosts: {
13
         domain: 'hristo.jitsi.net',
3
         domain: 'hristo.jitsi.net',
18
     clientNode: 'http://jitsi.org/jitsimeet', // The name of client node advertised in XEP-0115 'c' stanza
8
     clientNode: 'http://jitsi.org/jitsimeet', // The name of client node advertised in XEP-0115 'c' stanza
19
 }
9
 }
20
 
10
 
21
-
22
-
23
-// var options = {
24
-//     hosts: {
25
-//         domain: 'whatever.jitsi.net',
26
-//         muc: 'conference.whatever.jitsi.net', // FIXME: use XEP-0030
27
-//         bridge: 'jitsi-videobridge.whatever.jitsi.net', // FIXME: use XEP-0030
28
-//     },
29
-//     bosh: '//whatever.jitsi.net/http-bind?ROOM_NAME=conference2', // FIXME: use xep-0156 for that
30
-//     clientNode: 'http://jitsi.org/jitsimeet', // The name of client node advertised in XEP-0115 'c' stanza
31
-// }
32
-
33
-
34
 var confOptions = {
11
 var confOptions = {
35
     openSctp: true,
12
     openSctp: true,
36
     disableAudioLevels: true
13
     disableAudioLevels: true
47
     tracks[1].attach($("#localVideo"));
24
     tracks[1].attach($("#localVideo"));
48
     for(var i = 0; i < localTracks.length; i++)
25
     for(var i = 0; i < localTracks.length; i++)
49
     {
26
     {
27
+            room.addTrack(localTracks[i]);
50
         console.log(localTracks[i]);
28
         console.log(localTracks[i]);
51
     }
29
     }
52
 }
30
 }
74
  */
52
  */
75
 function onConferenceJoined () {
53
 function onConferenceJoined () {
76
     console.log("conference joined!");
54
     console.log("conference joined!");
77
-    for(var i = 0; i < localTracks.length; i++)
78
-    {
79
-        room.addTrack(localTracks[i]);
80
-    }
55
+    JitsiMeetJS.createLocalTracks({}).then(onLocalTracks);
81
 }
56
 }
82
 
57
 
83
 function onUserLeft(id) {
58
 function onUserLeft(id) {
142
 
117
 
143
 JitsiMeetJS.init();
118
 JitsiMeetJS.init();
144
 
119
 
145
-JitsiMeetJS.enumerateDevices(function (devices) {
146
-    for(var i = 0; i < devices.length; i++)
147
-    {
148
-        var device = devices[i];
149
-        if(device.kind === "videoinput")
150
-            $("#videoDevices").append("<option value=\"" + device.deviceId +
151
-                "\">" + device.label + "</option>");
152
-    }
153
-})
154
-
155
 var connection = null;
120
 var connection = null;
156
 var room = null;
121
 var room = null;
157
 var localTracks = [];
122
 var localTracks = [];
158
 var remoteTracks = {};
123
 var remoteTracks = {};
159
 
124
 
160
 
125
 
161
-/**
162
- * Starts the conference with the selected device
163
- */
164
-function selectDevice() {
165
-    var videoID = $("#videoDevices").val();
166
-    JitsiMeetJS.createLocalTracks({resolution: "720", cameraDeviceId: videoID}).then(onLocalTracks);
167
-    connection = new JitsiMeetJS.JitsiConnection(null, null, options);
126
+connection = new JitsiMeetJS.JitsiConnection(null, null, options);
168
 
127
 
169
-    connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED, onConnectionSuccess);
170
-    connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_FAILED, onConnectionFailed);
171
-    connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED, disconnect);
128
+connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_ESTABLISHED, onConnectionSuccess);
129
+connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_FAILED, onConnectionFailed);
130
+connection.addEventListener(JitsiMeetJS.events.connection.CONNECTION_DISCONNECTED, disconnect);
172
 
131
 
173
-    connection.connect();
174
-}
132
+connection.connect();

+ 0
- 6
doc/example/index.html Dosyayı Görüntüle

11
     <script src="example.js" ></script>
11
     <script src="example.js" ></script>
12
 </head>
12
 </head>
13
 <body>
13
 <body>
14
-    <a onclick="room.setDisplayName(Math.random())">Change Display Name</a>
15
-    <div>Select Video device:
16
-        <select id="videoDevices">
17
-        </select>
18
-        <a onclick = "selectDevice();">Select</a>
19
-    </div>
20
     <video id="localVideo" autoplay="true"></video>
14
     <video id="localVideo" autoplay="true"></video>
21
     <!--<audio id="localAudio" autoplay="true" muted="true"></audio>-->
15
     <!--<audio id="localAudio" autoplay="true" muted="true"></audio>-->
22
 </body>
16
 </body>

Loading…
İptal
Kaydet