refactor: improve goView iframe detection and video defaults
This commit is contained in:
parent
499aafcaab
commit
437193787b
@ -496,7 +496,7 @@ function NodeView(props: {
|
||||
src={node.props.src}
|
||||
width={rect.w}
|
||||
height={rect.h}
|
||||
autoPlay={node.props.autoplay ?? true}
|
||||
autoPlay={node.props.autoplay ?? false}
|
||||
playsInline
|
||||
loop={node.props.loop ?? false}
|
||||
muted={node.props.muted ?? false}
|
||||
|
||||
@ -124,7 +124,15 @@ function isIframe(c: GoViewComponentLike): boolean {
|
||||
// keep the plain 'web' check last; it's broad and may overlap other widgets.
|
||||
k === 'web' ||
|
||||
k.endsWith('_web') ||
|
||||
k.startsWith('web_')
|
||||
k.startsWith('web_') ||
|
||||
// common embed platforms (usually rendered in an <iframe>)
|
||||
k.includes('youtube') ||
|
||||
k.includes('youtu') ||
|
||||
k.includes('vimeo') ||
|
||||
k.includes('bilibili') ||
|
||||
k.includes('youku') ||
|
||||
k.includes('tencent') ||
|
||||
k.includes('iqiyi')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user