fix: add video support in entry content (#3816)

* chore: enable fullscreen video in NativeWebView

* feat: add video component support with controls in HTML parser
This commit is contained in:
Whitewater 2025-05-26 14:58:50 +08:00 committed by GitHub
parent fb40cbea93
commit 6923d0e773
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View File

@ -50,8 +50,9 @@ export const NativeWebView: React.ComponentType<
sharedCookiesEnabled
originWhitelist={["*"]}
allowUniversalAccessFromFileURLs
startInLoadingState
// startInLoadingState
allowsBackForwardNavigationGestures
allowsFullscreenVideo
injectedJavaScriptBeforeContentLoaded={atStart}
onNavigationStateChange={onNavigationStateChange}
onLoadEnd={useCallback(() => {

View File

@ -148,6 +148,11 @@ export const parseHtml = (
className: tw`w-full my-0`,
}),
),
video: ({ node, ...props }) =>
createElement("video", {
...props,
controls: true,
}),
},
})
}