Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

nil value fixed #107

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
8 changes: 8 additions & 0 deletions Jukebox.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
10 changes: 8 additions & 2 deletions Source/Jukebox.swift
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,9 @@ open class Jukebox: NSObject, JukeboxItemDelegate {
if let player = player {
player.play()
} else {
currentItem!.refreshPlayerItem(withAsset: currentItem!.playerItem!.asset)
startNewPlayer(forItem: currentItem!.playerItem!)
guard let currentItem = currentItem else { return }
currentItem.refreshPlayerItem(withAsset: currentItem.playerItem!.asset)
startNewPlayer(forItem: currentItem.playerItem!)
}
state = .playing
}
Expand All @@ -377,6 +378,11 @@ open class Jukebox: NSObject, JukeboxItemDelegate {
invalidatePlayback(shouldResetIndex: false)
player = AVPlayer(playerItem: item)
player?.allowsExternalPlayback = false

if #available(iOS 10.0, *) {
player?.automaticallyWaitsToMinimizeStalling = false
}

startProgressTimer()
seek(toSecond: 0, shouldPlay: true)
updateInfoCenter()
Expand Down