|
@@ -32,6 +32,8 @@ class BFChooseMusicView: UIView {
|
|
|
// 音乐类别
|
|
|
var categories = [PQStuckPointMusicTagsModel]()
|
|
|
|
|
|
+ var musicVolume = 0.2
|
|
|
+
|
|
|
// 选中的音乐
|
|
|
var chosedMusic : PQVoiceModel?
|
|
|
|
|
@@ -162,10 +164,13 @@ class BFChooseMusicView: UIView {
|
|
|
|
|
|
slidV.frame = CGRect(x: soundIV.rightX + 20, y: soundIV.y+5, width: cScreenWidth - soundIV.rightX - 20 - 18, height: 18)
|
|
|
addSubview(slidV)
|
|
|
-
|
|
|
+ slidV.value = 0.2
|
|
|
+
|
|
|
progressL.frame = CGRect(x: slidV.x - 7, y: slidV.y - 24, width: 36, height: 16)
|
|
|
addSubview(progressL)
|
|
|
|
|
|
+ valuChange(slid: slidV)
|
|
|
+
|
|
|
loadedTimeRangesObserver = player.observe(\AVPlayer.currentItem?.loadedTimeRanges, options: [.new, .initial]) { [weak self] (player, change) in
|
|
|
|
|
|
DispatchQueue.main.async {[weak self] in
|
|
@@ -273,6 +278,8 @@ class BFChooseMusicView: UIView {
|
|
|
var frame = progressL.frame
|
|
|
frame.origin.x = slidV.x - 7 + ((slidV.width - 28) / 100.0) * CGFloat(num)
|
|
|
progressL.frame = frame
|
|
|
+ musicVolume = Double(num) / 100.0
|
|
|
+ player.volume = Float(musicVolume)
|
|
|
}
|
|
|
|
|
|
func configCategoriesView(){
|
|
@@ -318,6 +325,7 @@ extension BFChooseMusicView:UITableViewDelegate, UITableViewDataSource {
|
|
|
cell.selectionStyle = .none
|
|
|
cell.cutCallBack = {[weak self, weak cell] in
|
|
|
guard let wself = self else { return }
|
|
|
+ wself.player.pause()
|
|
|
if let data = cell?.data {
|
|
|
wself.cutActionCallback?(data)
|
|
|
}
|