Skip to content

Commit

Permalink
Merge pull request #53 from nachonet/actual-video-quality
Browse files Browse the repository at this point in the history
Setting the fitted dimensions to the player scene
  • Loading branch information
thiagopnts authored Jul 20, 2017
2 parents b4151fd + 01628d2 commit ed29537
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit ed29537

Please sign in to comment.