Browse Source

视频添加poster

pull/48/head
zyronon 1 year ago
parent
commit
8c2bb79da2
  1. BIN
      public/images/a1.jpg
  2. BIN
      public/images/a2.jpg
  3. BIN
      public/images/a3.jpg
  4. BIN
      public/images/a4.jpg
  5. BIN
      public/images/a5.jpg
  6. 5
      src/assets/data/posts6.json
  7. 7
      src/components/slide/BVideo.vue

BIN
public/images/a1.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

BIN
public/images/a2.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 83 KiB

BIN
public/images/a3.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
public/images/a4.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

BIN
public/images/a5.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

5
src/assets/data/posts6.json

@ -58,6 +58,7 @@ @@ -58,6 +58,7 @@
"width": 720,
"height": 720
},
"poster":"a1.jpg",
"height": 3840,
"width": 2160,
"ratio": "1080p",
@ -342,6 +343,7 @@ @@ -342,6 +343,7 @@
"width": 720,
"height": 720
},
"poster":"a2.jpg",
"height": 1920,
"width": 1080,
"ratio": "1080p",
@ -914,6 +916,7 @@ @@ -914,6 +916,7 @@
"width": 720,
"height": 720
},
"poster":"a3.jpg",
"height": 1920,
"width": 1080,
"ratio": "720p",
@ -1163,6 +1166,7 @@ @@ -1163,6 +1166,7 @@
"width": 720,
"height": 720
},
"poster":"a4.jpg",
"height": 1080,
"width": 1920,
"ratio": "1080p",
@ -1424,6 +1428,7 @@ @@ -1424,6 +1428,7 @@
"width": 720,
"height": 720
},
"poster":"a5.jpg",
"height": 1920,
"width": 1080,
"ratio": "1080p",

7
src/components/slide/BVideo.vue

@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
<!-- <video :src="item.video + '?v=123'"-->
<video
:src="item.video.play_addr.url_list[0]"
:poster="_checkImgUrl(item.video.cover.url_list[0])"
:poster="poster"
ref="video"
muted
preload
@ -82,7 +82,7 @@ import Loading from '../Loading' @@ -82,7 +82,7 @@ import Loading from '../Loading'
import ItemToolbar from './ItemToolbar'
import ItemDesc from './ItemDesc'
import bus, { EVENT_KEY } from '../../utils/bus'
import { SlideItemPlayStatus } from '../../utils/const_var'
import { SlideItemPlayStatus } from '@/utils/const_var'
import { computed } from 'vue'
import { Icon } from '@iconify/vue'
@ -134,6 +134,9 @@ export default { @@ -134,6 +134,9 @@ export default {
}
},
computed: {
poster() {
return _checkImgUrl(this.item.video.poster ?? this.item.video.cover.url_list[0])
},
durationStyle() {
return { width: this.playX + 'px' }
},

Loading…
Cancel
Save