问题
As per this doc
We can add width and height for player in attribute
<Player playsInline width={100} height={50}>
<source src="https://media.w3.org/2010/05/sintel/trailer_hd.mp4"/>
<ControlBar>
<PlaybackRateMenuButton rates={[2,1.5,1]} order={7.1} />
<VolumeMenuButton disabled />
</ControlBar>
</Player>
But these don't work .. So, did i doing something wrong here?
回答1:
Video Width and Height attribute is effective only if we set fluid
as false
<Player playsInline fluid={false} width={100} height={50}>
<source src="https://media.w3.org/2010/05/sintel/trailer_hd.mp4"/>
<ControlBar>
<PlaybackRateMenuButton rates={[2,1.5,1]} order={7.1} />
<VolumeMenuButton disabled />
</ControlBar>
</Player>
They've updated this in there doc too.
来源:https://stackoverflow.com/questions/44917569/video-react-attribute-width-and-height-is-not-working