Playing the video or only audio (adding the option "--no-video") works perfectly. If i start the player with only audio and then enter background the player keeps playing the stream.
The problem i'm having is that if i enter background when video is playing, i want to stop the video and start a new libVLC player with only audio. In that scenario i get this error message:
The code in my appDelegate:ERROR: [0x48e2000] >aurioc> 783: failed: '!int' (enable 2, outf< 2 ch, 48000 Hz, Float32, inter> inf< 2 ch, 0 Hz, Float32, non-inter>)
[1973b5e4] audiounit_ios audio output error: failed to init AudioUnit (560557684)
[1973b5e4] audiounit_ios audio output error: opening AudioUnit output failed
[1973b5e4] core audio output error: module not functional
[17a27e74] core decoder error: failed to create audio output
Code: Select all
- (void)applicationDidEnterBackground:(UIApplication *)application
{
NSLog(@"applicationDidEnterBackground");
if(_playerController!=NULL){
[_playerController performSelector:@selector(goToBackground) withObject:nil afterDelay:1];
_playerController=NULL;
}
}
Code: Select all
-(void)close:(BOOL)enterBackground{
[_mediaPlayer stop];
NSArray* options = @[[NSString stringWithFormat:@"--no-video"]];
_mediaPlayer = [[VLCMediaPlayer alloc] initWithOptions:options];
_mediaPlayer.delegate = self;
_mediaPlayer.drawable = _videoView;
_mediaPlayer.media = [VLCMedia mediaWithURL:[NSURL URLWithString:url]];
[_mediaPlayer play];
}
am i doing anything wrong?