Implements recording

pull/444/head
hristoterezov 10 years ago
parent ce43ce4cd8
commit c8c6a6d583
  1. 35
      app.js
  2. 2107
      libs/lib-jitsi-meet.js

@ -136,10 +136,16 @@ const APP = {
}; };
function initConference(localTracks, connection) { function initConference(localTracks, connection) {
let room = connection.initJitsiConference(APP.conference.roomName, { let options = {
openSctp: config.openSctp, openSctp: config.openSctp,
disableAudioLevels: config.disableAudioLevels disableAudioLevels: config.disableAudioLevels
}); };
if(config.enableRecording) {
options.recordingType = (config.hosts &&
(typeof config.hosts.jirecon != "undefined"))?
"jirecon" : "colibri";
}
let room = connection.initJitsiConference(APP.conference.roomName, options);
APP.conference._room = room; // FIXME do not use this APP.conference._room = room; // FIXME do not use this
const addTrack = (track) => { const addTrack = (track) => {
@ -414,6 +420,15 @@ function initConference(localTracks, connection) {
room.on(ConferenceEvents.DISPLAY_NAME_CHANGED, function (id, displayName) { room.on(ConferenceEvents.DISPLAY_NAME_CHANGED, function (id, displayName) {
APP.UI.changeDisplayName(id, displayName); APP.UI.changeDisplayName(id, displayName);
}); });
room.on(ConferenceEvents.RECORDING_STATE_CHANGED, (status, error) => {
if(status == "error") {
console.error(error);
return;
}
APP.UI.updateRecordingState(status);
});
APP.UI.addListener(UIEvents.NICKNAME_CHANGED, function (nickname) { APP.UI.addListener(UIEvents.NICKNAME_CHANGED, function (nickname) {
APP.settings.setDisplayName(nickname); APP.settings.setDisplayName(nickname);
room.setDisplayName(nickname); room.setDisplayName(nickname);
@ -471,16 +486,14 @@ function initConference(localTracks, connection) {
// Starts or stops the recording for the conference. // Starts or stops the recording for the conference.
APP.UI.addListener(UIEvents.RECORDING_TOGGLE, function (predefinedToken) { APP.UI.addListener(UIEvents.RECORDING_TOGGLE, function (predefinedToken) {
// FIXME recording if (predefinedToken) {
// APP.xmpp.toggleRecording(function (callback) { room.toggleRecording({token: predefinedToken});
// if (predefinedToken) { return;
// callback(predefinedToken); }
// return; APP.UI.requestRecordingToken().then((token) => {
// } room.toggleRecording({token: token});
});
// APP.UI.requestRecordingToken().then(callback);
// }, APP.UI.updateRecordingState);
}); });
APP.UI.addListener(UIEvents.TOPIC_CHANGED, function (topic) { APP.UI.addListener(UIEvents.TOPIC_CHANGED, function (topic) {

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save