@property (nonatomic, strong) MPMoviePlayerController *moviePlayer;
-(MPMoviePlayerController *)moviePlayer{
if (!_moviePlayer) {
_moviePlayer = [[MPMoviePlayerController alloc]init];
[_moviePlayer.view setFrame:self.view.bounds];
//设置自动播放
[_moviePlayer setShouldAutoplay:NO];
//设置源类型 因为新特性一般都是播放本地的小视频 所以设置源类型为file
_moviePlayer.movieSourceType = MPMovieSourceTypeFile;
//取消控制视图 如:播放暂停等
_moviePlayer.controlStyle = MPMovieControlStyleNone;
[self.view addSubview:_moviePlayer.view];
//监听播放完成
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(playFinsihed) name:MPMoviePlayerPlaybackDidFinishNotification object:nil];
}
return _moviePlayer;
}
- (AnimationViewController *)animationViewController{
if (!_animationViewController) {
_animationViewController = [[AnimationViewController alloc]init];
//设置本地视频路径
_animationViewController.moviePath = [[NSBundle mainBundle] pathForResource:@"V" ofType:@"mp4"];
_animationViewController.playFinished = ^{
UINavigationController *rootNav = [[UINavigationController alloc] initWithRootViewController:[[ViewController alloc] init]];
[UIApplication sharedApplication].keyWindow.rootViewController = rootNav;
};
}
return _animationViewController;
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds];
self.window.rootViewController = self.animationViewController;
[self.window makeKeyAndVisible];
return YES;
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有