@asd20/ui 3.2.965 → 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.965",
8
+ "version": "3.2.967",
9
9
  "private": false,
10
10
  "license": "MIT",
11
11
  "repository": {
@@ -13,23 +13,20 @@
13
13
  v-if="imageUrl && !$slots.aside"
14
14
  class="asd20-school-homepage-video-header__image"
15
15
  >
16
- <client-only>
17
- <video
18
- v-if="showVideo"
19
- ref="backgroundVideo"
20
- class="background-video"
21
- role="presentation"
22
- aria-hidden="true"
23
- autoplay
24
- loop
25
- autobuffer
26
- muted
27
- playsinline
28
- :poster="imageUrl"
29
- >
30
- <source :src="videoUrl" type="video/mp4" />
31
- </video>
32
- </client-only>
16
+ <video
17
+ ref="backgroundVideo"
18
+ class="background-video"
19
+ role="presentation"
20
+ aria-hidden="true"
21
+ autoplay
22
+ loop
23
+ autobuffer
24
+ muted
25
+ playsinline
26
+ :poster="imageUrl"
27
+ >
28
+ <source :src="loadVideo" type="video/mp4" />
29
+ </video>
33
30
  <button
34
31
  v-if="videoUrl"
35
32
  class="video-toggle-btn"
@@ -109,8 +106,12 @@ export default {
109
106
  data() {
110
107
  return {
111
108
  isPaused: false,
109
+ isMobile: false,
112
110
  }
113
111
  },
112
+ mounted() {
113
+ this.isMobile = this.$mq === 'xs' || this.$mq === 'sm'
114
+ },
114
115
  computed: {
115
116
  mq() {
116
117
  return this.$mq || 'sm'
@@ -130,9 +131,11 @@ export default {
130
131
  this.detailLink.split('/').pop()
131
132
  )
132
133
  },
133
- showVideo() {
134
- const isMobile = this.mq === 'xs' || this.mq === 'sm'
135
- return !isMobile && this.videoUrl
134
+ loadVideo() {
135
+ if (this.isMobile) {
136
+ return null
137
+ }
138
+ return this.videoUrl
136
139
  },
137
140
  },
138
141
  methods: {
@@ -9,24 +9,20 @@
9
9
  <slot name="top" />
10
10
  </div>
11
11
 
12
- <client-only>
13
- <video
14
- v-if="showVideo"
15
- preload="none"
16
- ref="backgroundVideo"
17
- class="background-video"
18
- role="presentation"
19
- aria-hidden="true"
20
- autoplay
21
- loop
22
- autobuffer
23
- muted
24
- playsinline
25
- :poster="imageUrl"
26
- >
27
- <source :src="videoUrl" type="video/mp4" />
28
- </video>
29
- </client-only>
12
+ <video
13
+ ref="backgroundVideo"
14
+ class="background-video"
15
+ role="presentation"
16
+ aria-hidden="true"
17
+ autoplay
18
+ loop
19
+ autobuffer
20
+ muted
21
+ playsinline
22
+ :poster="imageUrl"
23
+ >
24
+ <source :src="loadVideo" type="video/mp4" />
25
+ </video>
30
26
  <button
31
27
  v-if="videoUrl"
32
28
  class="video-toggle-btn"
@@ -73,8 +69,12 @@ export default {
73
69
  data() {
74
70
  return {
75
71
  isPaused: false,
72
+ isMobile: false,
76
73
  }
77
74
  },
75
+ mounted() {
76
+ this.isMobile = this.$mq === 'xs' || this.$mq === 'sm'
77
+ },
78
78
  computed: {
79
79
  mq() {
80
80
  return this.$mq || 'sm'
@@ -92,9 +92,11 @@ export default {
92
92
  this.detailLink.split('/').pop()
93
93
  )
94
94
  },
95
- showVideo() {
96
- const isMobile = this.mq === 'xs' || this.mq === 'sm'
97
- return !isMobile && this.videoUrl
95
+ loadVideo() {
96
+ if (this.isMobile) {
97
+ return null
98
+ }
99
+ return this.videoUrl
98
100
  },
99
101
  },
100
102
  methods: {