Skip to content

Commit 0125bbd

Browse files
committed
Optionally show a video when there was no new command for a certain time
1 parent aa56e87 commit 0125bbd

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

frontend/src/App.vue

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
<template>
22
<div id="app">
3-
<StatusBoard/>
3+
<iframe
4+
src="https://www.youtube.com/embed/364zEAsOclU?start=0&autoplay=1&mute=1&loop=1&playlist=364zEAsOclU"
5+
title="Video"
6+
:width="showVideo ? '100%' : '0'"
7+
:height="showVideo ? '100%' : '0'"
8+
allow="autoplay"
9+
/>
10+
<StatusBoard v-if="!showVideo"/>
411
</div>
512
</template>
613

@@ -11,6 +18,25 @@
1118
name: 'app',
1219
components: {
1320
StatusBoard,
21+
},
22+
computed: {
23+
packetTimestamp() {
24+
const packetTimestamp = this.$store.state.refereeMsg.packetTimestamp;
25+
return packetTimestamp / 1000 / 1000
26+
},
27+
showVideo() {
28+
if (this.showVideoAfter) {
29+
const packetTimestamp = this.$store.state.refereeMsg.packetTimestamp;
30+
const commandTimestamp = this.$store.state.refereeMsg.commandTimestamp;
31+
const timeSinceLastCommand = (packetTimestamp - commandTimestamp) / 1000 / 1000;
32+
return timeSinceLastCommand > this.showVideoAfter;
33+
}
34+
return false
35+
},
36+
showVideoAfter() {
37+
let urlParams = new URLSearchParams(window.location.search);
38+
return urlParams.get('showVideoAfter')
39+
},
1440
}
1541
}
1642
</script>

0 commit comments

Comments
 (0)