Skip to content

Commit

Permalink
fix to Transcription app stop button (awsdocs#1858)
Browse files Browse the repository at this point in the history
  • Loading branch information
brmur authored Jun 9, 2021
1 parent 11ea574 commit 2d2ac55
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ Each button on the interface invokes one of these functions when clicked.
</ol>
<p>
<button id="record" onclick="startRecord()"></button>
<button id="stopRecord" disabled onclick="stopRecord()">Stop</button>
<button id="stopRecord" disabled onclick="stopRecord()">Stop and clear</button>
</p>
<h2>Transcription</h2>
<div id="output"></div>
Expand Down Expand Up @@ -346,14 +346,7 @@ window.startRecord = async () => {
};
window.stopRecord = function () {
const micStream = new MicrophoneStream();
console.log("Recording stopped");
var record = document.getElementById("record");
var stop = document.getElementById("stopRecord");
record.disabled = false;
stop.disabled = true;
record.style.backgroundColor = "red";
micStream.stop();
window.location.reload();
};
window.translateText = async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ <h1>Record, translate, transcribe, and email</h1>
</ol>
<p>
<button id="record" onclick="startRecord()"></button>
<button id="stopRecord" disabled onclick="stopRecord()">Stop</button>
<button id="stopRecord" disabled onclick="stopRecord()">Stop & clear</button>
</p>
<h2>Transcription</h2>
<div id="output"></div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,7 @@ window.startRecord = async () => {
};

window.stopRecord = function () {
const micStream = new MicrophoneStream();
console.log("Recording stopped");
var record = document.getElementById("record");
var stop = document.getElementById("stopRecord");
record.disabled = false;
stop.disabled = true;
record.style.backgroundColor = "red";
micStream.stop();
window.location.reload();
};

window.translateText = async () => {
Expand Down

0 comments on commit 2d2ac55

Please sign in to comment.