BMPlayer icon indicating copy to clipboard operation
BMPlayer copied to clipboard

App Crash

Open 18633142594 opened this issue 1 year ago • 3 comments

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]

18633142594 avatar May 20 '24 06:05 18633142594

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;
}

mazz avatar Sep 26 '24 21:09 mazz

me too.

kvin-van avatar Oct 24 '24 09:10 kvin-van

do not use CacheSupport. use pod "bmplayer". is ok

disook avatar Feb 18 '25 08:02 disook