Saturday 15 February 2014

Volume level fine on all iOS devices EXCEPT the iPhone 4. On iPhone the level is very low -


I am developing an iOS app that runs on all iOS devices. In my app, I am playing some video files. Everything works fine on all devices except the iPhone 4. On iPhone4, the volume level is very low, though all other apps work with the normal volume level on that device. On all other devices, the volume level is fine. Can anyone help me with this problem? thank you in advanced.

Here is the source code

  NSInteger selected VIDEOTag = sender.tag; NSString * VideoPath = [ForbutanTag for Self-Play Video Playback: Selected VideoTag]; NS URL * Video URL = [[NSURL Alok] initFileURLWithPath: VideoPath]; NSLog (@ "video url =% @", video URL); Self.theMovie = [[MPMoviePlayerController alloc] initWithContentURL: videoUrl]; [[NSNotificationCenter defaultCenter] addObserver: Self Selector: @selector (moviePlaybackComplete :) Name: MPMoviePlayerPlaybackDidFinishNotification Item: self.theMovie]; [[NSNotificationCenter defaultCenter] addObserver: Self Selector: @selector (moviePlaybackStateChaned :) Name: MPMoviePlayerWillExitFullscreenNotification Item: self.theMovie]; [Self.theMovie prepareToPlay]; [Self.theMovie.view Setframe: [[UIScreen main screen] border]]; [Self.view addSubview: self.theMovie.view]; Self.theMovie.controlStyle = MPMVe ControlStyle Default; [Self. MUV set fullscreen: animated yes: yes]; [Self.MO Movie SettingMode: MPMWSklingModeAxpectFill]; Self.theMovie.movieSourceType = MPMovieSourceTypeFile; [Self. Muvi play];   

Here is the code for the getVideoToBePlayedForButtonTag message:

  - (NSString *) getVideoToBePlayedForButtonTag: (NSInteger) btnTag {NSString * videoPath = nil; // Trigger MixPanel Event Mixplug for Selected Buttons * MixPanel = [MixPlan Shared Instance]; Switch (btnTag) {Case 1: videoPath = [[NSBundle mainBundle] pathForResource: @ "song_01" ofType: @ "mp4"]; break; Case 2: videoPath = [[NSBundle mainBundle] pathForResource: @ "song_02" ofType: @ "mp4"]; break; Case 3: VideoPath = [[NSBundle Main Bundle] Pathfinder resource: @ "song_03" type: @ "MP4"]; break; Case 4: videoPath = [[NSBundle mainBundle] pathForResource: @ "song_04" ofType: @ "mp4"]; break; Default: Break; } Return Video Path;   

}

This problem was resolved. In my app, I had to override silent switches, so I added the code to AppDiget.M.

  NSError * categoryError = zero; [[Avidio Session Shared Instance] Set Category: Play Video Session Category and Error Errors: & amp; Category error];   

Due to this category, the iPhone 4 volume output was low. I changed the code to

  [[AvAdio session shared installation] set range: AVAudioSessionCategory playback error: & amp; Category error];   

Now, it works fine though, I still can not understand why the voice output on iPhone 4 was low and no other device like iPad, iPhone 5.

No comments:

Post a Comment