@asd20/ui 3.2.966 → 3.2.967

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "*.scss",
6
6
  "*.vue"
7
7
  ],
8
- "version": "3.2.966",
8
+ "version": "3.2.967",
9
9
  "private": false,
10
10
  "license": "MIT",
11
11
  "repository": {
@@ -14,7 +14,6 @@
14
14
  class="asd20-school-homepage-video-header__image"
15
15
  >
16
16
  <video
17
- v-if="showVideo"
18
17
  ref="backgroundVideo"
19
18
  class="background-video"
20
19
  role="presentation"
@@ -26,7 +25,7 @@
26
25
  playsinline
27
26
  :poster="imageUrl"
28
27
  >
29
- <source :src="videoUrl" type="video/mp4" />
28
+ <source :src="loadVideo" type="video/mp4" />
30
29
  </video>
31
30
  <button
32
31
  v-if="videoUrl"
@@ -107,8 +106,12 @@ export default {
107
106
  data() {
108
107
  return {
109
108
  isPaused: false,
109
+ isMobile: false,
110
110
  }
111
111
  },
112
+ mounted() {
113
+ this.isMobile = this.$mq === 'xs' || this.$mq === 'sm'
114
+ },
112
115
  computed: {
113
116
  mq() {
114
117
  return this.$mq || 'sm'
@@ -128,9 +131,11 @@ export default {
128
131
  this.detailLink.split('/').pop()
129
132
  )
130
133
  },
131
- showVideo() {
132
- const isMobile = this.mq === 'xs' || this.mq === 'sm'
133
- return !isMobile && this.videoUrl
134
+ loadVideo() {
135
+ if (this.isMobile) {
136
+ return null
137
+ }
138
+ return this.videoUrl
134
139
  },
135
140
  },
136
141
  methods: {
@@ -10,8 +10,6 @@
10
10
  </div>
11
11
 
12
12
  <video
13
- v-if="showVideo"
14
- preload="none"
15
13
  ref="backgroundVideo"
16
14
  class="background-video"
17
15
  role="presentation"
@@ -23,7 +21,7 @@
23
21
  playsinline
24
22
  :poster="imageUrl"
25
23
  >
26
- <source :src="videoUrl" type="video/mp4" />
24
+ <source :src="loadVideo" type="video/mp4" />
27
25
  </video>
28
26
  <button
29
27
  v-if="videoUrl"
@@ -71,8 +69,12 @@ export default {
71
69
  data() {
72
70
  return {
73
71
  isPaused: false,
72
+ isMobile: false,
74
73
  }
75
74
  },
75
+ mounted() {
76
+ this.isMobile = this.$mq === 'xs' || this.$mq === 'sm'
77
+ },
76
78
  computed: {
77
79
  mq() {
78
80
  return this.$mq || 'sm'
@@ -90,9 +92,11 @@ export default {
90
92
  this.detailLink.split('/').pop()
91
93
  )
92
94
  },
93
- showVideo() {
94
- const isMobile = this.mq === 'xs' || this.mq === 'sm'
95
- return !isMobile && this.videoUrl
95
+ loadVideo() {
96
+ if (this.isMobile) {
97
+ return null
98
+ }
99
+ return this.videoUrl
96
100
  },
97
101
  },
98
102
  methods: {