shaka-project / shaka-player-embedded

Shaka Player in a C++ Framework
Apache License 2.0
239 stars 62 forks source link

Trying to do a fill screen #68

Closed onefarad closed 4 years ago

onefarad commented 4 years ago

Using the latest version of Shaka Player Embedded it is impossible to fill the screen on devices with screens that have a higher aspect ration (20:9, like the iPhoneX).

The player needs a method to set zoom mode, something similar to:

[avPlayerView setVideoGravity:AVLayerVideoGravityResizeAspectFill];
[avPlayerView setVideoGravity:AVLayerVideoGravityResizeAspect];
[avPlayerView setVideoGravity:AVLayerVideoGravityResize];

Now the only option is to use shaka_constraint to stretch the player view, but this will also crop the subtitles, so it cannot be used.

// Place autolayout constraints on views, using Visual Format Language.
NSDictionary<NSString *, UIView *> *views = @{@"p" : self.player};
[self shaka_constraint:@"|-(-40)-[p]-(-40)-|" onViews:views];
[self shaka_constraint:@"V:|-(-25)-[p]-(-25)-|" onViews:views];
onefarad commented 4 years ago

Any hint on how this feature could be implemented?

TheModMaker commented 4 years ago

I'm already working on this as part of #60.