Open u84six opened 9 years ago
Does anyone know why this isn't happening? I'm just trying to do a quick test and subscribe to what I'm publishing (Like OpenToks sample app). How can I do that with the plugin?
app = { initialize: function() { opentok.addEventListener( 'exception', function(e){ console.log( e.message ); }); }, publish: function() { var publisher = opentok.initPublisher(apiKey, "opentok-container", {width: 240, height: 180}); var session = opentok.initSession(apiKey, sessionId); session.on({ 'sessionConnected': function() { session.publish(publisher); }, 'streamCreated': function(event) { var div = document.createElement('div'); div.setAttribute('id', 'stream'+event.stream.streamId); document.body.appendChild(div); session.subscribe(event.stream, div.id, {width: 120, height: 90, subscribeToAudio: true, subscribeToVideo: true}); } }); session.connect(token); } };
I think streamCreated event will fire only when if some one joins the session and publish their video.
Does anyone know why this isn't happening? I'm just trying to do a quick test and subscribe to what I'm publishing (Like OpenToks sample app). How can I do that with the plugin?