ios - AVAudioPlayer Doesn't play the songs inside the folders? -


i used code play songs not playing songs inside folders or folders of folders except documents directory.

nsstring *songname=[nsstring stringwithformat:@"%@",songarray[songindex]]; nslog(@"songname:%@",songname);  nsstring* savefilename = songname;  nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; nsstring *path = [documentsdirectory stringbyappendingpathcomponent:savefilename]; nsurl *url = [[nsurl alloc] initfileurlwithpath: path]; self.audioplayer=[[avaudioplayer alloc] initwithcontentsofurl:url error:null]; 

nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; nsstring *path = [documentsdirectory stringbyappendingpathcomponent:@"github.mp4"]; nsurl *url1 = [[nsurl alloc] initfileurlwithpath: path]; avplayer = [avplayer playerwithurl:url1] ; [self.avplayer play]; 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -