pull/1/head
z 2024-01-10 10:03:17 +08:00
parent eb5cd17c49
commit bab6fe50b8
1 changed files with 12 additions and 3 deletions

View File

@ -13,7 +13,14 @@ defineOptions({
const props = defineProps({ const props = defineProps({
source: { source: {
type: [String, Array], type: [String, Array],
required: true, default: "",
},
vid: {
type: String,
default: "",
},
playAuth: {
type: String,
default: "", default: "",
}, },
cover: { cover: {
@ -32,9 +39,9 @@ const props = defineProps({
const visibility = useDocumentVisibility(); const visibility = useDocumentVisibility();
onMounted(() => { onMounted(() => {
watch( watch(
() => props.source, [() => props.source, () => props.vid, () => props.playAuth],
() => { () => {
if (props.source) fnCreateAliPlayer(); if (props.source || (props.vid && props.playAuth)) fnCreateAliPlayer();
}, },
{ {
immediate: true, immediate: true,
@ -61,6 +68,8 @@ const fnCreateAliPlayer = async () => {
{ {
id: "J_prismPlayer", id: "J_prismPlayer",
source: props.source, source: props.source,
vid: props.vid,
playauth: props.playAuth,
cover: props.cover, cover: props.cover,
width: props.width, width: props.width,
height: props.height, height: props.height,