Skip to content

Commit

Permalink
Use new objc AVURLAsset generator for chat video cells
Browse files Browse the repository at this point in the history
This makes sure we get rid of the non-public symbol previously used.
  • Loading branch information
tmolitor-stud-tu committed Aug 29, 2024
1 parent eaa9f60 commit 194940c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions Monal/Classes/MLFileTransferVideoCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//

#import "MLFileTransferVideoCell.h"

#import "HelperTools.h"

@implementation MLFileTransferVideoCell

Expand Down Expand Up @@ -63,9 +63,17 @@ -(void) avplayerConfigWithUrlStr:(NSString*)fileUrlStr andMimeType:(NSString*) m
mimeType = @"audio/mp4";
}

AVURLAsset* videoAsset = [[AVURLAsset alloc] initWithURL:videoFileUrl options:@{
@"AVURLAssetOutOfBandMIMETypeKey": mimeType
__block AVURLAsset* videoAsset = nil;
//the completion is calles synchronously
[HelperTools createAVURLAssetFromFile:fileUrlStr havingMimeType:mimeType andFileExtension:nil withCompletionHandler:^(AVURLAsset* asset) {
videoAsset = asset;
}];
if(videoAsset == nil)
{
DDLogWarn(@"Could not create AVURLAsset for video cell!");
return;
}

avplayer = [AVPlayer playerWithPlayerItem:[AVPlayerItem playerItemWithAsset:videoAsset]];
DDLogInfo(@"Created AVPlayer(%@): %@", mimeType, avplayer);
avplayerVC.player = avplayer;
Expand Down

0 comments on commit 194940c

Please sign in to comment.