0

so i have my simple code of my radio app:

 -(IBAction)europaPlus:(id)sender{

        NSLog(@"EuropaPlus work");

        if (clicked ==  0) {

            clicked = 1;

            NSString *urlAddress = @"http://cast.europaplus.ua/europaplus.aac";

            NSURL *urlStream = [NSURL URLWithString:urlAddress];

            radioPlus = [[AVPlayer alloc] initWithURL:urlStream];

            [radioPlus play];}

        else {

            NSLog(@"EuropaPlus not work");

            [radioPlus release];

            clicked = 0;

        }
}

Also i used AVPLAYER only for URL connect but how make volume control for AVPlayer in MAC OS. I know about MPMVolumeControl in IOS but i have mac os project.Thanks.

Dilip Manek
  • 9,095
  • 5
  • 44
  • 56
Evgenii Melnik
  • 69
  • 2
  • 14

1 Answers1

0
player = [[AVAudioPlayer alloc] initWithContentsOfURL:
          [NSURL fileURLWithPath:resourcePath] error:&err];
player.delegate = self;
[player play];
player.volume=.number;
player.numberOfLoops=-number;

-(IBAction)slidervaluechanged {

     player.volume=slider.value; 

}

for more info check the links :

http://developer.apple.com/iphone/library/documentation/MediaPlayer/Reference/MPVolumeView_Class/Reference/Reference.html and How do you implement an MPVolumeView?

Community
  • 1
  • 1
Motaz Dev
  • 90
  • 5