2

Hi all i'm trying to add video on a scene I can hear it but not see it, any ideas what i'm doing wrong?

my setup is:

import AVFoundation/AVFoundation.h

added AVFoundation library

-(void)didMoveToView:(SKView *)view {

    fileURL = [NSURL fileURLWithPath: [[NSBundle mainBundle] pathForResource:@"bait" ofType:@"m4v"]];
    NSLog(@"FileName %@",fileURL.path);
    AVPlayer* _player = [AVPlayer playerWithURL: fileURL];

   SKVideoNode* _videoNode = [[SKVideoNode alloc] initWithAVPlayer:_player];
    _videoNode.size = CGSizeMake(self.frame.size.width,self.frame.size.height);
    NSLog(@"SKVideoNode W:%f H:%f",_videoNode.size.width,_videoNode.size.height);
    _videoNode.position = CGPointMake(self.frame.size.width/2.0f,self.frame.size.height/2.0f);
    _videoNode.zPosition = 1000;

    [self addChild:_videoNode];

    _player.volume = 0.5;
    [_videoNode play];
}
StackBuddy
  • 577
  • 5
  • 17
  • Annoyingly I find that its not playing on the simulator - but on the device its working fine >< but would be nice to have it working on both. – StackBuddy Mar 18 '16 at 09:38
  • Have you done a clean and build in Xcode? That and a fresh install to the simulator may help... – Gliderman Mar 19 '16 at 22:00

0 Answers0