added inputs validation

This commit was merged in pull request #678.
This commit is contained in:
victorAnumudu
2024-03-27 12:20:01 +01:00
parent e39a8358f7
commit 2d5c828089
5 changed files with 44 additions and 249 deletions
+22
View File
@@ -0,0 +1,22 @@
import React, { useEffect, useRef } from 'react'
export default function VideoElement({videoId}) {
let videoRef = useRef(null)
useEffect(()=>{
if(videoRef.current){
videoRef.current.pause()
videoRef.current.removeAttribute('src')
videoRef.current.load()
}
},[videoId])
return (
<video ref={videoRef} className='w-full h-full' controls autoPlay>
<source src={`https://dev-media.wrenchboard.com/videos/${videoId}`} type='video/mp4'></source>
Your browser does not support the video tag.
</video>
)
}