| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2016 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 780 return; | 780 return; |
| 781 } | 781 } |
| 782 _canPlayOrRecord = canPlayOrRecord; | 782 _canPlayOrRecord = canPlayOrRecord; |
| 783 shouldNotify = YES; | 783 shouldNotify = YES; |
| 784 } | 784 } |
| 785 if (shouldNotify) { | 785 if (shouldNotify) { |
| 786 [self notifyDidChangeCanPlayOrRecord:canPlayOrRecord]; | 786 [self notifyDidChangeCanPlayOrRecord:canPlayOrRecord]; |
| 787 } | 787 } |
| 788 } | 788 } |
| 789 | 789 |
| 790 - (void)audioSessionDidActivate:(AVAudioSession *)session { |
| 791 if (_session != session) { |
| 792 RTCLogError(@"audioSessionDidActivate called on different AVAudioSession"); |
| 793 } |
| 794 [self incrementActivationCount]; |
| 795 self.isActive = YES; |
| 796 } |
| 797 |
| 798 - (void)audioSessionDidDeactivate:(AVAudioSession *)session { |
| 799 if (_session != session) { |
| 800 RTCLogError(@"audioSessionDidDeactivate called on different AVAudioSession")
; |
| 801 } |
| 802 self.isActive = NO; |
| 803 [self decrementActivationCount]; |
| 804 } |
| 805 |
| 790 - (void)notifyDidBeginInterruption { | 806 - (void)notifyDidBeginInterruption { |
| 791 for (auto delegate : self.delegates) { | 807 for (auto delegate : self.delegates) { |
| 792 SEL sel = @selector(audioSessionDidBeginInterruption:); | 808 SEL sel = @selector(audioSessionDidBeginInterruption:); |
| 793 if ([delegate respondsToSelector:sel]) { | 809 if ([delegate respondsToSelector:sel]) { |
| 794 [delegate audioSessionDidBeginInterruption:self]; | 810 [delegate audioSessionDidBeginInterruption:self]; |
| 795 } | 811 } |
| 796 } | 812 } |
| 797 } | 813 } |
| 798 | 814 |
| 799 - (void)notifyDidEndInterruptionWithShouldResumeSession: | 815 - (void)notifyDidEndInterruptionWithShouldResumeSession: |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 858 - (void)notifyDidStopPlayOrRecord { | 874 - (void)notifyDidStopPlayOrRecord { |
| 859 for (auto delegate : self.delegates) { | 875 for (auto delegate : self.delegates) { |
| 860 SEL sel = @selector(audioSessionDidStopPlayOrRecord:); | 876 SEL sel = @selector(audioSessionDidStopPlayOrRecord:); |
| 861 if ([delegate respondsToSelector:sel]) { | 877 if ([delegate respondsToSelector:sel]) { |
| 862 [delegate audioSessionDidStopPlayOrRecord:self]; | 878 [delegate audioSessionDidStopPlayOrRecord:self]; |
| 863 } | 879 } |
| 864 } | 880 } |
| 865 } | 881 } |
| 866 | 882 |
| 867 @end | 883 @end |
| OLD | NEW |