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

Resolution/Fidelity #78

Open
cosmicvarion opened this issue Mar 25, 2021 · 2 comments
Open

Resolution/Fidelity #78

cosmicvarion opened this issue Mar 25, 2021 · 2 comments
Labels

Comments

@cosmicvarion
Copy link

Is there an easy way to check the smallest increment/decrement to time a user can make with the handles?

@NikKovIos
Copy link
Collaborator

NikKovIos commented Mar 26, 2021

@HHK1 you should know

@HHK1
Copy link
Owner

HHK1 commented Mar 30, 2021

It's currently not implemented, but since the AVAssetTimeSelector is mapping the asset Time to the ui element width, you could easily get it if you modify a bit that class.

currently you have:

func getTime(from position: CGFloat) -> CMTime? {
        guard let asset = asset else {
            return nil
        }
        let normalizedRatio = max(min(1, position / durationSize), 0)
        let positionTimeValue = Double(normalizedRatio) * Double(asset.duration.value)
        return CMTime(value: Int64(positionTimeValue), timescale: asset.duration.timescale)
    }

So I guess that you could expose a method using that for the "smallest position increment" (i.e. 1 pixel or 1 point) and you'll get the corresponding minimal increment;

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

No branches or pull requests

3 participants