From 8b4e2ea013c661cb4f03d881e255eb3fdadfd670 Mon Sep 17 00:00:00 2001 From: Sadaqat Ali Date: Fri, 21 Jan 2022 18:30:20 +0500 Subject: [PATCH] changed uri source to support all videos in anchor renderer --- src/components/postHtmlRenderer/postHtmlRenderer.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/postHtmlRenderer/postHtmlRenderer.tsx b/src/components/postHtmlRenderer/postHtmlRenderer.tsx index ef8ee54b2..88437cb71 100644 --- a/src/components/postHtmlRenderer/postHtmlRenderer.tsx +++ b/src/components/postHtmlRenderer/postHtmlRenderer.tsx @@ -137,9 +137,11 @@ export const PostHtmlRenderer = memo(({ const data = parseLinkData(tnode); _handleOnLinkPress(data); }; - console.log("parseLinkData(tnode) : ", parseLinkData(tnode)); 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 ( { console.log('load start'); }} - source={{ uri: parseLinkData(tnode).videoHref }} + source={{ uri: videoHref }} style={{ width: contentWidth, height: (contentWidth * 9) / 16 }} startInLoadingState={true} onShouldStartLoadWithRequest={() => true}