Я включил MobileVLCKit
Версия: 2.2.2 в мой проект iOS. Не удается воспроизвести локальные видеоролики из Camera Roll. Видео из каталога документов и потоковой передачи работают нормально, хотя.
Я использую этот код для извлечения URL-адреса объекта PHAsset
:
- (void)urlForPhAsset:(PHAsset*)phAsset withCompletionBlock:(void (^)(NSURL* url))completionBlock{
[[PHImageManager defaultManager] requestAVAssetForVideo:phAsset options:nil resultHandler:^(AVAsset * _Nullable asset, AVAudioMix * _Nullable audioMix, NSDictionary * _Nullable info) {
NSURL* url= nil;
if([asset isKindOfClass:[AVURLAsset class]]){
url= [(AVURLAsset *)asset URL];
}else if([asset isKindOfClass:[AVComposition class]]){
AVCompositionTrack* compositionTrack= [[(AVComposition*)asset tracks] firstObject];
AVCompositionTrackSegment* segment= [[compositionTrack segments] firstObject];
url= [segment sourceURL];
}
completionBlock(url);
}];
}
Эти предупреждения отображаются в проигрывателе:
Your input can't be opened
VLC is unable to open the MRL 'file:///var/mobile/Media/DCIM/102APPLE/IMG2728.MOV'.
Check the log for details.
File reading failed
VLC could not open the file "/VLC/mobile/Media/DCIM/102APPLE/IMG_2728.MOV"
(Operation not permitted).
Ниже приведены журналы после того, как я использовал опции -vvvv
:
creating player instance with private library as options were given
[000000015e6cf238] core libvlc debug: VLC media player - 2.2.2 Weatherwax
[000000015e6cf238] core libvlc debug: Copyright © 1996-2016 the VideoLAN team
[000000015e6cf238] core libvlc debug: revision 2.2.2-18-gf8b3bf0
[000000015e6cf238] core libvlc debug: configured with /Users/fkuehne/Desktop/VLCKit/MobileVLCKit/ImportedSources/vlc/configure '--prefix=/Users/fkuehne/Desktop/VLCKit/MobileVLCKit/ImportedSources/vlc/install-ios-OS/arm64' '--host=arm-apple-darwin11' '--with-contrib=/Users/fkuehne/Desktop/VLCKit/MobileVLCKit/ImportedSources/vlc/contrib/arm-apple-darwin11-arm64' '--enable-static' '--disable-debug' '--enable-dvbpsi' '--enable-avcodec' '--disable-macosx' '--disable-macosx-dialog-provider' '--disable-macosx-qtkit' '--disable-macosx-eyetv' '--disable-macosx-vlc-app' '--disable-macosx-avfoundation' '--disable-audioqueue' '--disable-shared' '--enable-macosx-quartztext' '--enable-mkv' '--enable-opus' '--disable-faad' '--disable-lua' '--disable-a52' '--enable-fribidi' '--disable-qt' '--disable-skins2' '--disable-vcd' '--disable-vlc' '--disable-vlm' '--disable-httpd' '--disable-nls' '--disable-glx' '--disable-sse' '--enable-neon' '--disable-notify' '--enable-live555' '--enable-realrtsp' '--enable-swscale' '--disable-projectm' '--enable-libass' '--enable-libxml2' '--disable-goom' '--disable-dvdread' '--disable-dvdnav' '--disable-bluray' '--disable-linsys' '--disable-libva' '--disable-gme' '--disable-tremor' '--enable-vorbis' '--disable-fluidsynth' '--disable-jack' '--disable-pulse' '--disable-mtp' '--enable-ogg' '--enable-speex' '--enable-theora' '--enable-flac' '--disable-screen' '--enable-freetype' '--enable-taglib' '--disable-mmx' '--disable-addonmanagermodules' '--disable-mad' 'host_alias=arm-apple-darwin11' 'CC=xcrun clang' 'CFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk -arch arm64 -O3 -g -miphoneos-version-min=7.0' 'LDFLAGS=-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk/usr/lib -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk -Wl,-ios_version_min,7.0' 'CPPFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk -arch arm64 -O3 -g -miphoneos-version-min=7.0' 'CPP=xcrun cc -E' 'CXX=xcrun clang++' 'CXXFLAGS=-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk -arch arm64 -O3 -g -miphoneos-version-min=7.0 -stdlib=libstdc++' 'OBJC=xcrun clang' 'CCAS=gas-preprocessor.pl xcrun clang' 'CXXCPP=xcrun c++ -E' 'AVCODEC_CFLAGS=-I/Users/fkuehne/Desktop/VLCKit/MobileVLCKit/ImportedSources/vlc/install-ios-OS/arm64/include ' 'AVCODEC_LIBS=-L/Users/fkuehne/Desktop/VLCKit/MobileVLCKit/ImportedSources/vlc/install-ios-OS/arm64/lib -lavcodec -lavutil -lz' 'AVFORMAT_CFLAGS=-I/Users/fkuehne/Desktop/VLCKit/MobileVLCKit/ImportedSources/vlc/install-ios-OS/arm64/include' 'AVFORMAT_LIBS=-L/Users/fkuehne/Desktop/VLCKit/MobileVLCKit/ImportedSources/vlc/install-ios-OS/arm64/lib -lavcodec -lz -lavutil -lavformat'
[000000015e6cf238] core libvlc debug: plug-ins loaded: 217 modules
[000000015e6cf238] core libvlc debug: translation test: code is "C"
[000000015e6cf238] core libvlc debug: CPU has capabilities FPU
[000000015f9aab18] core playlist debug: creating audio output
[000000015f9aaf38] core audio output debug: looking for audio output module matching "any": 3 candidates
[000000015f9aaf38] core audio output debug: using audio output module "audiounit_ios"
[000000015f9aab18] core playlist debug: keeping audio output
[000000015f9792a8] core interface debug: looking for interface module matching "ios_dialog_provider,none": 1 candidates
[000000015f9792a8] ios_dialog_provider interface debug: iOS dialog provider initialised
[000000015f9792a8] core interface debug: using interface module "ios_dialog_provider"
[000000015e61f258] core generic error: option marq-color does not exist
[000000015e61f258] core generic error: option marq-opacity does not exist
[000000015e61f258] core generic error: option marq-position does not exist
[000000015e61f258] core generic error: option marq-refresh does not exist
[000000015e61f258] core generic error: option marq-size does not exist
[000000015e61f258] core generic error: option marq-timeout does not exist
[000000015e61f258] core generic error: option marq-x does not exist
[000000015e61f258] core generic error: option marq-y does not exist
[000000015e61f258] core generic debug: creating audio output
[000000015e6cf4c8] core audio output debug: looking for audio output module matching "any": 3 candidates
[000000015e6cf4c8] core audio output debug: using audio output module "audiounit_ios"
[000000015e61f258] core generic debug: keeping audio output
[00000001701d3078] core input debug: Creating an input for 'IMG_2728.MOV'
[00000001701d3078] core input debug: using timeshift granularity of 50 MiB, in path '/tmp'
[00000001701d3078] core input debug: `file:///var/mobile/Media/DCIM/102APPLE/IMG_2728.MOV' gives access `file' demux `' path `/var/mobile/Media/DCIM/102APPLE/IMG_2728.MOV'
[00000001701d3078] core input debug: specified demux `any'
[00000001701d3078] core input debug: creating demux: access='file' demux='any' location='/var/mobile/Media/DCIM/102APPLE/IMG_2728.MOV' file='/var/mobile/Media/DCIM/102APPLE/IMG_2728.MOV'
[000000015e6cf7a8] core demux debug: looking for access_demux module matching "file": 4 candidates
[000000015e6cf7a8] core demux debug: no access_demux modules matched
[00000001701d3078] core input debug: creating access 'file' location='/var/mobile/Media/DCIM/102APPLE/IMG_2728.MOV', path='/var/mobile/Media/DCIM/102APPLE/IMG_2728.MOV'
[000000015f99d0b8] core access debug: looking for access module matching "file": 15 candidates
[000000015f99d0b8] filesystem access debug: opening file `/var/mobile/Media/DCIM/102APPLE/IMG_2728.MOV'
[000000015f99d0b8] filesystem access error: cannot open file /var/mobile/Media/DCIM/102APPLE/IMG_2728.MOV (Operation not permitted)
[000000015f99d0b8] core access debug: no access modules matched
[00000001701d3078] core input error: open of `file:///var/mobile/Media/DCIM/102APPLE/IMG_2728.MOV' failed
Пожалуйста, помогите, если кто-нибудь еще столкнется с подобной проблемой.