Changeset 5171


Ignore:
Timestamp:
Aug 27, 2015 2:23:55 AM (9 years ago)
Author:
ming
Message:

Re #1882 (misc): In iOS, set the option to notify other apps upon audio session deactivation. This will be useful so other apps can return to active state and resume its audio.

Thanks to Johan Lantz for the patch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia-audiodev/coreaudio_dev.m

    r5142 r5171  
    20832083#if !COREAUDIO_MAC 
    20842084    if (should_deactivate) { 
    2085         if ([stream->sess setActive:false error:nil] != YES) { 
    2086             PJ_LOG(4, (THIS_FILE, "Warning: cannot deactivate audio session")); 
     2085        if ([stream->sess  
     2086             respondsToSelector:@selector(setActive:withOptions:error:)]) 
     2087        { 
     2088            [stream->sess setActive:NO 
     2089            withOptions:AVAudioSessionSetActiveOptionNotifyOthersOnDeactivation  
     2090            error:nil]; 
     2091        } else { 
     2092            if ([stream->sess setActive:NO error:nil] != YES) { 
     2093                PJ_LOG(4, (THIS_FILE, "Warning: cannot deactivate " 
     2094                                      "audio session")); 
     2095            } 
    20872096        } 
    20882097    } 
Note: See TracChangeset for help on using the changeset viewer.