youtube / youtube-ios-player-helper

Lightweight helper library that allows iOS developers to add inline playback of YouTube videos through a WebView
Other
1.65k stars 683 forks source link

There is no audio when video is played while ringer is silent on iPhone. #285

Open siddharthsuneel opened 7 years ago

siddharthsuneel commented 7 years ago

I have used pod 'youtube-iso-player-helper' to integrate YTPlayer within my native iOS application. The issue I am facing is I am not able hear any sound while video is being played when the iPhone that has ringer silent & it works fine with earphone but does not work on iPhone speakers.

Note: I have not muted the iPhone volume, it's only ringer silent.

jimspeth commented 7 years ago

Try adding this to your application delegate on launch:

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

Since this is a global setting, you should confirm that any third-party frameworks you use do not set a different value.

siddharthsuneel commented 7 years ago

Done, it worked. Thanks @jimspeth