Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements: fillMode as Enums #18

Closed
confile opened this issue May 11, 2015 · 8 comments
Closed

Improvements: fillMode as Enums #18

confile opened this issue May 11, 2015 · 8 comments

Comments

@confile
Copy link

confile commented May 11, 2015

It is hard to find which fill modes are supported when they are as strings.

self.player.fillMode = “AVLayerVideoGravityResizeAspect”

Could you please add the possible fill modes to the documentation or make them available with an enum?

@piemonte
Copy link
Owner

hey @confile that's a nice idea.

@confile
Copy link
Author

confile commented May 12, 2015

@piemonte Player is a really great lib. Thanks for sharing.
Are there any other fillModes supported right now. Like aspect fill?

@vbergae
Copy link

vbergae commented Feb 24, 2016

(I know it's a bit old, but may help)

@confile AVFoundation defines 3 constants:

AVLayerVideoGravityResizeAspect
AVLayerVideoGravityResizeAspectFill
AVLayerVideoGravityResize

More Info: https://developer.apple.com/library/prerelease/ios/documentation/AVFoundation/Reference/AVFoundation_Constants/index.html#//apple_ref/doc/constant_group/Video_Gravity

@matthewspear
Copy link

@piemonte Has this been implemented? I'd like to jump into open source and this seems a simple enough addition.

@piemonte
Copy link
Owner

piemonte commented Sep 1, 2016

hey @matthewspear thanks for checking in. i'm swamped with some other things so feel free to submit a PR. contributions are always welcome. ✌️

@matthewspear
Copy link

Quite new to submitting to OS projects - How does this look?
I took inspiration from the way a UIImageView handles content mode:

public enum FillMode: String
{
    case resize = "AVLayerVideoGravityResize"
    case resizeAspectFill = "AVLayerVideoGravityResizeAspectFill"
    case resizeAspectFit = "AVLayerVideoGravityResizeAspect"
}

one other alternative would be to just use resize, aspect, aspectFill, which would you prefer?

Can make a pull request once happy with preference or have any other ideas!

Matt

@piemonte
Copy link
Owner

piemonte commented Jan 26, 2017

Hey @matthewspear apologies, i didn't see your last comment. The way you have it is great, I'll just paste it into the class and give you props in the comment.

@matthewspear
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants