プレビューが表示されないのを修正
This commit is contained in:
parent
f1903b26a5
commit
a246a7f772
|
|
@ -10,12 +10,12 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
:style="player.width ? `padding: ${(player.height || 0) / player.width * 100}% 0 0` : `padding: ${(player.height || 0)}px 0 0`"
|
:style="player.width ? `padding: ${(player.height || 0) / player.width * 100}% 0 0` : `padding: ${(player.height || 0)}px 0 0`"
|
||||||
>
|
>
|
||||||
<iframe
|
<iframe
|
||||||
v-if="player.url.startsWith('http://') || player.url.startsWith('https://')"
|
v-if="player.url.startsWith('http://') || player.url?.startsWith('https://')"
|
||||||
sandbox="allow-popups allow-scripts allow-storage-access-by-user-activation allow-same-origin"
|
sandbox="allow-popups allow-scripts allow-storage-access-by-user-activation allow-same-origin"
|
||||||
scrolling="no"
|
scrolling="no"
|
||||||
:allow="player.allow.join(';')"
|
:allow="player.allow.join(';')"
|
||||||
:class="$style.playerIframe"
|
:class="$style.playerIframe"
|
||||||
:src="player.url + (player.url.match(/\?/) ? '&autoplay=1&auto_play=1' : '?autoplay=1&auto_play=1')"
|
:src="player.url && player.url + (player.url.match(/\?/) ? '&autoplay=1&auto_play=1' : '?autoplay=1&auto_play=1')"
|
||||||
:style="{ border: 0 }"
|
:style="{ border: 0 }"
|
||||||
></iframe>
|
></iframe>
|
||||||
<span v-else>invalid url</span>
|
<span v-else>invalid url</span>
|
||||||
|
|
@ -118,11 +118,12 @@ let description = $ref<string | null>(null);
|
||||||
let thumbnail = $ref<string | null>(null);
|
let thumbnail = $ref<string | null>(null);
|
||||||
let icon = $ref<string | null>(null);
|
let icon = $ref<string | null>(null);
|
||||||
let sitename = $ref<string | null>(null);
|
let sitename = $ref<string | null>(null);
|
||||||
let player = $ref({
|
let player = $ref<SummalyResult['player']>({
|
||||||
url: null,
|
url: null,
|
||||||
width: null,
|
width: null,
|
||||||
height: null,
|
height: null,
|
||||||
} as SummalyResult['player']);
|
allow: [],
|
||||||
|
});
|
||||||
let playerEnabled = $ref(false);
|
let playerEnabled = $ref(false);
|
||||||
let tweetId = $ref<string | null>(null);
|
let tweetId = $ref<string | null>(null);
|
||||||
let tweetExpanded = $ref(props.detail);
|
let tweetExpanded = $ref(props.detail);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue