Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
Locked
0

StageVideo on iOS Produces No Sound

Participant ,
Aug 29, 2013 Aug 29, 2013

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:

  • AIR 3.8.0.1280
  • Flex 4.10
  • iOS 6
  • OS X 10.8
  • Flash Builder 4.7
  • Tested 5 different videos, all encoded using h.264 and AAC
  • Streamed from both a remote server and a server set up on my machine, accessed using the local network. Also tried saving it to device (part of the app's functionality) and still had the same issue with local playback
TOPICS
Development
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 30, 2013 Aug 30, 2013

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:

  • This is a longstanding AIR bug (unlikely)
  • There is a problem with my iPad (unlikely)
  • I have something configured wrong with my app

Does anyone have any idea of any setting of compiler configuration that could be causing this? I'm at a loss here.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 30, 2013 Aug 30, 2013

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:

  • I didn't think AIR apps were affected by the mute switch. In fact, I've read several posts saying they weren't. My guess is AIR isn't, but StageVideo, which uses the native video capabilities, is. Honest mistake there
  • My personal iPad uses the mute switch to lock orientation so I forgot that it even worked as a mute switch

Crisis averted. Sorry if this lost anyone any time trying to figure out the problem. I do feel like a complete idiot here.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 30, 2013 Aug 30, 2013

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 30, 2013 Aug 30, 2013

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 04, 2013 Sep 04, 2013
LATEST

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines