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

fix(VideoPlayer): Fix realm File object accessed from a different thread #1457

Merged
merged 1 commit into from
Feb 27, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions kDriveCore/VideoPlayer/VideoPlayer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,13 @@ public final class VideoPlayer: Pausable {
setupStreamingAsset(remoteAsset, fileName: file.name)

} else if let token = driveFileManager.apiFetcher.currentToken {
let url = Endpoint.download(file: file).url
let fileName = file.name
driveFileManager.apiFetcher.performAuthenticatedRequest(token: token) { token, _ in
guard let token else { return }
let url = Endpoint.download(file: file).url
let headers = ["Authorization": "Bearer \(token.accessToken)"]
let remoteAsset = AVURLAsset(url: url, options: ["AVURLAssetHTTPHeaderFieldsKey": headers])
self.setupStreamingAsset(remoteAsset, fileName: file.name)
self.setupStreamingAsset(remoteAsset, fileName: fileName)
}
}
}
Expand Down
Loading