Updated the Videos sample app to cover the API changes

This commit is contained in:
Gareth Reese
2016-03-01 13:06:29 +00:00
parent f9c8c043a1
commit 6318db45c8
2 changed files with 7 additions and 9 deletions

View File

@@ -47,6 +47,8 @@
//TODO: Have a bash at supplying a preview image node so that we're deferring the construction of the video as it eats memory at the moment
// [[[[playerItem tracks] objectAtIndex:0] assetTrack] asset]
//TODO: URL file videos don't seem to repeat
#pragma mark - Construction and Layout
- (instancetype)initWithURL:(NSURL*)url

View File

@@ -33,9 +33,8 @@
- (ASVideoNode *)guitarVideo;
{
ASVideoNode *videoNode = [[ASVideoNode alloc] init];
videoNode.asset = [AVAsset assetWithURL:[NSURL URLWithString:@"https://files.parsetfss.com/8a8a3b0c-619e-4e4d-b1d5-1b5ba9bf2b42/tfss-3045b261-7e93-4492-b7e5-5d6358376c9f-editedLiveAndDie.mov"]];
AVAsset* asset = [AVAsset assetWithURL:[NSURL URLWithString:@"https://files.parsetfss.com/8a8a3b0c-619e-4e4d-b1d5-1b5ba9bf2b42/tfss-3045b261-7e93-4492-b7e5-5d6358376c9f-editedLiveAndDie.mov"]];
ASVideoNode *videoNode = [[ASVideoNode alloc] initWithAsset:asset];
videoNode.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height/3);
@@ -48,12 +47,11 @@
- (ASVideoNode *)nicCageVideo;
{
ASVideoNode *nicCageVideo = [[ASVideoNode alloc] init];
AVAsset* asset = [AVAsset assetWithURL:[NSURL URLWithString:@"https://files.parsetfss.com/8a8a3b0c-619e-4e4d-b1d5-1b5ba9bf2b42/tfss-753fe655-86bb-46da-89b7-aa59c60e49c0-niccage.mp4"]];
ASVideoNode *nicCageVideo = [[ASVideoNode alloc] initWithAsset:asset];
nicCageVideo.delegate = self;
nicCageVideo.asset = [AVAsset assetWithURL:[NSURL URLWithString:@"https://files.parsetfss.com/8a8a3b0c-619e-4e4d-b1d5-1b5ba9bf2b42/tfss-753fe655-86bb-46da-89b7-aa59c60e49c0-niccage.mp4"]];
nicCageVideo.frame = CGRectMake([UIScreen mainScreen].bounds.size.width/2, [UIScreen mainScreen].bounds.size.height/3, [UIScreen mainScreen].bounds.size.width/2, [UIScreen mainScreen].bounds.size.height/3);
nicCageVideo.gravity = AVLayerVideoGravityResize;
@@ -68,10 +66,8 @@
- (ASVideoNode *)simonVideo;
{
ASVideoNode *simonVideo = [[ASVideoNode alloc] init];
NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"simon" ofType:@"mp4"]];
simonVideo.asset = [AVAsset assetWithURL:url];
ASVideoNode *simonVideo = [[ASVideoNode alloc] initWithURL:url];
simonVideo.frame = CGRectMake(0, [UIScreen mainScreen].bounds.size.height - ([UIScreen mainScreen].bounds.size.height/3), [UIScreen mainScreen].bounds.size.width/2, [UIScreen mainScreen].bounds.size.height/3);