Home cannot play music file on iOS 11
Reply: 0

cannot play music file on iOS 11

Kevin
1#
Kevin Published in 2017-12-07 20:43:36Z

I want to play a music file on my app. I have tried to use AVAudioPlayer, but it doesn't work on Xcode 9.0.

NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"background" ofType:@"mp3"]];

AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:nil];
[player play];
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.300439 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO