для того, чтобы построить самую последнюю версию TVVLCKit успешно выполнить следующие команды из терминала:
git clone http://code.videolan.org/videolan/VLCKit.git
cd VLCKit
./buildMobileVLCKit.sh -t
# it will probably stop on error about code.c missing string.h and it will state the declaration of memcpy is incorrect, execute the following lines:
sed -i .bak 's/git pull --rebase/#git pull --rebase/;s/git reset --hard ${TESTEDHASH}/#git reset --hard ${TESTEDHASH}/' buildMobileVLCKit.sh
sed -i .bak -e '/git reset --hard ${TESTEDHASH}/{' -e 'n;s?git am ../../patches/\*.patch?#git am ../../patches/\*.patch?' -e'}' buildMobileVLCKit.sh
cd MobileVLCKit/ImportedSources/vlc/contrib/AppleTVOS-aarch64/gsm/src
cp code.c code.bak
echo -e "#include <string.h>\n$(cat code.c)" > code.c
cd ../../../../../../..
cd MobileVLCKit/ImportedSources/vlc/contrib/AppleTVSimulator-x86_64/gsm/src
cp code.c code.bak
echo -e "#include <string.h>\n$(cat code.c)" > code.c
cd ../../../../../../..
./buildMobileVLCKit.sh -t
# now you should be able to see the "all done" message, now lets xCode build (you can change the tvOS version from 9.2 to 9.1 if you need), (note the bit code generation option)
xcodebuild -project "MobileVLCKit.xcodeproj" -target "TVVLCKit" -sdk appletvos9.2 -configuration Release ARCHS="arm64" IPHONEOS_DEPLOYMENT_TARGET=9.2 GCC_PREPROCESSOR_DEFINITIONS="" BITCODE_GENERATION_MODE=bitcode
xcodebuild -project "MobileVLCKit.xcodeproj" -target "TVVLCKit" -sdk appletvsimulator9.2 -configuration Release ARCHS="x86_64" IPHONEOS_DEPLOYMENT_TARGET=9.2 GCC_PREPROCESSOR_DEFINITIONS="" BITCODE_GENERATION_MODE=bitcode
# you can also create the framework file for both simulator and red apple tv with the following lines:
cd build
rm -rf TVVLCKit.framework
mkdir TVVLCKit.framework
lipo -create Release-appletvos/libTVVLCKit.a Release-appletvsimulator/libTVVLCKit.a -o TVVLCKit.framework/TVVLCKit
chmod a+x TVVLCKit.framework/TVVLCKit
cp -pr Release-appletvos/TVVLCKit TVVLCKit.framework/Headers
после этого вы можете найти файл «libTVVLCKit.a» для реального Apple TV по адресу: " VLCKit/build/Release-appletvos "и" libTVVLCKit.a "для симулятора Xcode по адресу:" VLCKit/build/Release-appletvsimulator "
Файл фреймворка будет расположен по адресу:" VLCKit/build/TVVLCKit.framework "
для того, чтобы го это перетащить "TVVLCKit.framework" для вашего проекта и включают в себя следующие рамки, а также в проекте:
- AudioToolbox.framework
- OpenGLES.framework
- CFNetwork.framework
- CoreText.framework
- libbz2.tbd
- libiconv.tbd
- CoreGraphics.framework
- Security.framework
- LibC++. TBD
- CoreVideo.framework
- MediaPlayer.framework
- QuartzCore.framework
не уверен, что все они необходимы,
если вы используете быстры , затем создайте файл заголовка моста и напишите этот оператор импорта:
#import <TVVLCKit/TVVLCKit.h>
вот небольшой пример быстры, чтобы играть поток/файл:
var appDelegate: AppDelegate!
appDelegate = UIApplication.sharedApplication().delegate as! AppDelegate
player = VLCMediaPlayer()
player.media = VLCMedia(URL: NSURL(string: "http://streams.videolan.org/streams/mp4/Mr_MrsSmith-h264_aac.mp4"))
player.play()
player.drawable = appDelegate.window // or self.view if this code is in a UIViewController
https://code.videolan.org/videolan/VLCKit/issues/4 – JAL
, как это работает? Я должен ввести эту строку после создания рамки? А потом что? – HadevsCode
Вы пытались отключить биткод в своем проекте? Перейдите в раздел «Настройки сборки», затем перейдите к «Параметры сборки» и измените «Включить биткод» на «Нет» –