SvenTiigi/YouTubePlayerKit

Disable scrolling the player on macOS

kuglee opened this issue · 5 comments

What happened?

Hi,

Thanks for the package, it's working great on iOS. However on macOS the player view can be scrolled and a scroll bar is also visible. Is there a way to disable it?
Névtelen 5

What are the steps to reproduce?

Here is a test view:

  public var youtubePlayerView: some View {
      YouTubePlayerView(YouTubePlayer("https://youtube.com/watch?v=psL_5RIBqnY"))
    .aspectRatio(16 / 9, contentMode: .fit)
  }
``

### What is the expected behavior?

I would expect the scroll gesture to be disabled on the player view .

Hey @kuglee,

Please check out the develop branch which I've just updated to also disable scrolling on macOS (180bbda)

Thank, it's working.
The only issue I have now is that aspectRatio(16 / 9, contentMode: .fit) is not always perfect, so sometimes when the window is resized the scrollbars still appear. I don't know if it's possible to hide them or to size the view some other way to keep aspect ratio.

I've experimented with WKWebView. This css should hide the scrollbars:

<style>
  ::-webkit-scrollbar {
       display: none !important;
  }
</style>

CSS style has been added with 3370aac and will be available with the next release ✌️

Awesome. Thanks.