This commit is contained in:
14
src/App.vue
14
src/App.vue
@@ -406,7 +406,8 @@ export default {
|
|||||||
audioUnlocked: true,
|
audioUnlocked: true,
|
||||||
latestRemoteState: null as RealtimeState | null,
|
latestRemoteState: null as RealtimeState | null,
|
||||||
viewerTeamId: '',
|
viewerTeamId: '',
|
||||||
guessingTeamId: null as string | null
|
guessingTeamId: null as string | null,
|
||||||
|
pauseTransitionLockUntil: 0
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
@@ -591,6 +592,7 @@ export default {
|
|||||||
this.latestRemoteState = null
|
this.latestRemoteState = null
|
||||||
this.viewerTeamId = ''
|
this.viewerTeamId = ''
|
||||||
this.guessingTeamId = null
|
this.guessingTeamId = null
|
||||||
|
this.pauseTransitionLockUntil = 0
|
||||||
this.setGameInUrl('')
|
this.setGameInUrl('')
|
||||||
},
|
},
|
||||||
async connectSession() {
|
async connectSession() {
|
||||||
@@ -735,6 +737,7 @@ export default {
|
|||||||
this.tiles[key].status = 'paused'
|
this.tiles[key].status = 'paused'
|
||||||
this.lastAwardedTeamId = null
|
this.lastAwardedTeamId = null
|
||||||
this.guessingTeamId = teamId
|
this.guessingTeamId = teamId
|
||||||
|
this.pauseTransitionLockUntil = Date.now() + 1200
|
||||||
this.isAnswerClip = false
|
this.isAnswerClip = false
|
||||||
const player = this.getPlayer()
|
const player = this.getPlayer()
|
||||||
player?.pause()
|
player?.pause()
|
||||||
@@ -964,6 +967,7 @@ export default {
|
|||||||
this.currentClipUrl = ''
|
this.currentClipUrl = ''
|
||||||
this.lastAwardedTeamId = null
|
this.lastAwardedTeamId = null
|
||||||
this.guessingTeamId = null
|
this.guessingTeamId = null
|
||||||
|
this.pauseTransitionLockUntil = 0
|
||||||
this.teams = this.teams.map((team) => ({ ...team, score: 0 }))
|
this.teams = this.teams.map((team) => ({ ...team, score: 0 }))
|
||||||
const randomTeam = this.teams[Math.floor(Math.random() * this.teams.length)]
|
const randomTeam = this.teams[Math.floor(Math.random() * this.teams.length)]
|
||||||
this.currentSelectorId = randomTeam?.id || null
|
this.currentSelectorId = randomTeam?.id || null
|
||||||
@@ -980,6 +984,7 @@ export default {
|
|||||||
this.lastAwardedTeamId = null
|
this.lastAwardedTeamId = null
|
||||||
this.isAnswerClip = false
|
this.isAnswerClip = false
|
||||||
this.guessingTeamId = null
|
this.guessingTeamId = null
|
||||||
|
this.pauseTransitionLockUntil = 0
|
||||||
this.teardownAudio()
|
this.teardownAudio()
|
||||||
this.queueStateSync()
|
this.queueStateSync()
|
||||||
},
|
},
|
||||||
@@ -1028,6 +1033,7 @@ export default {
|
|||||||
this.currentClipUrl = encodeURI(clue.song)
|
this.currentClipUrl = encodeURI(clue.song)
|
||||||
this.isAnswerClip = false
|
this.isAnswerClip = false
|
||||||
this.guessingTeamId = null
|
this.guessingTeamId = null
|
||||||
|
this.pauseTransitionLockUntil = 0
|
||||||
await nextTick()
|
await nextTick()
|
||||||
const player = this.getPlayer()
|
const player = this.getPlayer()
|
||||||
if (player) {
|
if (player) {
|
||||||
@@ -1043,6 +1049,7 @@ export default {
|
|||||||
if (status === 'playing') {
|
if (status === 'playing') {
|
||||||
this.tiles[key].status = 'paused'
|
this.tiles[key].status = 'paused'
|
||||||
this.guessingTeamId = this.currentSelectorId
|
this.guessingTeamId = this.currentSelectorId
|
||||||
|
this.pauseTransitionLockUntil = 0
|
||||||
const player = this.getPlayer()
|
const player = this.getPlayer()
|
||||||
player?.pause()
|
player?.pause()
|
||||||
this.queueStateSync()
|
this.queueStateSync()
|
||||||
@@ -1050,7 +1057,9 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (status === 'paused') {
|
if (status === 'paused') {
|
||||||
|
if (Date.now() < this.pauseTransitionLockUntil) return
|
||||||
this.tiles[key].status = 'guessed'
|
this.tiles[key].status = 'guessed'
|
||||||
|
this.pauseTransitionLockUntil = 0
|
||||||
this.lastAwardedTeamId = null
|
this.lastAwardedTeamId = null
|
||||||
if (clue.answer) {
|
if (clue.answer) {
|
||||||
this.currentClipUrl = encodeURI(clue.answer)
|
this.currentClipUrl = encodeURI(clue.answer)
|
||||||
@@ -1077,6 +1086,7 @@ export default {
|
|||||||
this.currentClipUrl = ''
|
this.currentClipUrl = ''
|
||||||
this.lastAwardedTeamId = null
|
this.lastAwardedTeamId = null
|
||||||
this.guessingTeamId = null
|
this.guessingTeamId = null
|
||||||
|
this.pauseTransitionLockUntil = 0
|
||||||
this.checkEnd()
|
this.checkEnd()
|
||||||
this.queueStateSync()
|
this.queueStateSync()
|
||||||
}
|
}
|
||||||
@@ -1089,6 +1099,7 @@ export default {
|
|||||||
|
|
||||||
if (status === 'paused') {
|
if (status === 'paused') {
|
||||||
this.tiles[key].status = 'playing'
|
this.tiles[key].status = 'playing'
|
||||||
|
this.pauseTransitionLockUntil = 0
|
||||||
this.guessingTeamId = null
|
this.guessingTeamId = null
|
||||||
const player = this.getPlayer()
|
const player = this.getPlayer()
|
||||||
player?.play().catch(() => {})
|
player?.play().catch(() => {})
|
||||||
@@ -1102,6 +1113,7 @@ export default {
|
|||||||
this.currentClipUrl = ''
|
this.currentClipUrl = ''
|
||||||
this.isAnswerClip = false
|
this.isAnswerClip = false
|
||||||
this.guessingTeamId = null
|
this.guessingTeamId = null
|
||||||
|
this.pauseTransitionLockUntil = 0
|
||||||
const player = this.getPlayer()
|
const player = this.getPlayer()
|
||||||
player?.pause()
|
player?.pause()
|
||||||
this.teardownAudio()
|
this.teardownAudio()
|
||||||
|
|||||||
Reference in New Issue
Block a user