When I use a video tag in react for some reason it keeps going to the full size of my screen. Can you help me? My Code
import sound from './best.wav'
import vid from './best.mp4'
function App() {
return (
<div>
<video controls>
<source src={vid} type="video/mp4" />
<source src={sound} type="audio/wav" />
</video>
</div>
);
}
export default App;
Add width inline will help you to control video layouts, moreover, MDN documentation will help you understand in-depth
import sound from './best.wav'
import vid from './best.mp4'
function App() {
return (
<div>
<video controls style={{width: '200px'}}>
<source src={vid} type="video/mp4" />
<source src={sound} type="audio/wav" />
</video>
</div>
);
}
export default App;