Copy link to clipboard
Copied
I'm building an AIR for Mobile VOD application. This is the third time I've done this now and it's gone fairly smooth, until I got to testing out of the AIR emulator.
I am testing on an iPad 3/4 (unsure which, but it has a retina display) and iOS 6.x. I can playback the video just fine, but I get no sound. When using the iOS Simulator, I get the opposite on both iOS 6 and 7 (sound without video).
I'm using StageVideo and everything works fine in the simulator and on Android. The video also plays back just fine in Safari. StageWebView is not an option because the app requires custom player controls (I had originally planned on using it until I got revised designs from my designer).
Here is the load function:
public function load( url:String 😞void {
trace( url );
this._url = url;
if ( this.isSupported ) {
this.stop();
this.sv = stage.stageVideos[0];
if ( !this.ns ) {
nc = new NetConnection();
nc.connect(null);
ns = new NetStream(nc);
ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
ns.client= this;
}
ns.play(url);
this.sv.attachNetStream( ns );
this.resizeHandler( null );
}
}
Again, everything works perfectly in Android, desktop, and iOS Safari. Just not in-app on iOS. I've tried both GPU and Direct rendering modes and they made no difference. Is this a bug in AIR 3.8? Should I downgrade?
Build specs:
Copy link to clipboard
Copied
As an update, I have tested it on AIR 3.6 and AIR 3.7 as well as Flex 4.9 with both of them and I still get no sound. So that means one of the following:
Does anyone have any idea of any setting of compiler configuration that could be causing this? I'm at a loss here.
Copy link to clipboard
Copied
Okay, so I am a complete idiot. I have been troubleshooting this for a few hours now and of course the mute switch was on. I didn't even think about it for two reasons:
Crisis averted. Sorry if this lost anyone any time trying to figure out the problem. I do feel like a complete idiot here.
Copy link to clipboard
Copied
There is a setting you can use to honor the mute switch:
SoundMixer.audioPlaybackMode = AudioPlaybackMode.AMBIENT;
If you haven’t done that, then the mute switch shouldn’t be used.
The general case with iOS is that video doesn’t honor the switch, but all other app sounds do. If you were playing video with StageWebView, the audio might well have been heard.
Copy link to clipboard
Copied
I didn't have that set and it still obeyed the mute switch. I tried all three settings available in the AudioPlaybackMode class and they all obeyed the mute switch. Regardless, good to know of the setting. Thanks
Copy link to clipboard
Copied
We had a problem with StageVideo on some iPad 2s where the audio wouldn't be audible until you played another sound first (i.e. a beep). The exact same code worked on iPad1 and iPad3 with no problems. So now for our video apps we just play a silent sound on startup and this seems to get everything warmed up enough to subsequently work ok.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now