Skip to content

Commit

Permalink
Add PIPKit.isAVPIPKitSupported
Browse files Browse the repository at this point in the history
  • Loading branch information
Kofktu committed Jan 13, 2022
1 parent 3e943db commit 6fc1e68
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion PIPKit/Classes/AVPIPKit/AVPIPKitUsable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@ import Foundation
import UIKit
import AVKit

public extension PIPKit {

static var isAVPIPKitSupported: Bool {
guard #available(iOS 15.0, *) else {
return false
}

return AVPictureInPictureController.isPictureInPictureSupported()
}

}

@available(iOS 15.0, *)
public enum AVPIPKitRenderPolicy {

Expand Down Expand Up @@ -45,7 +57,7 @@ public protocol AVPIPKitUsable {
public extension AVPIPKitUsable {

var isAVKitPIPSupported: Bool {
AVPictureInPictureController.isPictureInPictureSupported()
PIPKit.isAVPIPKitSupported
}

}
Expand Down

0 comments on commit 6fc1e68

Please sign in to comment.