APAudioPlayer icon indicating copy to clipboard operation
APAudioPlayer copied to clipboard

.ogg file does not playing

Open aparandiy opened this issue 4 years ago • 0 comments

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?

aparandiy avatar Aug 06 '20 10:08 aparandiy