1

I got several reports that the sound of videos which are played in an iPhone app is not playing anymore. I was not able to reproduce that problem on my iPhone though. Obvious solution, like "mute" turned on where already considered. The sound is playing well on other apps, e.g. youtube.

The devices are running iOS 5.0.1 and the videos are delivered through an .m3u8 file which contains references to several other .m3u8 files which contain references to .ts video files. This was not my invention, so if this is the source of the problem, I am open to other suggestions for streaming videos. Unfortunately, I am neither very knowledgable about streaming videos or video formats.

Any suggestions that might shed some light on the situation are very much appreciated.

Mark
  • 3,389
  • 2
  • 28
  • 52
  • Have you tried on the Simulator? And another device? I didn't notice any issues with `iOS 5.x` and audio playback (though I'm using `AVFoundation` where you may be using lower level libs). –  Mar 09 '12 at 12:38
  • Yes, I am using the MPMoviePlayerController for video playback. – Mark Mar 09 '12 at 12:47
  • That's *really* odd, then. My only guess is it's a weird special audio encoding which the decoder shouldn't have ever supported to begin with. Do you have a differently-encoded test video you can plug into it (like [Big Buck Bunny](http://www.bigbuckbunny.org/index.php/download/))? –  Mar 09 '12 at 12:53
  • Pluggin in another video would be difficult but possible. Actually which formats would you recommend? The construction with the .m3u8 files seems exotic for me but I am not a video streaming expert. I came later to this project when these decisions were already made. – Mark Mar 09 '12 at 13:05
  • Grab the iPhone version of that test video, or if you want to try re-encoding your own give the people responsible for that [these](https://developer.apple.com/library/ios/technotes/tn2224/_index.html#//apple_ref/doc/uid/DTS40009745-CH1-SETTINGSFILES) specifications. –  Mar 09 '12 at 13:08
  • Thank you, I will dive into that ;). – Mark Mar 09 '12 at 13:19

2 Answers2

4

I finally found the answer to this Question in this thread:

http://forums.macrumors.com/showthread.php?t=1247982

It doesn't have to do anything with the video encoding or may app. It is a problem with the "rotation lock" switch that can also be used as a "mute" switch. Quote:

If you select "Use Side Switch to:" lock rotation when previously it was set to Mute, and your side switch was in the mute position when you switch the toggle from mute to rotation, it thinks that it's still on mute.

Anyways, the solution is just to flip the switch to the unmute position, go into settings and select "Use side switch to: MUTE" (then switch it back to lock rotation if you'd like, BUT don't play w/ the side toggle while doing so).

Strangely, it can lead to some apps muted while others still have sound. Probably the apps that were running in the background while the setting was changed but I didn't confirm that.

Mark
  • 3,389
  • 2
  • 28
  • 52
0

try this:

AudioSessionInitialize(NULL, NULL, NULL, NULL);
UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback;
AudioSessionSetProperty(kAudioSessionProperty_AudioCategory,sizeof(sessionCategory),       &sessionCategory);
AudioSessionSetActive(YES);

from https://stackoverflow.com/a/3124786/2123361

explanation: http://developer.apple.com/library/ios/#documentation/Audio/Conceptual/AudioSessionProgrammingGuide/AudioSessionCategories/AudioSessionCategories.html

Community
  • 1
  • 1
Or Arbel
  • 2,965
  • 2
  • 30
  • 40