mirror of
https://github.com/ianramzy/decentralized-video-chat.git
synced 2024-11-23 18:49:21 +08:00
optimize caption text jquery selection
This commit is contained in:
parent
ec88f5efe6
commit
bba20c9533
@ -251,7 +251,7 @@ var VideoChat = {
|
|||||||
Snackbar.close();
|
Snackbar.close();
|
||||||
VideoChat.remoteVideo.style.background = "none";
|
VideoChat.remoteVideo.style.background = "none";
|
||||||
VideoChat.connected = true;
|
VideoChat.connected = true;
|
||||||
$("#remote-video-text").fadeOut();
|
captionText.fadeOut();
|
||||||
$("#local-video-text").fadeOut();
|
$("#local-video-text").fadeOut();
|
||||||
|
|
||||||
var timesRun = 0;
|
var timesRun = 0;
|
||||||
@ -464,7 +464,7 @@ function requestToggleCaptions() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (receivingCaptions) {
|
if (receivingCaptions) {
|
||||||
$("#remote-video-text").text("").fadeOut();
|
captionText.text("").fadeOut();
|
||||||
$("#caption-text").text("Start Live Caption");
|
$("#caption-text").text("Start Live Caption");
|
||||||
receivingCaptions = false;
|
receivingCaptions = false;
|
||||||
} else {
|
} else {
|
||||||
@ -551,21 +551,21 @@ function startSpeech() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function recieveCaptions(captions) {
|
function recieveCaptions(captions) {
|
||||||
$("#remote-video-text").text("").fadeIn();
|
captionText.text("").fadeIn();
|
||||||
if (!receivingCaptions) {
|
if (!receivingCaptions) {
|
||||||
$("#remote-video-text").text("").fadeOut();
|
captionText.text("").fadeOut();
|
||||||
}
|
}
|
||||||
if (captions === "notusingchrome") {
|
if (captions === "notusingchrome") {
|
||||||
alert("Other caller must be using chrome for this feature to work");
|
alert("Other caller must be using chrome for this feature to work");
|
||||||
receivingCaptions = false;
|
receivingCaptions = false;
|
||||||
$("#remote-video-text").text("").fadeOut();
|
captionText.text("").fadeOut();
|
||||||
$("#caption-text").text("Start Live Caption");
|
$("#caption-text").text("Start Live Caption");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (captions.length > 299) {
|
if (captions.length > 299) {
|
||||||
$("#remote-video-text").text(captions.substr(captions.length - 299));
|
captionText.text(captions.substr(captions.length - 299));
|
||||||
} else {
|
} else {
|
||||||
$("#remote-video-text").text(captions);
|
captionText.text(captions);
|
||||||
}
|
}
|
||||||
rePositionCaptions();
|
rePositionCaptions();
|
||||||
}
|
}
|
||||||
@ -690,7 +690,7 @@ function startUp() {
|
|||||||
// get webcam on load
|
// get webcam on load
|
||||||
VideoChat.requestMediaStream();
|
VideoChat.requestMediaStream();
|
||||||
|
|
||||||
$("#remote-video-text").text("").fadeOut();
|
captionText.text("").fadeOut();
|
||||||
|
|
||||||
$("#moveable").draggable({ containment: "window" });
|
$("#moveable").draggable({ containment: "window" });
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user