Skip to content

Commit

Permalink
FEM-1603 #comment activate refresh asset & avoid refresh on reachable (
Browse files Browse the repository at this point in the history
…#210)

* FEM-1603 #comment activate refresh asset & avoid refresh on reachable

* minor code style fix
  • Loading branch information
ElizaSapir authored Jul 31, 2017
1 parent 5289e55 commit f7424a9
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions Classes/Player/PlayerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ class PlayerController: NSObject, Player, PlayerSettings {
self.currentPlayer.currentPosition = CMTimeGetSeconds(time)
}



func destroy() {
self.currentPlayer.destroy()
self.removeAssetRefreshObservers()
Expand Down Expand Up @@ -275,7 +273,9 @@ extension PlayerController {
PKLog.warning("network unreachable")
}
reachability.onReachable = { [unowned self] reachability in
self.handleRefreshAsset()
if self.shouldRefresh {
self.handleRefreshAsset()
}
}
}

Expand All @@ -302,9 +302,7 @@ extension PlayerController {
}

private func handleRefreshAsset() {
if self.shouldRefresh {
self.shouldRefresh = false
self.refreshAsset()
}
self.shouldRefresh = false
self.refreshAsset()
}
}

0 comments on commit f7424a9

Please sign in to comment.