Skip to content

Commit

Permalink
fix(player): avoid to have seek time < 0 for the analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultBee committed Oct 9, 2023
1 parent db65dde commit 4449117
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/ApiVideoPlayer/ApiVideoPlayerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ public class ApiVideoPlayerController: NSObject {
self.avPlayer.seek(to: time, toleranceBefore: .zero, toleranceAfter: .zero) { completed in
self.analytics?
.seek(
from: Float(from.seconds),
to: Float(time.seconds)
from: Float(max(0, from.seconds)),
to: Float(max(0, time.seconds))
) { result in
switch result {
case .success: break
Expand Down

0 comments on commit 4449117

Please sign in to comment.