Skip to content
Snippets Groups Projects
Commit 83e201d8 authored by jakobsbode's avatar jakobsbode
Browse files

video in Onboarding added

parent 35b19a4b
No related branches found
No related tags found
No related merge requests found
...@@ -320,6 +320,13 @@ NSString * const kOnboardInputViewAccessibilityIdentifier = @"OnboardInputViewAc ...@@ -320,6 +320,13 @@ NSString * const kOnboardInputViewAccessibilityIdentifier = @"OnboardInputViewAc
self.moviePlayerController = [AVPlayerViewController new]; self.moviePlayerController = [AVPlayerViewController new];
self.moviePlayerController.player = self.player; self.moviePlayerController.player = self.player;
self.moviePlayerController.showsPlaybackControls = NO; self.moviePlayerController.showsPlaybackControls = NO;
self.moviePlayerController.player.actionAtItemEnd = AVPlayerActionAtItemEndNone;
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(playerItemDidReachEnd:)
name:AVPlayerItemDidPlayToEndTimeNotification
object:[self.moviePlayerController.player currentItem]];
[self.view addSubview:self.moviePlayerController.view]; [self.view addSubview:self.moviePlayerController.view];
} }
...@@ -422,7 +429,7 @@ NSString * const kOnboardInputViewAccessibilityIdentifier = @"OnboardInputViewAc ...@@ -422,7 +429,7 @@ NSString * const kOnboardInputViewAccessibilityIdentifier = @"OnboardInputViewAc
if (!self.onlyInputView) { if (!self.onlyInputView) {
if (self.videoURL) { if (self.videoURL) {
self.moviePlayerController.view.frame = self.view.frame; self.moviePlayerController.view.frame = self.inputView.frame;//self.view.frame;
} }
CGFloat viewWidth = CGRectGetWidth(self.view.frame); CGFloat viewWidth = CGRectGetWidth(self.view.frame);
...@@ -498,4 +505,9 @@ NSString * const kOnboardInputViewAccessibilityIdentifier = @"OnboardInputViewAc ...@@ -498,4 +505,9 @@ NSString * const kOnboardInputViewAccessibilityIdentifier = @"OnboardInputViewAc
} }
} }
- (void)playerItemDidReachEnd:(NSNotification *)notification {
AVPlayerItem *p = [notification object];
[p seekToTime:kCMTimeZero];
}
@end @end
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment