diff --git a/ui/src/components/BDay.vue b/ui/src/components/BDay.vue index 0637366..4ff25e9 100644 --- a/ui/src/components/BDay.vue +++ b/ui/src/components/BDay.vue @@ -1,16 +1,18 @@ @@ -20,9 +22,9 @@ export default { name: "BDay", data: () => ({ - play_visible: false, + playVisible: false, - plyr_options: { + plyrOptions: { autoplay: true, clickToPlay: false, keyboard: { focused: false, global: false }, @@ -31,18 +33,43 @@ export default { }, }), + computed: { + player() { + return this.$refs.plyr.player; + }, + }, + methods: { + getVideoSource: function (name) { + let source = { + type: "video", + poster: "../assets/poster.png", + sources: [], + }; + + for (const height of [240, 360, 480]) { + source.sources.push({ + src: "/fake_api/" + name + "_" + height + ".mp4", + type: "video/mp4", + size: height, + }); + } + + return source; + }, + videoTimeUpdated: function (event) { // show play button after 3 seconds, then disable event if (event.timeStamp > 3000) { - this.play_visible = true; + this.playVisible = true; this.videoTimeUpdated = () => true; } - } + }, }, mounted() { document.title = "Herzlichen Glückwunsch!"; + this.player.source = this.getVideoSource("part1"); }, }; @@ -57,7 +84,7 @@ div#bday { img#play { outline: none; - -webkit-user-select: none; /* Safari */ + -webkit-user-select: none; /* Safari */ -moz-user-select: none; /* Firefox */ -ms-user-select: none; /* IE10+/Edge */ user-select: none; /* Standard */ @@ -68,7 +95,7 @@ img#play { z-index: 1001; } -map area{ +map area { outline: none; cursor: pointer; }