We have an SKVideoNode
that we're adding to an SKScene
in a SpriteKit game, and the mp4 video plays just fine maybe 90% of the time, 10% of the time it just renders transparent video with the audio playing just fine.
What I mean by transparent, is that this video sits overtop of our game board, and when it glitches out, the game can be seen in plain sight below, though nothing is responsive because the video node is positioned over top of everything blocking user interaction. The audio from the video still plays fine so i know its trying to play.
Its totally inconsistent. The video plays fine for the most part, but what seems like 10% of the time, it just doesn't render any video content to the node, only the audio.
We are seeing this in all versions of iOS.
Our node code:
NSURL *fileURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"intro" ofType:@"mp4"]];
AVPlayer* player = [AVPlayer playerWithURL:fileURL];
SKVideoNode* introVideoNode = [[SKVideoNode alloc] initWithAVPlayer:player];
introVideoNode.size = CGSizeMake(self.frame.size.width,self.frame.size.height);
introVideoNode.position = CGPointMake(CGRectGetMidX(self.frame), CGRectGetMidY(self.frame));
introVideoNode.name = @"introVideo";
// this video plays over top of many other SKSpriteNodes
introVideoNode.zPosition = 8000;
[self addChild:introVideoNode];
[introVideoNode play];
Thoughts?