@@ -37,6 +37,8 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37
37
#import " AVFoundation/AVFoundation.h"
38
38
#import < AVKit/AVKit.h>
39
39
#import " ORKHelpers_Internal.h"
40
+ #import " ORKStepContentView.h"
41
+ #import " ORKStepContentView_Private.h"
40
42
41
43
42
44
@interface ORKRateObservedPlayer : AVPlayer
@@ -79,25 +81,25 @@ - (void)stepDidChange {
79
81
[super stepDidChange ];
80
82
_playbackStoppedTime = NAN;
81
83
_playbackCompleted = NO ;
82
- // FIXME: video instruction step needs to adopt ORKInstructionStepContainerView
83
- // if (self.step && [self isViewLoaded] && [self videoInstructionStep].image) {
84
- // UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] init];
85
- // [tapRecognizer addTarget:self action:@selector(play)];
86
- // [self.stepView.instructionImageView addGestureRecognizer:tapRecognizer];
87
- //
88
- // if (self.stepView.instructionImageView.image ) {
89
- // UIImageView *playImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"play" inBundle:ORKBundle() compatibleWithTraitCollection:nil]];
90
- // self.stepView.instructionImageView .userInteractionEnabled = YES;
91
- // [self.stepView.instructionImageView addSubview:playImageView];
92
- //
93
- // playImageView.translatesAutoresizingMaskIntoConstraints = NO;
94
- //
95
- // NSLayoutConstraint* xConstraint = [NSLayoutConstraint constraintWithItem:self.stepView.instructionImageView attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:playImageView attribute:NSLayoutAttributeCenterX multiplier:1 constant:0];
96
- // NSLayoutConstraint* yConstraint = [NSLayoutConstraint constraintWithItem:self.stepView.instructionImageView attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:playImageView attribute:NSLayoutAttributeCenterY multiplier:1 constant:0];
97
- //
98
- // [self.stepView.instructionImageView addConstraints:@[xConstraint, yConstraint]];
99
- // }
100
- // }
84
+
85
+ if (self.step && [self isViewLoaded ] && [self videoInstructionStep ].image ) {
86
+ UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc ] init ];
87
+ [tapRecognizer addTarget: self action: @selector (play )];
88
+ [self .stepView.stepContentView.topContentImageView addGestureRecognizer: tapRecognizer];
89
+
90
+ if (self.stepView .stepContentView . topContentImageView ) {
91
+ UIImageView *playImageView = [[UIImageView alloc ] initWithImage: [UIImage imageNamed: @" play" inBundle: ORKBundle () compatibleWithTraitCollection: nil ]];
92
+ self.stepView .stepContentView . topContentImageView .userInteractionEnabled = YES ;
93
+ [self .stepView.stepContentView.topContentImageView addSubview: playImageView];
94
+
95
+ playImageView.translatesAutoresizingMaskIntoConstraints = NO ;
96
+
97
+ NSLayoutConstraint * xConstraint = [NSLayoutConstraint constraintWithItem: self .stepView.stepContentView.topContentImageView attribute: NSLayoutAttributeCenterX relatedBy: NSLayoutRelationEqual toItem: playImageView attribute: NSLayoutAttributeCenterX multiplier: 1 constant: 0 ];
98
+ NSLayoutConstraint * yConstraint = [NSLayoutConstraint constraintWithItem: self .stepView.stepContentView.topContentImageView attribute: NSLayoutAttributeCenterY relatedBy: NSLayoutRelationEqual toItem: playImageView attribute: NSLayoutAttributeCenterY multiplier: 1 constant: 0 ];
99
+
100
+ [self .stepView.stepContentView.topContentImageView addConstraints: @[xConstraint, yConstraint]];
101
+ }
102
+ }
101
103
}
102
104
103
105
- (void )setThumbnailImageFromAsset {
0 commit comments