fix(legacy): pick iframe/video src from full option
This commit is contained in:
parent
b859d1e3b6
commit
e0d39b1a8c
@ -18,7 +18,8 @@ export interface GoViewIframeOption {
|
||||
export type LegacyIframeOption = GoViewIframeOption;
|
||||
|
||||
function pickSrc(option: GoViewIframeOption): string {
|
||||
return pickUrlLike(option.dataset) || pickUrlLike(option.src) || pickUrlLike(option.url);
|
||||
// Prefer the whole option first (covers iframeUrl/embedUrl variants directly on the object).
|
||||
return pickUrlLike(option) || pickUrlLike(option.dataset) || pickUrlLike(option.src) || pickUrlLike(option.url);
|
||||
}
|
||||
|
||||
export function convertGoViewIframeOptionToNodeProps(option: GoViewIframeOption): IframeWidgetNode['props'] {
|
||||
|
||||
@ -25,7 +25,8 @@ export interface GoViewVideoOption {
|
||||
export type LegacyVideoOption = GoViewVideoOption;
|
||||
|
||||
function pickSrc(option: GoViewVideoOption): string {
|
||||
return pickUrlLike(option.dataset) || pickUrlLike(option.src) || pickUrlLike(option.url);
|
||||
// Prefer the whole option first (covers videoUrl/mp4/m3u8/flv/etc directly on the object).
|
||||
return pickUrlLike(option) || pickUrlLike(option.dataset) || pickUrlLike(option.src) || pickUrlLike(option.url);
|
||||
}
|
||||
|
||||
function asString(v: unknown): string {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user