我使用requestExportSessionForVideo方法來獲得從PHAsset一個可發送的視頻,但我得到這個警告,並出口會話記錄一個空值:requestExportSessionForVideo零誤差
Null passed to a callee that requires a non-null argument
下面是方法調用:
[manager requestExportSessionForVideo:asset options:videoOptions exportPreset:AVAssetExportSessionStatusUnknown resultHandler:^(AVAssetExportSession * _Nullable exportSession, NSDictionary * _Nullable info) {
NSLog(@"Export session is: %@ ///// Info is %@", exportSession, info);
}];
所打印的信息看起來再好:
Info is {
PHImageFileSandboxExtensionTokenKey = "8b504346993c71de48743d3c9c796385d7911ad2;00000000;00000000;000000000000001b;com.apple.avasset.read-only;00000001;01000002;00000000000468eb;/private/var/mobile/Media/DCIM/100APPLE/IMG_0004.MOV";
PHImageResultDeliveredImageFormatKey = 20000;
PHImageResultIsInCloudKey = 0;
PHImageResultWantedImageFormatKey = 20000;
}
如何從PHAsset獲取可發送到雲容器的視頻對象? 此警告是否會影響輸出? 請注意我的資產是使用GMImagePicker選擇的。
你基本上不能用文件路徑做很多事情,因爲你沒有任何讀取文件的權限。 –
@JohnDing是的,你是對的。 :) – Vats