Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AVPlayer error while playing on tvOS

Tags:

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?

like image 366
Wojtek Avatar asked Sep 29 '15 12:09

Wojtek


2 Answers

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.

like image 70
HGDev Avatar answered Sep 18 '22 10:09

HGDev


I'm getting a video to load and play locally on the simulator. I wrote it in Swift but you should be able to translate it fairly easy.

    if let path = NSBundle.mainBundle().pathForResource("4", ofType:"mp4") {
        let url = NSURL(fileURLWithPath: path)
        let videoPlayer = AVPlayer(URL: url)
        let playerLayer = AVPlayerLayer(player: videoPlayer)
        playerLayer.frame = self.view.frame
        self.view.layer.addSublayer(playerLayer)
        videoPlayer.play()
    }

Make sure fileUrl is not nil and try removing code that is not needed (like the notification-part) so we can deduce which part is failing.

I'm using Xcode 7.1beta3.

like image 25
ABeanSits Avatar answered Sep 21 '22 10:09

ABeanSits