APAudioPlayer
APAudioPlayer copied to clipboard
.ogg file does not playing
i want to play a sound which i receive from server like an urlString(for exapmple: http://xxx.xxxx:xxxx/audio/chat/5524f5af-6cf4-4d3d-9cdc-ad6c19b55a95.ogg), used this code:
[self.player loadItemWithURL:[NSURL URLWithString:@"http://xxxxxxxxx/audio/chat/5524f5af-6cf4-4d3d-9cdc-ad6c19b55a95.ogg"] autoPlay:true];
But there is no any sound, player doesn't play it, it works only if i place the file to the project directory and open it from there like: NSURL *url = [NSBundle.mainBundle URLForResource:@"sampleOggFile" withExtension:@"ogg"]; [self.player loadItemWithURL: url] autoPlay:true]; So, why is it not playing from the server url? only from project directory? Can some one help me, please?