Skip to content
This repository has been archived by the owner on May 21, 2019. It is now read-only.

Commit

Permalink
Show puppet show time as it's recording (temp solution) #4
Browse files Browse the repository at this point in the history
  • Loading branch information
brianchirls committed Mar 5, 2017
1 parent 2b6baed commit 3651936
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
<div id="show-buttons">
<button id="new-show">New Puppet Show</button>
<button id="record">Record</button>
<span id="timecode">0:00</span>
</div>
</body>

Expand Down
7 changes: 6 additions & 1 deletion src/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ const puppetShowRecorder = new PuppetShowRecorder({
audioContext
});

const timecode = document.getElementById('timecode');

const recordButton = document.getElementById('record');
recordButton.disabled = true;
puppetShowRecorder
Expand All @@ -345,6 +347,7 @@ puppetShowRecorder
})
.on('reset', () => {
recordButton.innerHTML = 'Record';
timecode.innerText = '0';
});
// todo: don't enable record button until puppetShow has loaded
// todo: if puppetShow already has data, skip recording
Expand Down Expand Up @@ -401,7 +404,9 @@ function animate(timestamp) {

// temp
if (puppetShowRecorder.recording) {
console.log(puppetShowRecorder.currentTime);
// todo: format time properly
timecode.innerText = puppetShowRecorder.currentTime.toFixed(2);
// todo: if in playback mode, show play time
}

// Keep looping.
Expand Down

0 comments on commit 3651936

Please sign in to comment.