Skip to content

Commit

Permalink
Merge pull request #21 from barbeque-squared/feature/use-video
Browse files Browse the repository at this point in the history
Feature/use video
  • Loading branch information
Katharine committed Jun 12, 2020
2 parents 0702367 + 02f7995 commit 8c4047e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion assets/js/lib/display.ts
Expand Up @@ -195,7 +195,7 @@ export class GameDisplay extends EventEmitter {
}
});

if (this.song.video) {
if (this.song.video && localStorage['useVideo'] == "true") {
let start = this.getVideoStartTime();
// if (start > 0) {
// this.videoElement.addEventListener('loadedmetadata', () => {
Expand Down
7 changes: 7 additions & 0 deletions assets/js/lib/party/nick.ts
@@ -1,13 +1,18 @@
export class NickPrompt {
private resolve: (nick: string) => void;
private nickInput: HTMLInputElement;
private useVideoInput: HTMLInputElement;

constructor() {
this.resolve = null;
this.nickInput = <HTMLInputElement>document.getElementById('nick-input');
this.useVideoInput = <HTMLInputElement>document.getElementById('use-video-input');
if (localStorage['nick']) {
this.nickInput.value = localStorage['nick'];
}
if (localStorage['useVideo']) {
this.useVideoInput.checked = localStorage['useVideo'];
}
}
prompt(): Promise<string> {
document.getElementById('nick-confirm-button').onclick = () => this._handleNick();
Expand All @@ -23,9 +28,11 @@ export class NickPrompt {

_handleNick(): void {
let nick = this.nickInput.value;
let useVideo = this.useVideoInput.checked;
if (nick !== '') {
document.getElementById('nick-container').style.display = 'none';
localStorage['nick'] = nick;
localStorage['useVideo'] = useVideo;
this.resolve(nick);
this.resolve = null;
}
Expand Down
4 changes: 4 additions & 0 deletions karaoke/templates/karaoke/party.html
Expand Up @@ -40,6 +40,10 @@ <h1>Ponytone</h1>
<p>
Join the party! Enter a nickname:<br>
<input type="text" id="nick-input" autofocus>
<br />
<input type="checkbox" id="use-video-input" checked="checked" />
<label for="use-video-input">Use video</label>
<br />
<button id="nick-confirm-button" disabled>Join</button></p>
</div>
</div>
Expand Down

0 comments on commit 8c4047e

Please sign in to comment.