From bab6fe50b8eb8acbdf50984c0191828905f07617 Mon Sep 17 00:00:00 2001 From: z Date: Wed, 10 Jan 2024 10:03:17 +0800 Subject: [PATCH 1/2] init --- src/components/ali-player/index.vue | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/components/ali-player/index.vue b/src/components/ali-player/index.vue index e90ebd0..45dc1ad 100644 --- a/src/components/ali-player/index.vue +++ b/src/components/ali-player/index.vue @@ -13,7 +13,14 @@ defineOptions({ const props = defineProps({ source: { type: [String, Array], - required: true, + default: "", + }, + vid: { + type: String, + default: "", + }, + playAuth: { + type: String, default: "", }, cover: { @@ -32,9 +39,9 @@ const props = defineProps({ const visibility = useDocumentVisibility(); onMounted(() => { watch( - () => props.source, + [() => props.source, () => props.vid, () => props.playAuth], () => { - if (props.source) fnCreateAliPlayer(); + if (props.source || (props.vid && props.playAuth)) fnCreateAliPlayer(); }, { immediate: true, @@ -61,6 +68,8 @@ const fnCreateAliPlayer = async () => { { id: "J_prismPlayer", source: props.source, + vid: props.vid, + playauth: props.playAuth, cover: props.cover, width: props.width, height: props.height, From 8ca5d0b1053b3569f807b4cc79d2ce45c668214d Mon Sep 17 00:00:00 2001 From: z Date: Wed, 10 Jan 2024 10:04:26 +0800 Subject: [PATCH 2/2] init --- src/components/video/index.vue | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/components/video/index.vue b/src/components/video/index.vue index 84c90a9..19561ed 100644 --- a/src/components/video/index.vue +++ b/src/components/video/index.vue @@ -1,6 +1,11 @@ @@ -16,12 +21,20 @@ defineOptions({ const props = defineProps({ src: { type: String, - required: true, + default: "", + }, + vid: { + type: String, + default: "", + }, + playAuth: { + type: String, + default: "", }, visible: { type: Boolean, - default: false, required: true, + default: false, }, }); const emits = defineEmits(["update:visible"]);