iOSのマルチピクチャ起動ページにショートビデオ起動機能を実現

【再版】

複数の起動ページの画像、短いビデオ機能の追加を開始、アシスタント クラス ファイルをインポートする必要がある

ダウンロードアドレス: https://github.com/dangxiaoyin/XZMCoreNewFeature

手順:

1. ヘッダーファイルをインポートする

#import  "XZMCoreNewFeatureVC.h"

#import  "CALayer+Transition.h"



2. 複数の起動ページ

    UIWindow *window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];

    

    自分.window = ウィンドウ;

    

    //表示するかどうかを決定します: (内部バージョンとローカル バージョン キャッシュが考慮されています)

    BOOL  canShow = [XZMCoreNewFeatureVC canShowNewFeature];

    

    //テストコード、正式版は削除する必要があります

    canShow = はい;

    

    if (canShow){  // 新機能インターフェースを初期化します

        window.rootViewController = [XZMCoreNewFeatureVC newFeatureVCWithImageNam es: @[ @"new1" , @"new2" , @"new3" , @"new4" ]  enterBlock:^{

            

            NSLog( @"メインページに入る" );

            [自己 入力];

            

        }configuration:^(UIButton *enterButton) {  //  Enter ボタンを設定します

            [enterButton setBackgroundImage:[UIImage imageNamed: @"btn_nor" ] forState:UIControlStateNormal];

            [enterButton setBackgroundImage:[UIImage imageNamed: @"btn_pressed" ] forState:UIControlStateHighlighted ];

            enterButton.bounds = CGRectMake( 0012040 );

            enterButton.center = CGPointMake(KScreenW *  0.5 , KScreenH*  0.85 );

        }];

        

    }それ以外の場合は{

        

        [自己 入力];

    }

    

    [ウィンドウ makeKeyAndVisible];

    

    はいを返します




3. 小さなビデオを開始します

    UIWindow  *window = [[ UIWindow  alloc ]  initWithFrame :[ UIScreen  mainScreen ]。境界];

    

    自分自身 = 窓;

    

    //表示するかどうかを決定します: (内部バージョンとローカル バージョン キャッシュが考慮されています)

    BOOL canShow = [XZMCoreNewFeatureVC canShowNewFeature];

    

    //测试代码,正式版本应该删除

    canShow = YES;

    

    if(canShow){ // 初始化新特性界面

        window.rootViewController = [XZMCoreNewFeatureVC newFeatureVCWithPlayerURL:[[NSBundlemainBundle] URLForResource:@"启动视频.mp4" withExtension:nil] enterBlock:^{

            

            NSLog(@"进入主页面");

            [self enter];

        } configuration:^(AVPlayerLayer *playerLayer) {

            

        }];

        

    }else{

        

        [self enter];

    }

    

    [window makeKeyAndVisible];

    

    return YES;



4、进入主页面


// 进入主页面

-(void)enter{

    

    UIViewController *vc = [[UIViewController alloc] init];

    vc.view.backgroundColor = [UIColor brownColor];

    self.window.rootViewController = vc;

    「自分自身レイヤー transitionWithAnimType : TransitionAnimTypeRamdom subType : TransitionSubtypesFromRa mdom カーブ: TransitionCurveRamdom 期間: 2.0f ];

}


[個人的なテストが可能です。ビデオが見つからない場合があります。ポッド リソースをコピーするためにビデオを追加してください]

おすすめ

転載: blog.csdn.net/lichuanliangios/article/details/52690235