9

I'm trying to control the volume of an AVPlayer in my iPhone app. I seem to receive an "unrecognized selector sent to instance" error when trying to simply get the volume value, or even set it, from the AVPlayer.Volume property -

AVPlayer myAVPlayer = new AVPlayer();
var volume = myAVPlayer.Volume;

Any ideas how to make this work?

Goober
  • 13,146
  • 50
  • 126
  • 195

1 Answers1

2

That's likely because you're using an older device (or simulator) version of iOS. The Volume property was added in iOS7.

There are other ways to set the volume - but you'll need to tell us more about what you're trying to accomplish.

Community
  • 1
  • 1
poupou
  • 43,413
  • 6
  • 77
  • 174
  • Ah yes, you're correct. I'm running iOS6 and want to be able to support my app from iOS6 onwards. Ultimately i'm trying to code something that does fade in and fade out volume. Any suggestions on how to do this in iOS6? Thanks. – Goober Dec 04 '13 at 18:39
  • @Goober I added a link to an (older) API that can control the volume - but without a more detailed **question** it's hard to give the precise answer so YMMV. – poupou Dec 17 '13 at 01:53