ijkplayer 视频直播框架
参考链接
ijkplayer 视频直播框架
生成模拟器和设备framework
生成配置

版本合并

合并脚本
合并命令
if [ "${ACTION}" = "build" ]
then
FRAMEWORK_NAME=IJKMediaFramework
#FRAMEWORK_NAME=${PROJECT_NAME}
INSTALL_DIR=${SRCROOT}/Products/${FRAMEWORK_NAME}.framework
DEVICE_DIR=${BUILD_ROOT}/${CONFIGURATION}-iphoneos/${FRAMEWORK_NAME}.framework
SIMULATOR_DIR=${BUILD_ROOT}/${CONFIGURATION}-iphonesimulator/${FRAMEWORK_NAME}.framework
if [ -d "${INSTALL_DIR}" ]
then
rm -rf "${INSTALL_DIR}"
fi
mkdir -p "${INSTALL_DIR}"
cp -R "${DEVICE_DIR}/" "${INSTALL_DIR}/"
#ditto "${DEVICE_DIR}/Headers" "${INSTALL_DIR}/Headers"
lipo -create "${DEVICE_DIR}/${FRAMEWORK_NAME}" "${SIMULATOR_DIR}/${FRAMEWORK_NAME}" -output "${INSTALL_DIR}/${FRAMEWORK_NAME}"
#open "${DEVICE_DIR}"
open "${SRCROOT}/Products"
fi
IJK简单实用
#import <IJKMediaFramework/IJKMediaFramework.h>
- (void)setup{
//直播
self.url = @"http://live.hkstv.hk.lxdns.com/live/hks/playlist.m3u8";
[IJKFFMoviePlayerController setLogReport:false];
[IJKFFMoviePlayerController setLogLevel:k_IJK_LOG_DEBUG];
[IJKFFMoviePlayerController checkIfFFmpegVersionMatch:true];
IJKFFOptions *options = [IJKFFOptions optionsByDefault];
_IJKPlayer = [[IJKFFMoviePlayerController alloc]initWithContentURLString:self.url withOptions:options];
[_IJKPlayer prepareToPlay];
_IJKPlayer.view.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
_IJKPlayer.view.size = self.view.size;
_IJKPlayer.shouldAutoplay = YES;
[_IJKPlayer setScalingMode:IJKMPMovieScalingModeAspectFit];
self.PlayerView = [[UIView alloc] initWithFrame:CGRectMake(0, PKNavigationH, PKScreenW, PKScreenH - PKNavigationH - PKTabBarH)];
UIView* ijkPlayerView = [self.IJKPlayer view];
ijkPlayerView.size = self.PlayerView.size;
[self.view addSubview:self.PlayerView];
[self.PlayerView insertSubview:ijkPlayerView atIndex:1];
[self installMovieNotificationObservers];
//动画类 直播特效
LOTAnimationView *animation = [LOTAnimationView animationNamed:@"Watermelon"];
animation.size = CGSizeMake(PKScreenW / 2, PKScreenH /2);
[self.view addSubview:animation];
[animation playWithCompletion:^(BOOL animationFinished) {
// Do Something
[animation removeFromSuperview];
}];
}
json动画类
Lottie.framework
#import <Lottie/Lottie.h>
//动画类 直播特效
LOTAnimationView *animation = [LOTAnimationView animationNamed:@"Watermelon"];
animation.size = CGSizeMake(PKScreenW / 2, PKScreenH /2);
[self.view addSubview:animation];
[animation playWithCompletion:^(BOOL animationFinished) {
// Do Something
[animation removeFromSuperview];
}];