问题描述
我正在像http://react-responsive-carousel.js.org/storybook/?path=/story/02-advanced--youtube-autoplay-with-custom-thumbs中那样使用react-active-carousel来创建youtube视频的旋转木马。
我使用了<ReactPlayer width="100%" url={url} playing={isSelected} height="100%" />
。
有什么方法可以使视频居中显示,以便覆盖整个区域,而两侧都没有黑色空间。
解决方法
您可以通过使用样式来使播放器居中。
<ReactPlayer style={{margin:"auto",text-align:"center",width="100%"}} url={url} playing={isSelected} height="100%" />