incubator-callback-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Git at Apache <>
Subject incubator-cordova-ios pull request: 2 fixes
Date Fri, 11 May 2012 19:17:17 GMT
GitHub user afinlayson opened a pull request:

    2 fixes 

    As I mentioned on here
    I have a fix that opens up CDVSound to allow AVSession category to be set by the app,
not by phonegap. It will however behave the exact same way as it does now for those who don't
    I have also fixed the crash I've been seeing with the camera. It looks like CDVCamera
was being released before the CameraDelegate was done with it. I've created a work around
so the delegate behaves like a retain property instead of an assign.

You can merge this pull request into a Git repository by running:

    $ git pull master

Alternatively you can review and apply these changes as the patch at:

commit 7cd38cb4d7997a2df052aa1513f0df9f4ac446ea
Author: Alex Finlayson <>
Date:   2012-05-11T11:37:43-07:00

    CB-391 fix wasn't solving our issue. We still saw a lot of crashes when taking photos.
    I noticed that CDVCamera wasn't being retained when it was setting the delegate. This
means that when the Camera Delegate was called it would be in the autorelease pool long enough
to call
    - (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info
    but 'self' would be released mid way through the call, meaning it would crash on a call
    [self imageByScalingNotCroppingForSize:image toSize:cameraPicker.targetSize]

commit ac622ef331a33f24983047fc1064ac5536323884
Author: Alex Finlayson <>
Date:   2012-05-11T11:38:32-07:00

    AVInstance is a singleton. This is extremely well designed to allow the app to set the
way the audio is to be heard across the app.
    Overriding it to AVAudioSessionCategoryPlayback, means there is no control over when sounds
should be heard.
    I understand the desire to allow developers to hear sound even if they have the audio
muted, but Apple has been known to reject apps
    that play sound incorrectly (aka playing background music when the mute switch is on).
    Adding it back in as a class method means that at the very least a native developer can
change the avaudiosession as expected.
    I've left the functionality the same, but opened it up to allow an easy way to change
the category.
    I'll look into opening this up from javascript as it becomes necessary.

commit 364edd7158c8701ed8d1535716f10da40e4679ed
Author: Alex Finlayson <>
Date:   2012-05-11T11:51:45-07:00

    I think the original way of having one category will only confuse people trying to record
    This should simplify it, and give control to those who absolutely need it.


View raw message