Skip to content

Commit

Permalink
add error call to delegate following #172
Browse files Browse the repository at this point in the history
  • Loading branch information
addbrick committed Apr 3, 2018
1 parent 17039f3 commit bcdd882
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Sources/Player.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ public enum BufferingState: Int, CustomStringConvertible {
/// Player delegate protocol
public protocol PlayerDelegate: NSObjectProtocol {
func playerReady(_ player: Player)
func playerPlaybackError(_ player: Player, error: NSError?)
func playerPlaybackStateDidChange(_ player: Player)
func playerBufferingStateDidChange(_ player: Player)

Expand Down Expand Up @@ -516,6 +517,7 @@ extension Player {
var error: NSError? = nil
let status = self._asset?.statusOfValue(forKey: key, error:&error)
if status == .failed {
self.playerDelegate?.playerPlaybackError(self, error: error)
self.playbackState = .failed
return
}
Expand Down

0 comments on commit bcdd882

Please sign in to comment.