Thursday, 17 January 2019

How do you play a video on watchOS with resizeAspectFill?

Play video in your watchOS app.

WKInterfaceMovie — An interface element that lets you play video and audio content in your watchOS app.

WKInterfaceInlineMovie — An interface element that displays a video’s poster image and supports inline playing of the video.


Works as expected. Video plays. What about scaling it to fill the screen?

There’s a function for that: func setVideoGravity(_ videoGravity: WKVideoGravity)

case resizeAspectFill

Content is resized to fill the bounds rectangle completely while preserving the original aspect ratio of the content. This option results in cropping of the edges of the video in the axis it exceeds.

It doesn't work. Regardless of videoGravity, videos play resized to fit (Content is resized to fit the bounds rectangle).

What am I missing?



from How do you play a video on watchOS with resizeAspectFill?

No comments:

Post a Comment