Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ElizaSapir committed Jun 13, 2017
1 parent 11bbdcf commit 466130f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
12 changes: 7 additions & 5 deletions Classes/Player/AVPlayerEngine/AVPlayerEngine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ class AVPlayerEngine: AVPlayer {
"hasProtectedContent"
]

private var playerLayer: AVPlayerLayer
private var _view: PlayerView
fileprivate var playerLayer: AVPlayerLayer!
private var _view: PlayerView!
private var isDestroyed: Bool = false

/// Keeps reference on the last timebase rate in order to post events accuratly.
Expand All @@ -41,8 +41,9 @@ class AVPlayerEngine: AVPlayer {

public var onEventBlock: ((PKEvent) -> Void)?

public var view: PlayerView {
PKLog.debug("get player view: \(_view)")
public var view: PlayerView! {
PKLog.trace("get player view: \(_view)")

return _view
}

Expand Down Expand Up @@ -206,7 +207,8 @@ class AVPlayerEngine: AVPlayer {
DispatchQueue.main.async {
PKLog.info("destroy player")
self.removeObservers()
self._view.removeFromSuperview()
self.playerLayer = nil
self._view = nil
self.onEventBlock = nil
// removes app state observer
AppStateSubject.shared.remove(observer: self)
Expand Down
2 changes: 1 addition & 1 deletion Classes/Player/Player.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import AVKit
@objc var settings: PlayerSettings { get }

/// The player's view component.
@objc var view: PlayerView { get }
@objc var view: PlayerView! { get }

/// The current player position.
@objc var currentTime: TimeInterval { get set }
Expand Down
2 changes: 1 addition & 1 deletion Classes/Player/PlayerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class PlayerController: NSObject, Player, PlayerSettings {
return self.currentPlayer.currentTextTrack
}

public var view: PlayerView {
public var view: PlayerView! {
return self.currentPlayer.view
}

Expand Down
2 changes: 1 addition & 1 deletion Classes/Player/PlayerDecoratorBase.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ import AVKit
return self.player.isPlaying
}

public var view: PlayerView {
public var view: PlayerView! {
return self.player.view
}

Expand Down

0 comments on commit 466130f

Please sign in to comment.