Code: Select all
@IBOutlet weak var playerView: UIView!{
didSet{
player.drawable = playerView
}
}
func playMedia(){
let media = VLCMedia(URL: validatedStreamInfo.stream)
self.player.media = media
self.player.play()
Code: Select all
#import "UIKit/UIKit"
Code: Select all
[info] ...vlc_entry__adaptative
[info] ...vlc_entry__file
[info] ...vlc_entry__access_mms
[info] ...vlc_entry__concat
[info] ...vlc_entry__a52
[info] all done
I am quite new to use and build VLCKit, especially for AppleTV.Here is my advice to successfuly build VLCKit
1. Start from a clear directory
2. Git clone the repository
before diving into building change 2 things:
In the VLCMedia.m file in the Source folder change things accordingly to this post: https://forum.videolan.org/viewtopic.ph ... 9&p=433850
In the VLCMediaPlayer.h in the header folder add an import to...SNIP...Code: Select all
#import "UIKit/UIKit"
Hi ssbmaccom,I do not use Swift at all (yet). But the official document provided by Apple shall describe the howto sufficiently. TVVLCKit simply implements a Obj-C class you can use from Swift like any other ObjC Class as provided by Cocoa Framework.
See: https://developer.apple.com/library/tvo ... 16-CH2-ID0
As far as I remember, that also was a session during WWDC15 about this topic. A video about this should be available online.
Code: Select all
#import <MobileVLCKit/MobileVLCKit.h>
#import <TVVLCKit/MobileVLCKit.h>
#import "MobileVLCKit.h"
Code: Select all
/Users/ssb/privat/Projekte/VLCKit/Sources/VLCMedia.m:825:72: warning: 'stringByAddingPercentEscapesUsingEncoding:' is deprecated: first deprecated in tvOS 9.0 - Use -stringByAddingPercentEncodingWithAllowedCharacters: instead, which always uses the recommended UTF-8 encoding, and which encodes for a specific URL component or subcomponent since each URL component or subcomponent has different rules for what characters are valid. [-Wdeprecated-declarations]
_url = [NSURL URLWithString:[[NSString stringWithUTF8String:p_url] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
Code: Select all
_url = [NSURL URLWithString:[[NSString stringWithUTF8String:p_url] stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLHostAllowedCharacterSet]]];
Code: Select all
/Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:99:66: warning: undeclared selector 'mediaPlayerPositionChanged:' [-Wundeclared-selector]
withMethod:@selector(mediaPlayerPositionChanged:)
^
/Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:143:66: warning: undeclared selector 'mediaPlayerMediaChanged:' [-Wundeclared-selector]
withMethod:@selector(mediaPlayerMediaChanged:)
^
/Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:173:70: warning: undeclared selector 'mediaPlayerSnapshot:' [-Wundeclared-selector]
withMethod:@selector(mediaPlayerSnapshot:)
^
/Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:177:80: warning: undeclared selector 'mediaPlayerSnapshot:' [-Wundeclared-selector]
withDelegateMethod:@selector(mediaPlayerSnapshot:)
^
/Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:501:5: error: implicit declaration of function 'libvlc_video_set_textrenderer_bool' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
libvlc_video_set_textrenderer_bool(_playerInstance, libvlc_textrender_fontforcebold, [fontForceBold boolValue]);
^
/Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:501:5: note: did you mean 'libvlc_video_set_textrenderer_int'?
In file included from /Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:1:
In file included from /Users/ssb/privat/Projekte/VLCKit/MobileVLCKit_Prefix.pch:9:
In file included from /Users/ssb/privat/Projekte/VLCKit/MobileVLCKit/ImportedSources/vlc/include/vlc/vlc.h:43:
/Users/ssb/privat/Projekte/VLCKit/MobileVLCKit/ImportedSources/vlc/include/vlc/libvlc_media_player.h:1528:17: note: 'libvlc_video_set_textrenderer_int' declared here
LIBVLC_API void libvlc_video_set_textrenderer_int( libvlc_media_player_t *p_mi,
^
/Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:501:57: error: use of undeclared identifier 'libvlc_textrender_fontforcebold'; did you mean
'libvlc_textrender_fontcolor'?
libvlc_video_set_textrenderer_bool(_playerInstance, libvlc_textrender_fontforcebold, [fontForceBold boolValue]);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libvlc_textrender_fontcolor
In file included from /Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:1:
In file included from /Users/ssb/privat/Projekte/VLCKit/MobileVLCKit_Prefix.pch:9:
In file included from /Users/ssb/privat/Projekte/VLCKit/MobileVLCKit/ImportedSources/vlc/include/vlc/vlc.h:43:
/Users/ssb/privat/Projekte/VLCKit/MobileVLCKit/ImportedSources/vlc/include/vlc/libvlc_media_player.h:1522:5: note: 'libvlc_textrender_fontcolor' declared here
libvlc_textrender_fontcolor,
^
/Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:1289:31: error: use of undeclared identifier 'libvlc_MediaPlayerChapterChanged'
libvlc_event_attach(p_em, libvlc_MediaPlayerChapterChanged, HandleMediaChapterChanged, (__bridge void *)(self));
^
/Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:1315:31: error: use of undeclared identifier 'libvlc_MediaPlayerChapterChanged'
libvlc_event_detach(p_em, libvlc_MediaPlayerChapterChanged, HandleMediaChapterChanged, (__bridge void *)(self));
^
/Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:1239:17: warning: method definition for 'mediaPlayerTitleChanged:' not found [-Wincomplete-implementation]
@implementation VLCMediaPlayer (Private)
^
/Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:195:1: note: method 'mediaPlayerTitleChanged:' declared here
- (void)mediaPlayerTitleChanged:(NSNumber *)newTitle;
^
/Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:1239:17: warning: method definition for 'mediaPlayerChapterChanged:' not found [-Wincomplete-implementation]
@implementation VLCMediaPlayer (Private)
^
/Users/ssb/privat/Projekte/VLCKit/Sources/VLCMediaPlayer.m:196:1: note: method 'mediaPlayerChapterChanged:' declared here
- (void)mediaPlayerChapterChanged:(NSNumber *)newChapter;
^
6 warnings and 4 errors generated.
** BUILD FAILED **
this procedure work fine....btw...here's the version with bitcode and simulatorAt the moment, build is not that smooth anymore. build for the libVLC has to be triggered multiple times until it finishes. - hopefully...
@turbolag: simply build the TVVLCKit project with "Archive", then you will get a lib, stripped and with bitcode.
Code: Select all
cd ..
if [ -d "./VLCKit" ] ; then
# pull VLCKit repository
cd "VLCKit"
git pull
else
# clone the VLCKit repository
git clone http://code.videolan.org/videolan/VLCKit.git
cd "VLCKit"
fi
# build lbvlc for tvOS Device
./buildMobileVLCKit.sh -t
# build lbvlc for tvOS Simulator, skipped
# ./buildMobileVLCKit.sh -t -s
xcodebuild -project MobileVLCKit.xcodeproj -target TVVLCKit -configuration Release
# change directory to where ever want it get copied to
cd <your project directory>
# check if library built was successful, if yes, copy the build results
# otherwise prompt a warning
if [ -f "../../VLCKit/build/Release-appletvos/libTVVLCKit.a" ] ; then
if [ -d "VLCKit" ] ; then
rm -rf ./VLCKit/libTVVLCKit.a
else
mkdir "VLCKit"
fi
# copy build result into the project
cp ../../VLCKit/build/Release-appletvos/libTVVLCKit.a ./VLCKit/libTVVLCKit.a
cp ../../VLCKit/build/Release-appletvos/TVVLCKit/* ./VLCKit/TVVLCKit/
else
echo "built was not not successful, please retry."
fi
Code: Select all
bitcode bundle could not be generated because '/xxx/xxx/libTVVLCKit.a(VLCMedia.o)' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
this procedure work fine....btw...here's the version with bitcode and simulatorAt the moment, build is not that smooth anymore. build for the libVLC has to be triggered multiple times until it finishes. - hopefully...
@turbolag: simply build the TVVLCKit project with "Archive", then you will get a lib, stripped and with bitcode.
https://mega.nz/#!CAxkmSxI!2JCXteEcK7rF ... zvVT__4MYk
Return to “VLC for iOS, iPadOS and Apple TV”
Users browsing this forum: Google [Bot] and 17 guests