skip to Main Content

I have a video player component that uses react-player library with a container div around it to determine its size. When the video displays, there is a small margin on the left and right side of it between the edges of its container. Does anyone know how I can get rid of these margins?

Here is what the video looks like in the app
enter image description here

Here is the react

  const playerComponent = (
<div className="h-64 sm:h-96 bg-blue-300 flex justify-center rounded-lg overflow-hidden">
  <ReactPlayer
    height="100%"
    width="100%"
    playing={true}
    controls
    url={currentMediaURL}
  />
</div>

);

2

Answers


  1. Chosen as BEST ANSWER

    Added 'aspect-video' to the parent container. 2ez.


  2. Try to set below CSS property.

    margin:0px, padding:0px

    This will remove any padding/margin to componens.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search