iOS VLC Swift 版 : 使用 cocoapods 集成 MobileVLCKit-3.3.2

screenshot

swift-vlc.png

www.videolan.org/vlc/downloa…html

Binary

You can also get the binary from our servers instead of the App Store: [VLC for iOS 3.1.5 binary](http://get.videolan.org/vlc-iOS/3.1.5/vlc-ios-3.1.5.ipa). A binary version of MobileVLCKit is available through CocoaPods.python

建立 VLC 項目

pod init
cat Podfile
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'VLC' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for VLC
  pod 'MobileVLCKit'

end
複製代碼

更新 pod

pod repo update
複製代碼

安裝 MobileVLCKit

pod install --verbose
複製代碼

下載實在太慢了

cat ~/.cocoapods/repos/master/Specs/b/f/7/MobileVLCKit/3.3.2/MobileVLCKit.podspec.json | grep http
...
     "http": "https://download.videolan.org/pub/cocoapods/prod/MobileVLCKit-3.3.2-e16829a-774a96ae6.tar.xz",
複製代碼

Motrix 下載上面的 MobileVLCKit-3.3.2-***.tar.xz

更換 http 地址,進入下載好的地址

啓動 Python3 Http Server

python3 -m http.server 80
複製代碼

更換 http 地址爲本地地址

diff --git a/Specs/b/f/7/MobileVLCKit/3.3.2/MobileVLCKit.podspec.json b/Specs/b/f/7/MobileVLCKit/3.3.2/MobileVLCKit.podspec.json
index e6f4d118c5f..d3b15240c40 100644
--- a/Specs/b/f/7/MobileVLCKit/3.3.2/MobileVLCKit.podspec.json
+++ b/Specs/b/f/7/MobileVLCKit/3.3.2/MobileVLCKit.podspec.json
@@ -59,7 +59,7 @@
     "Benjamin Adolphi": "b.adolphi@gmail.com"
   },
   "source": {
- "http": "https://download.videolan.org/pub/cocoapods/prod/MobileVLCKit-3.3.2-e16829a-774a96ae6.tar.xz",
+ "http": "http://127.0.0.1/MobileVLCKit-3.3.2-e16829a-774a96ae6.tar.xz",
     "sha256": "143877baa4e362b673c324d5319983a6023f9ed769c3b045fd49fd5efa53ec0c"
   },
   "ios": {
(END)
複製代碼

重新安裝

pod install --verbose
複製代碼

終於安裝成功了!ios

使用

添加 Project-Bridge-Header.h 頭文件

這裏的是 VLC-Bridge-Header.hgit

  1. 添加 VLC-Bridge-Header.h -> "#import "MobileVLCKit/MobileVLCKit.h""
  2. Build Settings -> Objective-C Bridging Header -> "VLC/VLC-Bridge-Header.h"

源碼:github.com/iOSDevLog/V…

微信公衆號

AIDevLog

License

iOSDevLog.github.io is released under the MIT license. See LICENSE for details.github

相關文章
相關標籤/搜索