Skip to content

Commit

Permalink
Merge pull request #43891 from tienifr/fix/42303
Browse files Browse the repository at this point in the history
fix: video does not play in thread ancestor
  • Loading branch information
MonilBhavsar authored Jun 19, 2024
2 parents 11636a2 + c0f6d93 commit bfd6923
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react';
import type {CustomRendererProps, TBlock} from 'react-native-render-html';
import {ShowContextMenuContext} from '@components/ShowContextMenuContext';
import VideoPlayerPreview from '@components/VideoPlayerPreview';
import useCurrentReportID from '@hooks/useCurrentReportID';
import * as FileUtils from '@libs/fileDownload/FileUtils';
import tryResolveUrlFromApiRoot from '@libs/tryResolveUrlFromApiRoot';
import Navigation from '@navigation/Navigation';
Expand All @@ -22,14 +23,15 @@ function VideoRenderer({tnode, key}: VideoRendererProps) {
const width = Number(htmlAttribs[CONST.ATTACHMENT_THUMBNAIL_WIDTH_ATTRIBUTE]);
const height = Number(htmlAttribs[CONST.ATTACHMENT_THUMBNAIL_HEIGHT_ATTRIBUTE]);
const duration = Number(htmlAttribs[CONST.ATTACHMENT_DURATION_ATTRIBUTE]);
const currentReportIDValue = useCurrentReportID();

return (
<ShowContextMenuContext.Consumer>
{({report}) => (
<VideoPlayerPreview
key={key}
videoUrl={sourceURL}
reportID={report?.reportID ?? '-1'}
reportID={currentReportIDValue?.currentReportID ?? '-1'}
fileName={fileName}
thumbnailUrl={thumbnailUrl}
videoDimensions={{width, height}}
Expand Down

0 comments on commit bfd6923

Please sign in to comment.