Skip to content

Commit

Permalink
增加比例切换按钮显示隐藏开关
Browse files Browse the repository at this point in the history
  • Loading branch information
BrikerMan committed Sep 13, 2016
1 parent 6deab19 commit f74be3e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
14 changes: 11 additions & 3 deletions BMPlayer/Classes/BMPlayerControlView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class BMPlayerControlView: UIView, BMPlayerCustomControlView {
if BMPlayerConf.slowAndMirror {
self.slowButton.hidden = false
self.mirrorButton.hidden = false

fullScreenButton.snp_remakeConstraints { (make) in
make.width.equalTo(50)
make.height.equalTo(50)
Expand Down Expand Up @@ -153,6 +153,10 @@ class BMPlayerControlView: UIView, BMPlayerCustomControlView {
make.right.equalTo(bottomMaskView.snp_right)
}
}

if !BMPlayerConf.showScaleChangeButton {
ratioButton.hidden = true
}
}

func showPlayToTheEndView() {
Expand Down Expand Up @@ -403,12 +407,16 @@ class BMPlayerControlView: UIView, BMPlayerCustomControlView {
ratioButton.snp_makeConstraints { (make) in
make.right.equalTo(topMaskView.snp_right).offset(-20)
make.top.equalTo(titleLabel.snp_top).offset(-4)
make.width.equalTo(31)
make.width.equalTo(50)
make.height.equalTo(25)
}

chooseDefitionView.snp_makeConstraints { (make) in
make.right.equalTo(ratioButton.snp_left).offset(-10)
if BMPlayerConf.showScaleChangeButton {
make.right.equalTo(ratioButton.snp_left).offset(-10)
} else {
make.right.equalTo(topMaskView.snp_right).offset(-20)
}
make.top.equalTo(titleLabel.snp_top).offset(-4)
make.width.equalTo(60)
make.height.equalTo(30)
Expand Down
3 changes: 3 additions & 0 deletions BMPlayer/Classes/BMPlayerManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ public class BMPlayerManager {
/// 是否显示慢放和镜像按钮
public var slowAndMirror = false

/// 是否显示比例切换按钮
public var showScaleChangeButton = false

/// 是否打印log
public var allowLog = false
/**
Expand Down

0 comments on commit f74be3e

Please sign in to comment.