vuepress-plugin-sbaudio
Version:
A music player plugin for vuepress use aplayer and meting
93 lines (92 loc) • 2.62 kB
JavaScript
import { defineComponent, h } from "vue";
import Meting from "./meting.js";
// @ts-ignore
import { aplayerOptions, metingOptions } from "@temp/SbAudioOptions.json";
const APlayerOptionsDefault = aplayerOptions;
const MetingOptionsDefault = metingOptions;
export default defineComponent({
props: {
id: {
type: String,
default: "",
},
server: {
type: String,
default: MetingOptionsDefault.server,
},
type: {
type: String,
default: MetingOptionsDefault.type,
},
auto: {
type: String,
default: "",
},
auth: {
type: String,
default: MetingOptionsDefault.auth,
},
api: {
type: String,
default: MetingOptionsDefault.api,
},
list: {
type: Array,
},
fixed: {
type: Boolean,
default: APlayerOptionsDefault.fixed,
},
mini: {
type: Boolean,
default: APlayerOptionsDefault.mini,
},
autoplay: {
type: Boolean,
default: APlayerOptionsDefault.autoplay,
},
theme: {
type: String,
default: APlayerOptionsDefault.theme,
},
loop: {
type: String,
default: APlayerOptionsDefault.loop,
},
order: {
type: String,
default: APlayerOptionsDefault.order,
},
preload: {
type: String,
default: APlayerOptionsDefault.preload,
},
volume: { type: Number, default: APlayerOptionsDefault.volume },
mutex: { type: Boolean, default: APlayerOptionsDefault.mutex },
listFolded: { type: Boolean, default: APlayerOptionsDefault.listFolded },
listMaxHeight: {
type: String,
default: APlayerOptionsDefault.listMaxHeight,
},
lrcType: {
type: Number,
default: APlayerOptionsDefault.lrcType,
},
audio: {
type: [Object, Array],
},
storageName: { type: String, default: APlayerOptionsDefault.storageName },
customAudioType: {
type: Object,
default: () => APlayerOptionsDefault.customAudioType,
},
customInit: {
type: Object,
default: () => APlayerOptionsDefault.customAudioType,
},
},
setup(props) {
const src = { ...props };
return () => h(Meting, { src });
},
});