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({
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,