-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(player): add API to use a native view
- Loading branch information
1 parent
768da01
commit e2b85db
Showing
2 changed files
with
80 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
Sources/ApiVideoPlayer/Extensions/AVPlayerViewController+extensions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import AVKit | ||
import Foundation | ||
|
||
#if !os(macOS) | ||
public extension AVPlayerViewController { | ||
/// Sets the player controller to use for this AVPlayerViewController. | ||
func setApiVideoPlayerController(_ controller: ApiVideoPlayerController) { | ||
player = controller.player | ||
} | ||
} | ||
#endif |