changed uri source to support all videos in anchor renderer

This commit is contained in:
Sadaqat Ali 2022-01-21 18:30:20 +05:00
parent 68a94dd2c1
commit 8b4e2ea013

View File

@ -137,9 +137,11 @@ export const PostHtmlRenderer = memo(({
const data = parseLinkData(tnode); const data = parseLinkData(tnode);
_handleOnLinkPress(data); _handleOnLinkPress(data);
}; };
console.log("parseLinkData(tnode) : ", parseLinkData(tnode));
if (tnode.classes?.indexOf('markdown-video-link') >= 0) { if (tnode.classes?.indexOf('markdown-video-link') >= 0) {
// get video src
let videoHref = tnode.attributes['data-embed-src'] || tnode.attributes['data-video-href'] || tnode.children[0].attributes['src'];
return ( return (
<WebView <WebView
scalesPageToFit={true} scalesPageToFit={true}
@ -152,7 +154,7 @@ export const PostHtmlRenderer = memo(({
onLoadStart={() => { onLoadStart={() => {
console.log('load start'); console.log('load start');
}} }}
source={{ uri: parseLinkData(tnode).videoHref }} source={{ uri: videoHref }}
style={{ width: contentWidth, height: (contentWidth * 9) / 16 }} style={{ width: contentWidth, height: (contentWidth * 9) / 16 }}
startInLoadingState={true} startInLoadingState={true}
onShouldStartLoadWithRequest={() => true} onShouldStartLoadWithRequest={() => true}