Link to home
Create AccountLog in
Avatar of Bruce Gust
Bruce GustFlag for United States of America

asked on

Why can you not hear any sound when this video is played?

Head out to http://www.countryshowdown.com/iphone/video_player.php?id=6. This page is being played in the context of a UI Webview. It looks great, but there's no sound and I can find no good reason, from a programming standpoint, why there's no volume.

What am I missing?
SOLUTION
Avatar of stathisx
stathisx
Flag of Greece image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
ASKER CERTIFIED SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Bruce Gust

ASKER

I see what you're seeing and I'm hearing what you're hearing when you are viewing it in the context of a iPhone / Safari session. But when I attempt to watch / hear the same video in the context of a UIWebview, I get the picture, but no sound.

I'm using iPhone 6.0.1

What do you think?

I just found something, but I don't know how to implement the fix.

Here's the code that I need to introduce:

#import <AVFoundation/AVFoundation.h>

AVAudioSession *audioSession = [AVAudioSession sharedInstance];
BOOL ok;
NSError *setCategoryError = nil;
ok = [audioSession setCategory:AVAudioSessionCategoryPlayback
                         error:&setCategoryError];
if (!ok) {
  NSLog(@"%s setCategoryError=%@", __PRETTY_FUNCTION__, setCategoryError);
}

Here's the URL where this is revealed: http://stackoverflow.com/questions/11616001/uiwebview-html5-audio-pauses-in-ios-6-when-app-enters-background

How do I introduce this into my code?
Mute button was on. "Hello, morons, your bus is leaving...!"
"Hello, morons, your bus is leaving...!"  

Thank you.  Ask me how I knew to check this :)

.... Thinkpads_User