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

Expose the seekTo functionality for VideoPlayer? #60

Open
curioustechizen opened this issue Jan 11, 2024 · 0 comments
Open

Expose the seekTo functionality for VideoPlayer? #60

curioustechizen opened this issue Jan 11, 2024 · 0 comments

Comments

@curioustechizen
Copy link

Hello, currently I'm using the time binding of the VideoPlayer to implement seeking functionality.

func skipForward() {
    currentTime = currentTime + CMTime(seconds: 15.0, preferredTimescale: currentTime.timescale)
}

Where currentTime is a @Binding var currentTime: CMTime = .zero and is passed to the initializer of the VideoPlayer as time: $currentTime.

My question is, what would it take to expose the underlying seekTo methods instead?

I'm having some glitches with the current implementation. For example, if I try to seek forward 15 seconds while the video has less than 15 seconds remaining, then sometimes my onPlayToEndTime is not called and the video resets to end - 15 seconds mark. I suspect this might be due to directly changing the currentTime instead of using the seek APIs.

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

No branches or pull requests

1 participant