mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2025-11-03 13:44:47 +08:00
feat:添加西瓜播放器示例
This commit is contained in:
34
src/views/components/video/index.vue
Normal file
34
src/views/components/video/index.vue
Normal file
@@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<div id="mse"></div>
|
||||
</template>
|
||||
|
||||
<script lang='ts'>
|
||||
import { onMounted } from "vue";
|
||||
import Player from "xgplayer/dist/simple_player";
|
||||
import { volume, playbackRate, screenShot } from "xgplayer/dist/controls";
|
||||
export default {
|
||||
setup() {
|
||||
onMounted(() => {
|
||||
let player = new Player({
|
||||
id: "mse",
|
||||
autoplay: false,
|
||||
screenShot: true,
|
||||
url:
|
||||
"https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/mp4/xgplayer-demo-720p.mp4",
|
||||
poster:
|
||||
"https://s2.pstatp.com/cdn/expire-1-M/byted-player-videos/1.0.0/poster.jpg",
|
||||
fluid: true,
|
||||
controlPlugins: [volume, playbackRate, screenShot],
|
||||
playbackRate: [0.5, 0.75, 1, 1.5, 2], //传入倍速可选数组
|
||||
});
|
||||
});
|
||||
return {};
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
#mse {
|
||||
flex: auto;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user