| | |
| | | private var tempPlayer:AVPlayer? |
| | | private var isPlaying:Bool = false |
| | | private var needPopRoot = false |
| | | private var isFromFist = false |
| | | |
| | | override func viewDidDisappear(_ animated: Bool) { |
| | | super.viewDidDisappear(animated) |
| | | audioPlayer.playScene() |
| | | if audioPlayer.meditationModel != nil{ |
| | | // audioPlayer.masterPlayer?.play() |
| | | // audioPlayer.bgmPlayer?.play() |
| | | }else{ |
| | | audioPlayer.playScene() |
| | | } |
| | | } |
| | | |
| | | override func viewDidAppear(_ animated: Bool) { |
| | | super.viewDidAppear(animated) |
| | | audioPlayer.pauseScene() |
| | | if audioPlayer.meditationModel != nil{ |
| | | audioPlayer.masterPlayer?.pause() |
| | | audioPlayer.bgmPlayer?.pause() |
| | | PayMusicVC.updateStatus(.pause) |
| | | } |
| | | } |
| | | |
| | | init(isFromFist:Bool){ |
| | | super.init(nibName: nil, bundle: nil) |
| | | self.isFromFist = isFromFist |
| | | } |
| | | |
| | | required init?(coder: NSCoder) { |
| | | fatalError("init(coder:) has not been implemented") |
| | | } |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | title = "心泉·疗愈" |
| | | title = "泉疗愈" |
| | | |
| | | yy_popBlock = { [weak self] in |
| | | if self?.needPopRoot ?? false{ |
| | |
| | | settingModel?.bgm = items[index.row] |
| | | settingModel?.volume = Double(slider_voice.value) |
| | | UserDefaultSettingViewModel.saveSetting(settingModel!) |
| | | audioPlayer.playSceneAt(items[index.row].audioFile) |
| | | alertSuccess(msg: "设置成功") |
| | | |
| | | if isFromFist{ |
| | | NotificationCenter.default.post(name: PlantGuideQuit_Noti, object: items[index.row]) |
| | | return |
| | | } |
| | | |
| | | needPopRoot = true |
| | | NotificationCenter.default.post(name: SetBGMSuccess_Noti, object: items[index.row]) |
| | | DispatchQueue.main.asyncAfter(delay: 0.6) { |