bday2020/ui/src/components/BDay.vue

76 lines
1.7 KiB
Vue
Raw Normal View History

2020-09-05 16:25:28 +00:00
<template>
2020-09-06 14:52:05 +00:00
<div id="bday">
2020-09-06 00:44:39 +00:00
<h1>Alles Gute zu Deinem Geburtstag!</h1>
2020-09-06 14:52:05 +00:00
<img id="play" v-if=play_visible src="../assets/play.png" usemap="#play" />
<map name="#play">
<area shape="circle" coords="50,50,50" />
</map>
<vue-plyr :options="plyr_options" :emit="['timeupdate']" @timeupdate="videoTimeUpdated">
<video poster="../assets/poster.png">
2020-09-06 00:44:39 +00:00
<source src="/fake_api/part1_240.mp4" type="video/mp4" size="240" />
<source src="/fake_api/part1_360.mp4" type="video/mp4" size="360" />
<source src="/fake_api/part1_480.mp4" type="video/mp4" size="480" />
</video>
</vue-plyr>
</div>
2020-09-05 16:25:28 +00:00
</template>
<script>
export default {
2020-09-06 00:44:39 +00:00
name: "BDay",
2020-09-06 00:58:00 +00:00
data: () => ({
2020-09-06 14:52:05 +00:00
play_visible: false,
2020-09-06 00:58:00 +00:00
plyr_options: {
2020-09-06 14:52:05 +00:00
autoplay: true,
2020-09-06 00:58:00 +00:00
clickToPlay: false,
keyboard: { focused: false, global: false },
controls: ["mute", "volume", "settings", "airplay", "fullscreen"],
settings: ["quality"],
},
}),
2020-09-06 14:52:05 +00:00
methods: {
videoTimeUpdated: function (event) {
// show play button after 3 seconds, then disable event
if (event.timeStamp > 3000) {
this.play_visible = true;
this.videoTimeUpdated = () => true;
}
}
},
mounted() {
2020-09-06 00:44:39 +00:00
document.title = "Herzlichen Glückwunsch!";
},
};
2020-09-05 16:25:28 +00:00
</script>
<style scoped>
2020-09-06 14:52:05 +00:00
div#bday {
2020-09-06 00:44:39 +00:00
margin: auto;
2020-09-06 14:52:05 +00:00
width: 854px;
position: relative;
}
img#play {
outline: none;
-webkit-user-select: none; /* Safari */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* IE10+/Edge */
user-select: none; /* Standard */
position: absolute;
bottom: 190px;
left: 377px;
z-index: 1001;
}
map area{
outline: none;
cursor: pointer;
2020-09-05 16:25:28 +00:00
}
2020-09-05 17:28:34 +00:00
</style>