Search code examples
objective-cavplayertvosavplayerlayer

AVPlayer error while playing on tvOS


I'm playing a video on tvOS using the following code:

NSString *filePath = [[NSBundle mainBundle] pathForResource:name ofType:@"mov"];
NSURL *fileUrl = [NSURL fileURLWithPath:filePath];

self.player = [AVPlayer playerWithURL:fileUrl];
AVPlayerLayer *avPlayerLayer = [AVPlayerLayer playerLayerWithPlayer:self.player];

avPlayerLayer.frame = CGRectMake(0, 0, view.frame.size.width, view.frame.size.height);
[view.layer addSublayer:avPlayerLayer];

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(replayMovie:) name:AVPlayerItemDidPlayToEndTimeNotification object:nil];

[self.player play];

But I'm getting the following error

ERROR: >aqme> 718: MEMixerChannel::EnableProcessor: failed to open processor type 0x705f6571

Any ideas how to fix it?


Solution

  • Are you running the app in the simulator or on the Apple TV dev kit?

    For tvOS, most AV related bugs/crashes I've encountered only occur when I'm using the Apple TV simulator - once I run the app on the physical device, they tend to disappear.