vime-js / vime

Customizable, extensible, accessible and framework agnostic media player. Modern alternative to Video.js and Plyr. Supports HTML5, HLS, Dash, YouTube, Vimeo, Dailymotion...
https://vimejs.com
MIT License
2.75k stars 154 forks source link

Render UI controls outside the video area? #289

Closed spirosikmd closed 2 years ago

spirosikmd commented 2 years ago

Hi there! This is a great package! And amazing documentation, thank you for all the effort!

My question: is there a suggested way to render the UI controls outside the video area?

What I can achieve now

current

What I want

desired

There is a hack to set a padding to the video element inside vm-player, but that breaks kind of the aspect ratio of the video.

vm-player {
  & video {
    padding-bottom: ..;
  }
}
spirosikmd commented 2 years ago

Update: I realised that I can implement the controls I want to render outside the provider myself, and use the provider instance to update the state.

<Player ref={player}>
  <Video />
</Player>
<div>
  {/* custom controls here */}
</div>

Hence, I am closing this issue! If there is any other recommended way to render the controls outside the video area, while still being children of the provider, let me know! Thanks!