-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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]: EXC_BREAKPOINT RCTVideo.playerItemPrepareText for dead local files #3889
Comments
Can you clarify what is a dead video for you ? |
@freeboub as I show on the screenshot - video that can't be loaded even with the native Photo app |
@iserzh so it is just a corrupted file ? Which format do you use ? Mp4 ? |
@freeboub yep, it's mp4 |
OK, clear thank you for all informations. but if you can provide a corrupted video url, it would really be easier to debug ... |
@freeboub it's a local file from PhotoLibrary |
Ok, thank you, So I cannot reproduce it :/ |
maybe you can try this patch: diff --git a/ios/Video/RCTVideo.swift b/ios/Video/RCTVideo.swift
index dc980600..def56ed9 100644
--- a/ios/Video/RCTVideo.swift
+++ b/ios/Video/RCTVideo.swift
@@ -587,39 +587,50 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
}
func playerItemPropegateMetadata(_ playerItem: AVPlayerItem!) async -> AVPlayerItem {
- var mapping: [AVMetadataIdentifier: Any] = [:]
-
- if let title = _source?.customMetadata?.title {
- mapping[.commonIdentifierTitle] = title
- }
+ do {
+ var mapping: [AVMetadataIdentifier: Any] = [:]
- if let artist = _source?.customMetadata?.artist {
- mapping[.commonIdentifierArtist] = artist
- }
+ if let title = _source?.customMetadata?.title {
+ mapping[.commonIdentifierTitle] = title
+ }
- if let subtitle = _source?.customMetadata?.subtitle {
- mapping[.iTunesMetadataTrackSubTitle] = subtitle
- }
+ if let artist = _source?.customMetadata?.artist {
+ mapping[.commonIdentifierArtist] = artist
+ }
- if let description = _source?.customMetadata?.description {
- mapping[.commonIdentifierDescription] = description
- }
+ if let subtitle = _source?.customMetadata?.subtitle {
+ mapping[.iTunesMetadataTrackSubTitle] = subtitle
+ }
- if let imageUri = _source?.customMetadata?.imageUri,
- let imageData = await RCTVideoUtils.createImageMetadataItem(imageUri: imageUri) {
- mapping[.commonIdentifierArtwork] = imageData
- }
+ if let description = _source?.customMetadata?.description {
+ mapping[.commonIdentifierDescription] = description
+ }
- if #available(iOS 12.2, *), !mapping.isEmpty {
- playerItem.externalMetadata = RCTVideoUtils.createMetadataItems(for: mapping)
- }
+ if let imageUri = _source?.customMetadata?.imageUri,
+ let imageData = try await RCTVideoUtils.createImageMetadataItem(imageUri: imageUri) {
+ mapping[.commonIdentifierArtwork] = imageData
+ }
- #if os(tvOS)
- if let chapters = _chapters {
- playerItem.navigationMarkerGroups = RCTVideoTVUtils.makeNavigationMarkerGroups(chapters)
+ if #available(iOS 12.2, *), !mapping.isEmpty {
+ playerItem.externalMetadata = try RCTVideoUtils.createMetadataItems(for: mapping)
}
- #endif
+ #if os(tvOS)
+ if let chapters = _chapters {
+ playerItem.navigationMarkerGroups = try RCTVideoTVUtils.makeNavigationMarkerGroups(chapters)
+ }
+ #endif
+ } catch {
+ DebugLog("An error occurred: \(error.localizedDescription)")
+
+ self.onVideoError?(["error": error.localizedDescription])
+ self.isSetSourceOngoing = false
+ self.applyNextSource()
+
+ if let player = self._player {
+ NowPlayingInfoCenterManager.shared.removePlayer(player: player)
+ }
+ }
return playerItem
}
|
@freeboub unfortunately I also can't debug it since it was on the customer's device and only a trace from Sentry is available. I will try to simulate corrupted file and get back to you |
This issue is stale because it has been open for 30 days with no activity. If there won't be any activity in the next 14 days, this issue will be closed automatically. |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
Version
6.2.0
What platforms are you having the problem on?
iOS
System Version
17.5.1
On what device are you experiencing the issue?
Real device, Simulator
Architecture
Old architecture
What happened?
iOS Application is crashing when trying to load dead files from iCloud. I guess the best solution is to handle such kind of files and emit the
onError
callbackThis error appears at this line
with error for asset
Reproduction
repository link
Reproduction
It's hard to reproduce because there are no steps to make the video file dead as it bugs itself.
Here is how this asset might look
Just render this video as shown in the samples
The text was updated successfully, but these errors were encountered: