Skip to content

Commit

Permalink
Merge pull request #178 from MangoMade/master
Browse files Browse the repository at this point in the history
fix bug of control view dismissing when played to the end
  • Loading branch information
BrikerMan authored Nov 7, 2017
2 parents c5bf08b + ff80fc3 commit 1555a1b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Source/BMPlayerControlView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ open class BMPlayerControlView: UIView {
playButton.isSelected = false
showPlayToTheEndView()
controlViewAnimation(isShow: true)
cancelAutoFadeOutAnimation()

default:
break
Expand Down Expand Up @@ -208,7 +207,9 @@ open class BMPlayerControlView: UIView {
open func autoFadeOutControlViewWithAnimation() {
cancelAutoFadeOutAnimation()
delayItem = DispatchWorkItem { [weak self] in
self?.controlViewAnimation(isShow: false)
if self?.playerLastState != .playedToTheEnd {
self?.controlViewAnimation(isShow: false)
}
}
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + BMPlayerConf.animateDelayTimeInterval,
execute: delayItem!)
Expand Down
2 changes: 1 addition & 1 deletion Source/BMPlayerLayerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ open class BMPlayerLayerView: UIView {
fileprivate var playerLayer: AVPlayerLayer?
/// 音量滑杆
fileprivate var volumeViewSlider: UISlider!
/// 播发器的几种状态
/// 播放器的几种状态
fileprivate var state = BMPlayerState.notSetURL {
didSet {
if state != oldValue {
Expand Down
1 change: 1 addition & 0 deletions Source/CacheSupport/BMPlayerManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ open class BMPlayerManager {
open var enableBrightnessGestures = true
open var enableVolumeGestures = true
open var enablePlaytimeGestures = true
open var enableChooseDefinition = true

open var cacheManeger = VIResourceLoaderManager()

Expand Down

0 comments on commit 1555a1b

Please sign in to comment.