Skip to content

Commit

Permalink
rename variable 'of'
Browse files Browse the repository at this point in the history
  • Loading branch information
cool0707 committed Mar 31, 2021
1 parent 6db43e0 commit ac3ed49
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 40 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ out/
.settings
.project
.classpath
.factorypath
.theia

# Ignore MacOSX files
.DS_Store
Expand Down
80 changes: 40 additions & 40 deletions src/webapp/custom_ofmeet.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var ofmeet = (function(of)
var ofmeet = (function(ofm)
{
//-------------------------------------------------------
//
Expand Down Expand Up @@ -156,13 +156,13 @@ var ofmeet = (function(of)

if (APP.connection && !config.webinar)
{
if (dbnames.length > 0 || of.recording)
if (dbnames.length > 0 || ofm.recording)
{
event.preventDefault();
event.returnValue = '';
}

if (of.recording) stopRecorder();
if (ofm.recording) stopRecorder();

dbnames.forEach(function(dbname)
{
Expand All @@ -173,7 +173,7 @@ var ofmeet = (function(of)
};
});

if (dbnames.length > 0 || of.recording)
if (dbnames.length > 0 || ofm.recording)
{
return event.returnValue;
}
Expand Down Expand Up @@ -316,7 +316,7 @@ var ofmeet = (function(of)

if (interfaceConfig.OFMEET_RECORD_CONFERENCE)
{
if (of.recording) stopRecorder();
if (ofm.recording) stopRecorder();

const ids = Object.getOwnPropertyNames(recordingVideoTrack);

Expand Down Expand Up @@ -347,13 +347,13 @@ var ofmeet = (function(of)
clockTrack.leaves = (new Date()).getTime();
hideClock();

if (of.recognition)
if (ofm.recognition)
{
of.recognitionActive = false;
of.recognition.stop();
ofm.recognitionActive = false;
ofm.recognition.stop();
}

if (of.recording) stopRecorder();
if (ofm.recording) stopRecorder();
}

});
Expand Down Expand Up @@ -419,18 +419,18 @@ var ofmeet = (function(of)

if (APP.conference.getMyUserId() == id)
{
if (of.recognition)
if (ofm.recognition)
{
if (track.isMuted()) // speech recog synch
{
console.debug("muted, stopping speech transcription");

of.recognitionActive = false;
of.recognition.stop();
ofm.recognitionActive = false;
ofm.recognition.stop();

} else {
console.debug("unmuted, starting speech transcription");
of.recognition.start();
ofm.recognition.start();
}
}
}
Expand Down Expand Up @@ -696,7 +696,7 @@ var ofmeet = (function(of)
(evt) => {
evt.stopPropagation();

if (!of.recording) {
if (!ofm.recording) {
startRecorder(startMeetingRecorder);
} else {
stopRecorder();
Expand All @@ -707,7 +707,7 @@ var ofmeet = (function(of)
const leaveButton = document.querySelector('div[aria-label="Leave the call"]');

if (leaveButton) leaveButton.addEventListener("click", function (evt) {
if (of.recording) stopRecorder();
if (ofm.recording) stopRecorder();

if (pdf_body.length > 0) {
const margins = {
Expand Down Expand Up @@ -757,7 +757,7 @@ var ofmeet = (function(of)
(evt) => {
evt.stopPropagation();

if (!of.recording) {
if (!ofm.recording) {
startRecorder(startDesktopRecorder);
} else {
stopRecorder();
Expand Down Expand Up @@ -1770,21 +1770,21 @@ var ofmeet = (function(of)
});
}

if (of.recognition)
if (ofm.recognition)
{
const transcriptCaptions = (captions.transcriptDisabled ? i18n('tag.enableVoiceTranscription') : i18n('tag.disableVoiceTranscription'));
const transcriptClass = (captions.transcriptDisabled ? 'btn-secondary' : 'btn-success') + ' btn tingle-btn tingle-btn--pull-right';

tagsModal.addFooterBtn(transcriptCaptions, transcriptClass, function(evt)
{
captions.transcriptDisabled = !captions.transcriptDisabled;
of.recognitionActive = !captions.transcriptDisabled;
ofm.recognitionActive = !captions.transcriptDisabled;
evt.target.classList.remove(captions.transcriptDisabled ? 'btn-success' : 'btn-secondary');
evt.target.classList.add(captions.transcriptDisabled ? 'btn-secondary' : 'btn-success');
evt.target.innerHTML = (captions.transcriptDisabled ? i18n('tag.enableVoiceTranscription') : i18n('tag.disableVoiceTranscription'));

if (captions.transcriptDisabled) of.recognition.stop();
if (!captions.transcriptDisabled) of.recognition.start();
if (captions.transcriptDisabled) ofm.recognition.stop();
if (!captions.transcriptDisabled) ofm.recognition.start();
if (captions.ele) captions.ele.innerHTML = "";
});
}
Expand Down Expand Up @@ -1908,7 +1908,7 @@ var ofmeet = (function(of)
else {
APP.UI.messageHandler.notify("Streaming", "Conference streaming stopped");
}
of.recording = false;
ofm.recording = false;
}

function createAnchor(filename, blob)
Expand Down Expand Up @@ -2138,7 +2138,7 @@ var ofmeet = (function(of)
const startTime = Date.now();
});

of.recording = true;
ofm.recording = true;
}

function mergeAudioStreams(desktopStream, voiceStream)
Expand Down Expand Up @@ -2303,12 +2303,12 @@ var ofmeet = (function(of)
}
videoRecorder[id].start(1000);
const startTime = Date.now();
of.recording = true;
ofm.recording = true;

}, error => {
console.error("custom_ofmeet.js startDesktopRecorder", error);
APP.UI.messageHandler.showError({title:"Desktop recorder/streamer", error, hideErrorSupportLink: true});
of.recording = false;
ofm.recording = false;
});
}

Expand Down Expand Up @@ -2829,20 +2829,20 @@ var ofmeet = (function(of)
console.debug("Speech recog result", APP.conference._room, message);

APP.conference._room.sendTextMessage(message);
of.currentTranslation = [];
ofm.currentTranslation = [];
}
}

function setupSpeechRecognition()
{
console.debug("setupSpeechRecognition");

of.recognition = new webkitSpeechRecognition();
of.recognition.lang = config.defaultLanguage;
of.recognition.continuous = true;
of.recognition.interimResults = false;
ofm.recognition = new webkitSpeechRecognition();
ofm.recognition.lang = config.defaultLanguage;
ofm.recognition.continuous = true;
ofm.recognition.interimResults = false;

of.recognition.onresult = function(event)
ofm.recognition.onresult = function(event)
{
console.debug("Speech recog event", event)

Expand All @@ -2854,34 +2854,34 @@ var ofmeet = (function(of)
}
}

of.recognition.onspeechend = function(event)
ofm.recognition.onspeechend = function(event)
{
console.debug("Speech recog onspeechend", event);
}

of.recognition.onstart = function(event)
ofm.recognition.onstart = function(event)
{
console.debug("Speech to text started", event);
of.recognitionActive = true;
ofm.recognitionActive = true;
}

of.recognition.onend = function(event)
ofm.recognition.onend = function(event)
{
console.debug("Speech to text ended", event);

if (of.recognitionActive)
if (ofm.recognitionActive)
{
console.debug("Speech to text restarted");
setTimeout(function() {of.recognition.start()}, 1000);
setTimeout(function() {ofm.recognition.start()}, 1000);
}
}

of.recognition.onerror = function(event)
ofm.recognition.onerror = function(event)
{
console.debug("Speech to text error", event);
}

of.recognition.start();
ofm.recognition.start();
}

//-------------------------------------------------------
Expand Down Expand Up @@ -3527,8 +3527,8 @@ var ofmeet = (function(of)

}({}));

of.recording = false;
ofm.recording = false;

return of;
return ofm;

}(ofmeet || {}));

0 comments on commit ac3ed49

Please sign in to comment.