日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

iOS 视频启动界面

發布時間:2025/6/17 编程问答 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 iOS 视频启动界面 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一個簡單的 “視頻啟動界面” 的實現,參考他人的實現,核心抽出來,簡化了一下。

AnimationVideoViewController 實現

?

- (void)viewDidLoad {[super viewDidLoad];// Do any additional setup after loading the view from its nib.self.moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:self.videoURL];self.moviePlayer.view.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);self.moviePlayer.shouldAutoplay = YES;self.moviePlayer.controlStyle = MPMovieControlStyleNone;self.moviePlayer.repeatMode = MPMovieRepeatModeNone;self.moviePlayer.movieSourceType = MPMovieSourceTypeFile;[self.view addSubview:self.moviePlayer.view];//監聽播放完成[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(playFinsihed) name:MPMoviePlayerPlaybackDidFinishNotification object:nil];UIView *backView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];backView.backgroundColor = [UIColor clearColor];[self.moviePlayer.view addSubview:backView];UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(clickClip:)];[backView addGestureRecognizer:tap];[self configShimmerLabel]; }

?

  

?

AnimationVideoViewController 調用

- (void)viewWillAppear:(BOOL)animated{[super viewWillAppear:animated];[self configureVideoStrat];}- (void)configureVideoStrat {NSString *firstlaunch = @"firstlaunch";__weak typeof(self)weakSelf = self;NSInteger firstIN = [[[NSUserDefaults standardUserDefaults] valueForKey:firstlaunch] integerValue];if (firstIN != 0) {//return;}self.animationVC = [[AnimationVideoViewController alloc] init];self.animationVC.videoURL = [NSURL fileURLWithPath:[[NSBundle mainBundle]pathForResource:@"intro"ofType:@"mp4"]];self.animationVC.view.frame = CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);self.animationVC.finishBlock = ^{[UIView animateWithDuration:1.0 animations:^{weakSelf.animationVC.view.alpha = 0;} completion:^(BOOL finished) {[weakSelf.animationVC.view removeFromSuperview];weakSelf.animationVC = nil;}];};[[[UIApplication sharedApplication] keyWindow] addSubview:self.animationVC.view];[[[UIApplication sharedApplication] keyWindow] bringSubviewToFront:self.animationVC.view];[[NSUserDefaults standardUserDefaults] setValue:@(1) forKey:firstlaunch];[[NSUserDefaults standardUserDefaults] synchronize];}

  

?

github 地址:LCSVideotartPageExample

?

轉載于:https://www.cnblogs.com/saytome/p/6963909.html

總結

以上是生活随笔為你收集整理的iOS 视频启动界面的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。