IOSでの起動画面としてのビデオObjective C ヘルプは高く評価されています。IOSでの起動画面としてのビデオObjective C
0
A
答えて
1
Moorthy これを実現するには、AVPlayerとAVPlayerViewControllerのヘルプを使用できます。
このトリックを行うプロセスを詳しく説明します。
ステップ1 次のフレームワークをXcodeプロジェクトに追加し、Appdelegateにインポートします。
- @import AVFoundation;
- @import AVKit;
- @import UIKit;
ステップ2 あなたがこの場所に
- (void)videoDidFinish:(id)notification {
AVPlayerItem *p = [notification object];
//do something with player if you want
//Remove Observer
[[NSNotificationCenter defaultCenter] removeObserver:self];
//your initial view can proceed from here
[self ProccedToYourViewController];
}
を取ることになるあなたのAppdelegate didFinishLaunchingWithOptionsメソッドに動画を完了した後
// grab a local URL to our video
NSURL *videoURL = [[NSBundle mainBundle]URLForResource:@"myvideo" withExtension:@"mov"];
// create an AVPlayer
AVPlayer *player = [AVPlayer playerWithURL:videoURL];
// create a player view controller
AVPlayerViewController *controller = [[AVPlayerViewController alloc]init];
controller.player = player;
controller.showsPlaybackControls = false;
controller.view.frame = self.window.frame;
controller.modalPresentationStyle = UIModalPresentationFullScreen;
self.window.rootViewController = controller;
[player play];
// Adding Observer for your video file,
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
[notificationCenter addObserver:self selector:@selector(videoDidFinish:) name:AVPlayerItemDidPlayToEndTimeNotification object:nil];
ステップ3
を以下のコードを追加します。
いくつかのヒント
あなたがスムーズにフェードインを追加して、ビデオの再生を停止して、アニメーションをフェードアウトすることができ、私は今あなたが行く準備ができている自分
//AvplayerViewController View(Video View).
[self.controller.view setAlpha:1.0f];
[UIView animateWithDuration:2.0f animations:^{
//AvplayerViewController View(Video View) setting to hide.
[self.controller.view setAlpha:0.0f];
//initialview(Your Initial View) that add as window root now
self.window.rootViewController = initialview;
[initialview.view setAlpha:1.0f];
[self.window makeKeyAndVisible];
} completion:nil];
のためにした方法を紹介します。乾杯
シンプル
+0
あなたの素早い応答をありがとう.... –
+0
あなたは大歓迎です... :) – Abdu
関連する問題
- 1. iOSの起動画面
- 2. iOSアプリの起動画面(スプラッシュ画面)は必須ですか?
- 3. Objective cを使用してiOS 9.3で起動画面にアニメーションを追加する方法
- 4. iOSロック画面アプリの起動
- 5. iOS 10起動画面のバグ
- 6. ios 9の起動画面がポートレートモードで起動されています
- 7. iOS開発 - メイン画面の画像を変更できる起動画面?
- 8. Androidの画面の向きを変更してビデオを再起動します。
- 9. IOS電話の起動画面の謎の画像
- 10. iOS 10リッチメディアプッシュ通知ビデオとオーディオがObjective-Cで動作しない
- 11. React Native iOS:ビルドで起動イメージの代わりに起動画面を使用
- 12. Objective-C - iOS 4からiOS 5までのアプリ起動メソッドの違いは?
- 13. Imageviewはxcode 9.2の起動画面でパディングを残すios
- 14. 起動画面の終了後にiOS画面が黒くなる
- 15. Androidのゲーム起動画面
- 16. 起動画面のカスタムアニメーション
- 17. 起動画面のカスタマイズ
- 18. 起動画面のゴースト?
- 19. 起動画面のデバッグ
- 20. iPad Webappの起動画面
- 21. ストーリーボードのローカライズ起動画面
- 22. ExceptionInInitializerError JNLP画面を起動しようとしている
- 23. スプラッシュ画面なし&空白画面なしのイオニアアプリ起動
- 24. iOS起動画面のアニメーション化への最適なアプローチ
- 25. iOSさまざまなテーマのアプリの起動画面?
- 26. xamarin ios(visualstudio2013)の起動画面でログイン画面を読み込むことは可能ですか
- 27. 動的起動画面?
- 28. iOS起動画面資産カタログが機能しない
- 29. 画面の角度が変わるとiOSアプリが起動しますか?
- 30. iOS UILocalNotification特定の画面を起動する
、で初期状態のサムネイルを作成します(ビデオ親指を追加)し、anothercontollerでそのloadvideo(ウルinitalコントローラとして設定し、ビデオコントローラ)をした後、起動画面に追加して、どこでも –
Anbu.Karthik @に移動し、あなたの答えがあります私の要件に合致していない、以下のMr.Abduの説明は私の必要条件とうまく一致する。とにかく、あなたの素早い返答に感謝します。 –