Reputation: 31
The last days I'm trying to make an app for IOS including VLCKit. I tried to follow all the methods and tutorials that I found, but I can not get the application to compile correctly.
I've tried using cocoapods pod 'MobileVLCKit', '~> 2.2'. But it ends up giving a compilation error, for lack of binaries, when I try to compile the application. I have told xcode not to use binaries, but that only causes more compilation errors, due to lack of functions. So I followed the advice of the Forum
Create a dummy Xcode project, download MobileVLCkit using cocoa pods.
Copy the downloaded "MobileVLCKit.framework" file from the dummy project, into your project root folder.
Go to your project's target build settings and add the following lines to your "Header Search Paths" (add the quotes too)
"$(PROJECT_DIR)/MobileVLCKit.framework/Headers"
"$(BUILT_PRODUCTS_DIR)"
In your project's target build settings add the following lines to your framework search paths (add the quotes too)
"$(SRCROOT)/MobileVLCKit.framework"
"$(PROJECT_DIR)"
in Other linker flags add the following lines
-l"bz2"
-l"iconv"
-framework "MobileVLCKit"
In General > Linked Frameworks and Libraries add the following library by clicking on the + icon libstdc++.6.tbd
Most important of all add the reference to the Bridging-Header.h by including the following line
import "MobileVLCKit/MobileVLCKit.h"
Test by typing VLCMediaPlayerDelegate, see if that auto completes. If so help others by pointing them here, else retrace your steps to see what you have missed.
But in the end it gives the same error.
............
Then I tried to add the libraries by hand, following the official documentation Documentation
But it never ends correctly. After much searching it seems that the latest version could have a failure. So I tried this Suggestion, But just as before it does not work.
rm -Rf VLCKit # Delete the current clone of VLCKit to restart from new one.
git clone https://code.videolan.org/videolan/VLCKit.git #clone VLCKit current version
cd VLCKit #move to VLCKit directory
git reset --hard 2453a955435b9cae2c1637274416a4841ce66909 #move to working commit version
Edit buildMobileVLCKit.sh to add bitcode support using @ssbmaccom patch above
./buildMobileVLCKit.sh -fb #Build VLCKit for device and Simulator with bitcode
................
Any idea how to fix it?
My operating system is -> MacOS Sierra 10.12.6
The version of xcode is -> 9.0.1
Finally I have managed to make it work, both the video and the audio. Testing all the versions and confiurations of the library I have found one that seems to work, or at least does what I need.
pod 'MobileVLCKit-prod', '2.7.9'
Disabling the use of binaries.
Upvotes: 1
Views: 2635
Reputation: 3379
Have you tried with Cocoapods? It's really easy:
MobileVLCKit
to your Podfile
and run pod install
forVLCLink.mm
) MobileVLCKit
in your bridging header. Here is how you play the video with MobileVLCKit
:
let mediaPlayer = VLCMediaPlayer()
func playURI(uri: String) {
mediaPlayer.drawable = self.movieView
let url = URL(string: uri)
let media = VLCMedia(url: url)
mediaPlayer.media = media
mediaPlayer.play()
}
More information at the end of this article: https://hackernoon.com/live-stream-an-onvif-camera-on-your-ios-app-57fe9cead5a5
Upvotes: 1