Skip to content

Commit

Permalink
Merge pull request #60 from NYTimes/merge_into_master_for_1.1.1
Browse files Browse the repository at this point in the history
Merge into master for 1.1.1
  • Loading branch information
mlilek-nyt committed Jul 20, 2017
2 parents 98be582 + 1d91da7 commit bf7b863
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion NYT360Video.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'NYT360Video'
s.version = '1.1.0'
s.version = '1.1.1'
s.summary = 'NYT360Video plays 360º video streamed from an AVPlayer.'

s.description = <<-DESC
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ You may want to restrict the gesture-based interactions with `NYT360ViewControll

First, [`NYT360ViewController` provides properties](https://github.com/NYTimes/ios-360-videos/blob/68c522d51d6c88ddd705e4febbb480de825cdc5d/Sources/NYT360ViewController.h#L111) to configure which axes of movement are allowed. (This would be the simplest way to solve the example problem set out above.)

The library exposes its pan gesture recognizer as a property on `NYT360ViewController` for more advanced ingegration with other gesture recognizers. And finally, the type `NYT360CameraPanGestureRecognizer` is introduced so that host applications can more easily configure interaction with other gesture recognizers, without having to refer to specific instances of an NYT360Video gesture recognizer.
The library exposes its pan gesture recognizer as a property on `NYT360ViewController` for more advanced integration with other gesture recognizers. And finally, the type `NYT360CameraPanGestureRecognizer` is introduced so that host applications can more easily configure interaction with other gesture recognizers, without having to refer to specific instances of an NYT360Video gesture recognizer.

## Requirements

Expand Down
2 changes: 1 addition & 1 deletion Sources/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.1.0</string>
<string>1.1.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion Sources/NYT360CameraController.m
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ - (void)stopMotionUpdates {
#pragma mark - Compass Angle

- (float)compassAngle {
return NYT360CompassAngleForEulerAngles(self.pointOfView.eulerAngles, NYT360EulerAngleCalculationDefaultReferenceCompassAngle);
return NYT360CompassAngleForEulerAngles(self.pointOfView.eulerAngles);
}

#pragma mark - Camera Control
Expand Down
2 changes: 1 addition & 1 deletion Sources/NYT360EulerAngleCalculations.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ CGFloat NYT360OptimalYFovForViewSize(CGSize viewSize);
*
* Input values in excess of one rotation will be mapped to an equivalent value within the range of plus or minus one radian, such that output values will exceed one rotation. Input values equal (or very very close to equal) to a multiple of one radian (positive or negative) will be mapped to 0.
*/
float NYT360CompassAngleForEulerAngles(SCNVector3 eulerAngles, float referenceAngle);
float NYT360CompassAngleForEulerAngles(SCNVector3 eulerAngles);
6 changes: 3 additions & 3 deletions Sources/NYT360EulerAngleCalculations.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#pragma mark - Constants

CGFloat const NYT360EulerAngleCalculationNoiseThresholdDefault = 0.12;
float const NYT360EulerAngleCalculationDefaultReferenceCompassAngle = 0;
float const NYT360EulerAngleCalculationDefaultReferenceCompassAngle = 3.14;

#pragma mark - Inline Functions

Expand Down Expand Up @@ -155,6 +155,6 @@ CGFloat NYT360OptimalYFovForViewSize(CGSize viewSize) {
return yFov;
}

float NYT360CompassAngleForEulerAngles(SCNVector3 eulerAngles, float referenceAngle) {
return NYT360UnitRotationForCameraRotation((-1.0 * eulerAngles.y) + referenceAngle);
float NYT360CompassAngleForEulerAngles(SCNVector3 eulerAngles) {
return NYT360UnitRotationForCameraRotation((-1.0 * eulerAngles.y) + NYT360EulerAngleCalculationDefaultReferenceCompassAngle);
}
4 changes: 3 additions & 1 deletion Sources/NYT360PlayerScene.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ - (instancetype)initWithAVPlayer:(AVPlayer *)player boundToView:(SCNView *)view
[self.rootNode addChildNode:_cameraNode];

SKScene *skScene = ({
SKScene *scene = [[SKScene alloc] initWithSize:CGSizeMake(1280, 1280)];
AVAssetTrack *assetTrack = [[player.currentItem.asset tracksWithMediaType:AVMediaTypeVideo] firstObject];
CGSize assetDimensions = assetTrack ? CGSizeApplyAffineTransform(assetTrack.naturalSize, assetTrack.preferredTransform) : CGSizeMake(1280, 1280);
SKScene *scene = [[SKScene alloc] initWithSize:CGSizeMake(fabsf(assetDimensions.width), fabsf(assetDimensions.height))];
scene.shouldRasterize = YES;
scene.scaleMode = SKSceneScaleModeAspectFit;
_videoNode = ({
Expand Down
4 changes: 4 additions & 0 deletions Sources/NYT360ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ - (instancetype)initWithAVPlayer:(AVPlayer *)player motionManager:(id<NYT360Moti
return self;
}

- (void)dealloc {
_sceneView.delegate = nil;
}

#pragma mark - Playback

- (void)play {
Expand Down

0 comments on commit bf7b863

Please sign in to comment.