opentok - Not getting streamCreated event, page goes to 100% CPU usage -
whenever allow webcam access in chrome part of setup multi-party or p2p conference, expecting streamcreated notification not coming through. camera turns on , "google chrome renderer" page goes 100% cpu usage. when pause execution of stream find execution somewhere deep inside tb.min.js. here's relevant parts of code like:
void meetinginprogress(info) { var session = tb.initsession(info.sessionid); session.connect(info.apikey, info.token); session.addeventlistener("sessionconnected", function(e) { console.log("connected session"); subscribetostreams(session, e.streams); session.publish("selfview", { name: name }); }); session.addeventlistener("streamcreated", function(e) { console.log("new stream"); subscribetostreams(session, e.streams); }); } var subscribetostreams = function(session, streams) { var selfid = session.connection.connectionid; console.log('subscribing streams, self id:', selfid); console.log('no. of streams:', _.size(streams)); _.foreach(streams, function(s) { console.log('stream id: ', s.connection.connectionid); if (s.connection.connectionid == selfid) { console.log('toggling'); $("#selfview").toggle(); } else session.subscribe(s, addviewport(), { width: 640, height: 480 }); }); console.log('done subscribing streams...'); }
seems me if publisher div element hidden, there's problem receiving streamcreated event. hoping show publisher div panel when user approves use of camera. when disable div visibility toggling, things seem work better.
unfortunately, latest release, happen when publisher hidden. if still want hide it, best option make 1x1 pixel , have absolutely positioned @ -1, -1 of screen.
Comments
Post a Comment