Skip to content

Commit

Permalink
Merge pull request #25 from skiptomyliu/2018-12-20-hotfix
Browse files Browse the repository at this point in the history
hotfix for transitions
  • Loading branch information
skiptomyliu authored Dec 21, 2018
2 parents 1bc5280 + 979ef64 commit 81fd27b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 3 deletions.
Binary file modified App/Milkshake.dmg
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion Milkshake/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>1.0.5</string>
<key>CFBundleVersion</key>
<string>27</string>
<string>28</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.music</string>
<key>LSMinimumSystemVersion</key>
Expand Down
4 changes: 3 additions & 1 deletion Milkshake/Music.swift
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ class Music: NSObject {
print("Music - URL: ", url)
item.duration = Int(length)
self.curPlayingItem = item
self.removeTimeObserver()
DispatchQueue.main.sync {
self.removeTimeObserver()
}
DispatchQueue.main.async {
self._playAudio(playerItem: playerItem)
}
Expand Down
2 changes: 1 addition & 1 deletion Milkshake/PlayerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class PlayerViewController: NSViewController, MusicTimeProtocol {
self.updateSliderTime(duration: duration, totalTime: totalTime)
let timeLeft = totalTime - duration

if (timeLeft <= 10 && timeLeft > 0 && appDelegate.music?.crossFade == true) {
if (timeLeft <= 10 && appDelegate.music?.crossFade == true && appDelegate.music?.timeObserverToken != nil) {
appDelegate.music?.removeTimeObserver()
appDelegate.music?.playNext()
}
Expand Down

0 comments on commit 81fd27b

Please sign in to comment.