| | |
| | | |
| | | var playUrl:String? |
| | | var listenType:ListenType? |
| | | private var playAtClouse:((Int)->Void)? |
| | | |
| | | override init(frame: CGRect) { |
| | | super.init(frame: frame) |
| | |
| | | fatalError("init(coder:) has not been implemented") |
| | | } |
| | | |
| | | func copyView()->VoiceHandleView{ |
| | | let copyView = VoiceHandleView() |
| | | copyView.listenType = self.listenType |
| | | copyView.playUrl = self.playUrl |
| | | copyView.frame = self.frame |
| | | return copyView |
| | | } |
| | | |
| | | func resetView(){ |
| | | img_hint.isHidden = false |
| | | btn_play.isHidden = false |
| | | img_hint_playing.isHidden = true |
| | | } |
| | | |
| | | func playing(){ |
| | | img_hint.isHidden = true |
| | | btn_play.isHidden = true |
| | | img_hint_playing.isHidden = false |
| | | } |
| | | |
| | | func playAt(_ clouse:@escaping(Int)->Void){ |
| | | self.playAtClouse = clouse |
| | | } |
| | | |
| | | @objc func playingAction(){ |
| | | if let url = playUrl{ |
| | | playAtClouse?(self.tag) |
| | | VoicePlayer.share().playerAt(url: url) |
| | | img_hint.isHidden = true |
| | | btn_play.isHidden = true |
| | | img_hint_playing.isHidden = false |
| | | playing() |
| | | } |
| | | } |
| | | |