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

[BUG]: Video gets paused after seek is used on IOS #4373

Closed
maksymhcode-care opened this issue Jan 14, 2025 · 2 comments · Fixed by #4379
Closed

[BUG]: Video gets paused after seek is used on IOS #4373

maksymhcode-care opened this issue Jan 14, 2025 · 2 comments · Fixed by #4379

Comments

@maksymhcode-care
Copy link

Version

6.9.0

What platforms are you having the problem on?

iOS

System Version

IOS 18.1

On what device are you experiencing the issue?

Simulator

Architecture

Old architecture

What happened?

After using seek method video gets paused and only gonna be resumed if resumed method is used

Reproduction Link

no link

Reproduction

Open the video and seek to a random position, after it's loaded video will be paused

Copy link

Thank you for your bug report. We will review it and get back to you if we need more information.

There is a newer version of the library available. You are using version 6.9.0, while the latest stable version is 6.9.1. Please update to the latest version and check if the issue still exists.

Note: If the issue still exists, please update the issue report with the latest information.

@felipegmg
Copy link

Same issue here, but dont resolved with PR above. My suspicion is that it is related to this part of the code:

static func seek(player: AVPlayer, playerItem: AVPlayerItem, paused: Bool, seekTime: Float, seekTolerance: Float, completion: @escaping (Bool) -> Void) {
let timeScale = 1000
let cmSeekTime: CMTime = CMTimeMakeWithSeconds(Float64(seekTime), preferredTimescale: Int32(timeScale))
let current: CMTime = playerItem.currentTime()
let tolerance: CMTime = CMTimeMake(value: Int64(seekTolerance), timescale: Int32(timeScale))
guard CMTimeCompare(current, cmSeekTime) != 0 else {
// skip if there is no diff in current time and seek time
return
}
if !paused { player.pause() }
player.seek(to: cmSeekTime, toleranceBefore: tolerance, toleranceAfter: tolerance, completionHandler: { (finished: Bool) in
completion(finished)
})
}

Furthermore, this seek happens when I use startPosition props feature (I uses the "keep watching" feature), so the player is starting in position but paused. Whats the consequence if I remove this line if !paused { player.pause() } . Why is this in the ode?

Thanks!

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