More paused behaviour
All checks were successful
Deploy Feature / deploy-feature (push) Successful in 24s
All checks were successful
Deploy Feature / deploy-feature (push) Successful in 24s
This commit is contained in:
47
src/App.vue
47
src/App.vue
@@ -264,15 +264,22 @@
|
|||||||
@ended="handlePlayerPause"
|
@ended="handlePlayerPause"
|
||||||
></audio>
|
></audio>
|
||||||
<div v-if="viewerGuessVisible || showEnableAudio" class="viewer-actions">
|
<div v-if="viewerGuessVisible || showEnableAudio" class="viewer-actions">
|
||||||
<button v-if="showEnableAudio" class="primary enable-audio" @click="enableViewerAudio">
|
<button v-if="showEnableAudio" class="primary enable-audio" @click="enableViewerAudio">
|
||||||
Tap To Enable Audio
|
Tap To Enable Audio
|
||||||
</button>
|
</button>
|
||||||
<button class="primary viewer-guess" :disabled="!canViewerGuess" @click="requestGuessStop">
|
<button class="primary viewer-guess" :disabled="!canViewerGuess" @click="requestGuessStop">
|
||||||
Stop Song And Guess
|
Stop Song And Guess
|
||||||
</button>
|
</button>
|
||||||
</div>
|
<button
|
||||||
<div v-if="!currentClipUrl" class="player-empty"></div>
|
v-if="canControlGame && getCurrentTileStatus() === 'paused' && !!guessingTeamId"
|
||||||
|
class="primary host-reveal"
|
||||||
|
@click="revealPausedGuess"
|
||||||
|
>
|
||||||
|
Reveal Answer
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="!currentClipUrl" class="player-empty"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
@@ -1057,6 +1064,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (status === 'paused') {
|
if (status === 'paused') {
|
||||||
|
if (this.guessingTeamId) return
|
||||||
if (Date.now() < this.pauseTransitionLockUntil) return
|
if (Date.now() < this.pauseTransitionLockUntil) return
|
||||||
this.tiles[key].status = 'guessed'
|
this.tiles[key].status = 'guessed'
|
||||||
this.pauseTransitionLockUntil = 0
|
this.pauseTransitionLockUntil = 0
|
||||||
@@ -1091,6 +1099,29 @@ export default {
|
|||||||
this.queueStateSync()
|
this.queueStateSync()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
async revealPausedGuess() {
|
||||||
|
if (!this.canControlGame) return
|
||||||
|
if (!this.currentTileKey || !this.selectedGame) return
|
||||||
|
if (this.getCurrentTileStatus() !== 'paused') return
|
||||||
|
const [cIndex, qIndex] = this.currentTileKey.split('-').map(Number)
|
||||||
|
const clue = this.selectedGame.categories[cIndex].clues[qIndex]
|
||||||
|
this.tiles[this.currentTileKey].status = 'guessed'
|
||||||
|
this.pauseTransitionLockUntil = 0
|
||||||
|
this.lastAwardedTeamId = null
|
||||||
|
if (clue.answer) {
|
||||||
|
this.currentClipUrl = encodeURI(clue.answer)
|
||||||
|
this.isAnswerClip = true
|
||||||
|
await nextTick()
|
||||||
|
const player = this.getPlayer()
|
||||||
|
if (player) {
|
||||||
|
this.ensureAudioContext()
|
||||||
|
player.currentTime = 0
|
||||||
|
player.load()
|
||||||
|
player.play().catch(() => {})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.queueStateSync()
|
||||||
|
},
|
||||||
handleTileRightClick(cIndex: number, qIndex: number) {
|
handleTileRightClick(cIndex: number, qIndex: number) {
|
||||||
if (!this.canControlGame) return
|
if (!this.canControlGame) return
|
||||||
const key = this.tileKey(cIndex, qIndex)
|
const key = this.tileKey(cIndex, qIndex)
|
||||||
|
|||||||
@@ -619,6 +619,14 @@ audio.hidden-audio {
|
|||||||
box-shadow: none;
|
box-shadow: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.host-reveal {
|
||||||
|
position: absolute;
|
||||||
|
top: 16px;
|
||||||
|
right: 16px;
|
||||||
|
z-index: 4;
|
||||||
|
background: linear-gradient(135deg, #7df58f, #36bf62);
|
||||||
|
}
|
||||||
|
|
||||||
.end-panel {
|
.end-panel {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user