Skip to content

Expose the seekTo functionality for VideoPlayer? #60

Open
@curioustechizen

Description

@curioustechizen

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions