| | |
| | | |
| | | let PlantGuideQuit_Noti = Notification.Name.init(rawValue: "PlantGuideQuit_Noti") |
| | | |
| | | let backgroundVoiceUrl = "https://xqgwzh.obs.cn-south-1.myhuaweicloud.com/question/backgroundQuestion.wav" |
| | | |
| | | class PlanGuideVC: BaseVC { |
| | | |
| | | @IBOutlet weak var view_gradient: UIView! |
| | |
| | | @IBOutlet weak var label_subTitle: UILabel! |
| | | @IBOutlet weak var label_info: UILabel! |
| | | @IBOutlet weak var btn_custom: UIButton! |
| | | |
| | | private let masterPlayer = AudioPlayer.getSharedInstance() |
| | | |
| | | private lazy var player:AVPlayer = { |
| | | let bgPath = Bundle.main.url(forResource: "bg_movie", withExtension: "mov") |
| | |
| | | |
| | | override func viewDidLoad() { |
| | | super.viewDidLoad() |
| | | |
| | | masterPlayer.playBGMAt(firstPlayIndex: 0, model: MeditationModel(backgroundUrl:backgroundVoiceUrl), delegate: self) |
| | | } |
| | | |
| | | override func viewWillAppear(_ animated: Bool) { |
| | |
| | | self?.player.play() |
| | | } |
| | | |
| | | NotificationCenter.default.rx.notification(PlantGuideQuit_Noti).take(until: self.rx.deallocated).subscribe(onNext: {data in |
| | | NotificationCenter.default.rx.notification(PlantGuideQuit_Noti).take(until: self.rx.deallocated).subscribe(onNext: {[weak self]data in |
| | | if data.object as? Bool == true{ |
| | | |
| | | } |
| | | self.dismiss(animated: true) |
| | | self?.dismiss(animated: true) |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @IBAction func customAction(_ sender: UIButton) { |
| | | PlanGuidePromptView.show { type in |
| | | PlanGuidePromptView.show {[weak self] type in |
| | | switch type { |
| | | case .seeOther: |
| | | let vc = PlanGuide_1_VC() |
| | | self.jq_push(vc: vc) |
| | | self?.jq_push(vc: vc) |
| | | case .toSeting: |
| | | self.dismiss(animated: true) { |
| | | self?.dismiss(animated: true) { |
| | | let vc = BackgroundVoiceVC() |
| | | vc.hidesBottomBarWhenPushed = true |
| | | JQ_currentNavigationController().pushViewController(vc) |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | deinit{ |
| | | masterPlayer.clean() |
| | | } |
| | | } |
| | | |
| | | extension PlanGuideVC:PayMusicDelegate{ |
| | | func playState(_ state: PlayMusicState) { |
| | | |
| | | } |
| | | |
| | | } |