Skip to content
This repository was archived by the owner on Jul 20, 2023. It is now read-only.
Open
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
18 changes: 15 additions & 3 deletions Source/Jukebox.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@ extension Jukebox {
player.seek(to: CMTimeMake(Int64(second), 1))
item.update()
if shouldPlay {
player.play()
if #available(iOS 10.0, *) {
player?.playImmediately(atRate: 1.0)
} else {
player?.play()
}
if state != .playing {
state = .playing
}
Expand Down Expand Up @@ -354,7 +358,11 @@ open class Jukebox: NSObject, JukeboxItemDelegate {
if state != .playing {
startProgressTimer()
if let player = player {
player.play()
if #available(iOS 10.0, *) {
player?.playImmediately(atRate: 1.0)
} else {
player?.play()
}
} else {
currentItem!.refreshPlayerItem(withAsset: currentItem!.playerItem!.asset)
startNewPlayer(forItem: currentItem!.playerItem!)
Expand Down Expand Up @@ -473,7 +481,11 @@ open class Jukebox: NSObject, JukeboxItemDelegate {

func handleStall() {
player?.pause()
player?.play()
if #available(iOS 10.0, *) {
player?.playImmediately(atRate: 1.0)
} else {
player?.play()
}
}

func playerItemDidPlayToEnd(_ notification : Notification){
Expand Down