only 1 stream being recorded

Questions and discussion concerning archiving

only 1 stream being recorded

Postby pjacko » Thu Feb 21, 2013 3:37 pm

hello - i'm hosting 1:1 video chats in my app. one of the participants is the host, and they will kick off the perSession recording. however, only 1 stream is being recorded. seems that whoever clicks "allow" first in the flash dialog box will see the recording icon and record the other person. but i want both streams to be recorded. here's the relevant bits of my code (some variables are being set on the server using mvc razor syntax)

Code: Select all
var videoOn = '@Model.DefaultVideoOn.ToString().ToLower()';
var apiKey = '@Model.OpenTokKey';
var sessionId = '@Model.SessionId';
var token = '@Model.Token';
var userId = @(Model.CustomerId);
var meetingId = @(Model.MeetingId);
var isHost = @(Model.IsHost.ToString().ToLower());
var recordingEnabled = @(Model.RecordingEnabled.ToString().ToLower());
var subscribers = {};
var publisher;
var session;
var archive;
var deviceManager;
   
session = TB.initSession(sessionId);
session.addEventListener("sessionConnected", sessionConnectedHandler);
session.addEventListener("streamCreated", streamCreatedHandler);
session.addEventListener("archiveCreated", archiveCreateHandler);
session.addEventListener('sessionRecordingStopped', sessionRecordingStoppedHandler);

connect();

function connect() {
    session.connect(apiKey, token);
}
 
function sessionConnectedHandler(event) {
   
    if (isHost && recordingEnabled) {
        var archiveTitle = "ArchivedChat_" + meetingId;
        session.createArchive(apiKey, "perSession", archiveTitle);
    }
   
    // Subscribe to streams that were in the session when we connected
    subscribeToStreams(event.streams);
    addDeviceManager();
    publisher = session.publish('mystream', { "width": 260, "height": 183, publishVideo:videoOn });
}
   
function subscribeToStreams(streams) {
   
    for (var i = 0; i < streams.length; i++) {
       
        // Make sure we don't subscribe to ourself
        if (streams[i].connection.connectionId == session.connection.connectionId) {
            break;
        }
       
        // Create the div to put the subscriber element in to
        var div = $(document.createElement('div')).attr("id", "stream" + streams[i].streamId);
        $("#stream-container").append(div);
         
        // Subscribe to the stream
        var props = {
            "width": 410,
            "height": 300
        };
        session.subscribe(streams[i], "stream" + streams[i].streamId, props);
    }
}
   
function addDeviceManager() {   
    deviceManager = TB.initDeviceManager(apiKey);
    deviceManager.detectDevices();
}

function archiveCreateHandler(event) { 
    archive = event.archives[0];
    session.startRecording(archive);   
}
   
function streamCreatedHandler(event) {   
    // Subscribe to any new streams that are created
    subscribeToStreams(event.streams);
}

function showDeviceManager() {   
    deviceManager.displayPanel(null, publisher);
}   

function sessionRecordingStoppedHandler(event) {
   
    if (isHost && recordingEnabled) {
        session.closeArchive(archive);
    }
}


can anyone see what the problem is here?
thanks!
pete
Was this post helpful? (0)
pjacko
 
Posts: 1
Joined: Thu Feb 21, 2013 3:31 pm
Thumbs Up: 0

Re: only 1 stream being recorded

Postby jtsai » Fri Feb 22, 2013 3:39 pm

Do you have logs of a session like this? You can set TB.setLogLevel(5) at the top of your code and check your javascript console.

John
Was this post helpful? (0)
User avatar
jtsai
 
Posts: 4546
Joined: Wed Sep 14, 2011 3:00 pm
Thumbs Up: 195


Return to [Beta] Archiving



Who is online

Users browsing this forum: No registered users and 1 guest

cron