1

I'm using LBYoutubeView to play YouTube videos, and if the phone is on silent or vibrate, the video will not play sound. Is there a way to force it to play sound on the video anyway?

I know you can play a certain audio file, as described here.

Community
  • 1
  • 1
Roy
  • 3,574
  • 2
  • 29
  • 39
  • Don't people set their phones to silent for a reason? – Forty-Two Mar 01 '13 at 20:36
  • @Forty-Two It depends on the intent. One may put their phone on silent to prevent any distractions such as a phone call, text or new mail. But should that rule still apply to operations you made intentionally such as tapping a video to play? I don't think there is a right or wrong answer to your question. – The Muffin Man Mar 01 '13 at 20:43

1 Answers1

4

You need to use the AVAudioSession API to configure the audio playback. The call will look something like:

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:&error];

Make this call before you call the API's that play the audio. This is working for me in an app that plays audio, but not video, so YMMV.

The possible values for the category are described here.

dpassage
  • 5,423
  • 3
  • 25
  • 53