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

App Crash #363

Open
1 task
18633142594 opened this issue May 20, 2024 · 2 comments
Open
1 task

App Crash #363

18633142594 opened this issue May 20, 2024 · 2 comments

Comments

@18633142594
Copy link

Check List

Thanks for considering to open an issue. Before you submit your issue, please confirm these boxes are checked.

  • [☑️ ] I have searched in existing issues but did not find the same one.

BMPlayer version

1.3.2

Installed with

  • Carthage
  • [☑️] Cocoapods

Issue Description

When you play the video, it flashes back, on iOS17, and then it turns out that the format of the video URL, it doesn't parse out, because it's underlined, the variable is kCacheScheme, and it crashes in this method down here

What

[Tell us about the issue]
internal static func asset(for resouce: BMPlayerResourceDefinition) -> AVURLAsset {
let asset = BMPlayerManager.shared.cacheManeger.playerItem(with: resouce.url)
return asset!.asset as! AVURLAsset
}

Reproduce

[The steps to reproduce this issue. What is the URL you were trying to play, where did you put your code, etc.]

Other Comment

[Add anything else here]

@mazz
Copy link

mazz commented Sep 26, 2024

I see this also, the problem is in VIMediaCache.

In VIResourceLoaderManager.m:108` a nil NSURL is returned, resulting in a crash.

- (AVPlayerItem *)playerItemWithURL:(NSURL *)url {
    NSURL *assetURL = [VIResourceLoaderManager assetURLWithURL:url]; // nil!
    AVURLAsset *urlAsset = [AVURLAsset URLAssetWithURL:assetURL options:nil];
    [urlAsset.resourceLoader setDelegate:self queue:dispatch_get_main_queue()];
    AVPlayerItem *playerItem = [AVPlayerItem playerItemWithAsset:urlAsset];
    if ([playerItem respondsToSelector:@selector(setCanUseNetworkResourcesForLiveStreamingWhilePaused:)]) {
        playerItem.canUseNetworkResourcesForLiveStreamingWhilePaused = YES;
    }
    return playerItem;
}

@kvin-van
Copy link

me too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants