From 01628d21a1daba68bc98bf9eb2cd6571eb8855bb Mon Sep 17 00:00:00 2001 From: Ignacio Diaz Date: Wed, 22 Mar 2017 14:38:27 -0300 Subject: [PATCH 1/5] Setting the fitted dimensions to the player scene --- Sources/NYT360PlayerScene.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/NYT360PlayerScene.m b/Sources/NYT360PlayerScene.m index b0ea7dd..26ed186 100644 --- a/Sources/NYT360PlayerScene.m +++ b/Sources/NYT360PlayerScene.m @@ -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 = ({ From 29cd302d44fc6bfef8b945a807288a8c3ec35d3b Mon Sep 17 00:00:00 2001 From: Matt Lilek Date: Sun, 21 May 2017 22:09:02 -0400 Subject: [PATCH 2/5] SCNSceneRenderer's delegate isn't a zeroing weak property. Nil this value out on dealloc to prevent a dangling pointer. --- Sources/NYT360ViewController.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/NYT360ViewController.m b/Sources/NYT360ViewController.m index ab02bb9..2881018 100644 --- a/Sources/NYT360ViewController.m +++ b/Sources/NYT360ViewController.m @@ -78,6 +78,10 @@ - (instancetype)initWithAVPlayer:(AVPlayer *)player motionManager:(id Date: Wed, 28 Jun 2017 10:28:52 -0400 Subject: [PATCH 3/5] Fix spelling error --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index be6f496..66ec1c1 100644 --- a/README.md +++ b/README.md @@ -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 From 8117d3133843a9c27e67098407a9dc76e0df7228 Mon Sep 17 00:00:00 2001 From: Thiago Pontes Date: Thu, 20 Jul 2017 13:15:41 -0400 Subject: [PATCH 4/5] fix compass position report --- Sources/NYT360CameraController.m | 2 +- Sources/NYT360EulerAngleCalculations.h | 2 +- Sources/NYT360EulerAngleCalculations.m | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/NYT360CameraController.m b/Sources/NYT360CameraController.m index 14bf38b..a76920b 100644 --- a/Sources/NYT360CameraController.m +++ b/Sources/NYT360CameraController.m @@ -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 diff --git a/Sources/NYT360EulerAngleCalculations.h b/Sources/NYT360EulerAngleCalculations.h index d55d1aa..32edd0f 100644 --- a/Sources/NYT360EulerAngleCalculations.h +++ b/Sources/NYT360EulerAngleCalculations.h @@ -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); diff --git a/Sources/NYT360EulerAngleCalculations.m b/Sources/NYT360EulerAngleCalculations.m index 24634c4..768217d 100644 --- a/Sources/NYT360EulerAngleCalculations.m +++ b/Sources/NYT360EulerAngleCalculations.m @@ -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 @@ -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); } From c72b3671dee4f19efb07e63eed87b252f34cb3d3 Mon Sep 17 00:00:00 2001 From: Matt Lilek Date: Thu, 20 Jul 2017 16:27:55 -0400 Subject: [PATCH 5/5] Bump to 1.1.1 for release --- NYT360Video.podspec | 2 +- Sources/Info.plist | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NYT360Video.podspec b/NYT360Video.podspec index f71525a..5177834 100644 --- a/NYT360Video.podspec +++ b/NYT360Video.podspec @@ -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 diff --git a/Sources/Info.plist b/Sources/Info.plist index 09bc972..c6f194e 100644 --- a/Sources/Info.plist +++ b/Sources/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.1.0 + 1.1.1 CFBundleSignature ???? CFBundleVersion