Ignore hardware mute switch during video playback in attachment approval view.

// FREEBIE
This commit is contained in:
Matthew Chen 2017-04-13 14:35:31 -04:00
parent d9ef27d802
commit bf9ae552a3
2 changed files with 15 additions and 2 deletions

View File

@ -26,6 +26,7 @@
#import "UIFont+OWS.h"
#import "UIUtil.h"
#import "UIView+OWS.h"
#import "ViewControllerUtils.h"
#import <JSQSystemSoundPlayer.h>
#import <PureLayout/PureLayout.h>
#import <SignalServiceKit/Contact.h>

View File

@ -43,14 +43,26 @@ class AttachmentApprovalViewController: UIViewController {
view.backgroundColor = UIColor.black
self.navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem:.stop,
target:self,
action:#selector(donePressed))
target:self,
action:#selector(donePressed))
self.navigationItem.title = NSLocalizedString("ATTACHMENT_APPROVAL_DIALOG_TITLE",
comment: "Title for the 'attachment approval' dialog.")
createViews()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillDisappear(animated)
ViewControllerUtils.setAudioIgnoresHardwareMuteSwitch(true)
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
ViewControllerUtils.setAudioIgnoresHardwareMuteSwitch(false)
}
// MARK: - Create Views
private func createViews() {