zoukankan      html  css  js  c++  java
  • 用视频做启动页

    - (void) showStartMedia{
    
        NSString *path = [[NSBundle mainBundle] pathForResource:@"loadingVedio3" ofType:@"m4v"];
        NSURL *url = [NSURL fileURLWithPath:path];
        _mediaVC = [[MPMoviePlayerViewController alloc] initWithContentURL:url];
        
        CGRect rect = [[UIScreen mainScreen] bounds];
        _mediaVC.view.frame = rect;
        _mediaVC.moviePlayer.controlStyle = MPMovieControlStyleNone;
        _mediaVC.moviePlayer.scalingMode = MPMovieScalingModeAspectFill;
        [self.view addSubview:_mediaVC.view];
        
        if ([_mediaVC.moviePlayer respondsToSelector:@selector(prepareToPlay)])
        {
            [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(stopPlayerCallback:) name:MPMoviePlayerPlaybackDidFinishNotification object:_mediaVC.moviePlayer];
        }
    }
    
    - (void) stopPlayerCallback:(id)sender
    {
        _mediaVC.view.alpha = 1.;
        [UIView beginAnimations:@"MEDIA" context:nil];
        [UIView setAnimationDuration:0.85];
        [UIView setAnimationDelegate:self];
        [UIView setAnimationDidStopSelector:@selector(OnStoped)];
        _mediaVC.view.alpha = 0.;
        [UIView commitAnimations];
        
        //
        [self loadingViewDidDone];
    }
    
    - (void)OnStoped
    {
        [_mediaVC.view removeFromSuperview];
        _mediaVC = nil;
    }
    
    - (void) loadingViewDidDone{
        
        if (self.loadingVCBlock !=nil) {
            
            [self loadingVCBlock]();
        }
    }
    
    - (void)didReceiveMemoryWarning {
        [super didReceiveMemoryWarning];
        // Dispose of any resources that can be recreated.
    }
  • 相关阅读:
    Mysql多表关系
    Linux权限
    Linux安装python环境脚本
    ZJNU 2136
    ZJNU 2135
    ZJNU 2133
    ZJNU 1699
    ZJNU 1542
    ZJNU 1538
    ZJNU 1535
  • 原文地址:https://www.cnblogs.com/fs-ios/p/5148872.html
Copyright © 2011-2022 走看看