File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
ui/src/app/datasets/components Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ const FilePreviewer: React.FC<{ file: FileData }> = ({ file }) => {
3535 const windowSize = useWindowSize ( ) ;
3636 const [ height , setHeight ] = useState ( 0 ) ;
3737 const { setSafeTimeout } = useSafeTimeout ( ) ;
38+ const videoRef = useRef < HTMLVideoElement > ( null ) ;
3839
3940 useEffect ( ( ) => {
4041 if ( containerRef ?. current ) {
@@ -72,6 +73,10 @@ const FilePreviewer: React.FC<{ file: FileData }> = ({ file }) => {
7273 } ;
7374 } , [ fileExtension , setSafeTimeout ] ) ;
7475
76+ useEffect ( ( ) => {
77+ videoRef . current ?. load ( ) ;
78+ } , [ file . thumbnailUrl ] ) ;
79+
7580 const handleIframeError = ( ) => {
7681 setIframeError ( true ) ;
7782 if ( timerRef . current ) {
@@ -91,6 +96,7 @@ const FilePreviewer: React.FC<{ file: FileData }> = ({ file }) => {
9196 case "mp4" :
9297 return (
9398 < video
99+ ref = { videoRef }
94100 controls
95101 style = { { maxHeight : `${ height } px` } }
96102 className = "object-fit"
You can’t perform that action at this time.
0 commit comments