--- title: "iOS Environment" slug: "vpe-ios" updated: 2026-09-17T09:22:36Z published: 2026-09-17T09:22:36Z canonical: "guide.ncloud-docs.com/vpe-ios" stale: true --- > ## Documentation Index > Fetch the complete documentation index at: https://guide.ncloud-docs.com/llms.txt > Use this file to discover all available pages before exploring further. # iOS Environment Available in Classic and VPC Describes how to use Video Player Enhancement iOS SDK for Android players and apply players and setting options in the iOS environment. Note To use the Video Player Enhancement SDK for iOS, you must use the Standard pricing plan, which requires the following specifications: - Minimum requirement: iOS 14.0 or later - Development environment: Xcode ## Install SDK and configure environment The following describes how to install the SDK and add the framework: 1. In the NAVER Cloud Platform console, navigate to **Menu** > **All Services** > **Media** > **Video Player Enhancement**. 2. Click the **Video Player Management** menu. 3. Click the **[SDK Address]** button for the player to download the SDK in the player’s list. 4. Click the **[IOS]** button in **Downloading mobile native SDKs**. - The zipped files will be downloaded. 5. Click the **Targets > General** menu for the project you want to add after running Xcode. 6. In **Framework, Libraries, and Embedded Content**, add "NCPlayerSDK.xcframework" as **Embed & Sign** type. ## Apply and set the player To apply a player and set options, proceed with the following steps: - [1. Reset](/docs/en/vpe-ios#1%EC%B4%88%EA%B8%B0%ED%99%94) - [2. Player settings](/docs/en/vpe-ios#2%ED%94%8C%EB%A0%88%EC%9D%B4%EC%96%B4%EC%84%A4%EC%A0%95) - [3. Event settings](/docs/en/vpe-ios#3%EC%9D%B4%EB%B2%A4%ED%8A%B8%EC%84%A4%EC%A0%95) ### 1. Reset You should initialize the NCPlayerSDK instance and set Delegate as follows: ``` import NCPlayerSDK ... class ViewController: UIViewController, NCPlayerDelegate{ ... override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) NCPlayer.shared.delegate = self } } ``` ### 2. Player settings The following describes how to set up the player: 1. In the NAVER Cloud Platform console, navigate to **Menu** > **All Services** > **Media** > **Video Player Enhancement**. 2. Click the **Video Player Management** menu. 3. Click the **[SDK address]** button on the player you want to set up. 4. When the Player SDK address prompt appears, view the access_key value in the **SDK address**. ![vpe-ios_key_ko](https://cdn.document360.io/6998976f-9d95-4df8-b847-d375892b92c2/Images/Documentation/vpe-ios_key_en.png?sv=2026-02-06&spr=https&st=2026-11-14T05%3A05%3A05Z&se=2026-11-14T06%3A05%3A05Z&sr=c&sp=r&sig=CaG2TWEJ4p7SkcsL73gr5rfviBKhePOYaOqRELyhFto%3D) 5. In the Xcode, create Class and UIView that refers the NCPlayerView. 6. Set options for the player. ``` class player:NCPlayerView{} class ViewController: UIViewController, NCPlayerDelegate { @IBOutlet weak var playerView: player? } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) // Reset SDK //licenseKey = access_key let licenseKey = "{access_key}" // Player option (use script code made in the console) let playerOptions = """ { "playlist":[ { "file":"https://CDNdomain/example_video_01.mp4", "poster":"https://CDNdomain/example_video_01.png", } ], "autostart":true, } """ NCPlayer.shared.initialize(licenseKey: licenseKey) NCPlayer.shared.delegate = self // Run playerView?.play(playerOptions) } ``` - See [Player settings](/docs/en/vpe-web#%ED%94%8C%EB%A0%88%EC%9D%B4%EC%96%B4%EC%84%A4%EC%A0%95) and configuration script in this guide. ### 3. Event settings With the Player Event API, you can bind and utilize events that occur in the Video Player Enhancement player. The following describes how to do: 1. Check the network status of a device using the `NCPlayerNetworkStatus` method. ``` import NCPlayerSDK ... class ViewController: UIViewController, NCPlayerDelegate{ ... func NCPlayerNetworkStatus(state: String) { // state: satisfied = no problem (ONLINE) // state: unsatisfied = a problem occurs (OFFLINE or Communication failure occurs) // state: requiresConnection = Currently not available, use when connected to the Internet } } ``` 2. Check out how to set up the event you want to set up. - [Horizontal mode activation event](/docs/en/vpe-ios#%EA%B0%80%EB%A1%9C%EB%AA%A8%EB%93%9C%ED%99%9C%EC%84%B1%ED%99%94%EC%9D%B4%EB%B2%A4%ED%8A%B8) - [Screen capture detection event (for iOS)](/docs/en/vpe-ios#%EC%8A%A4%ED%81%AC%EB%A6%B0%EC%BA%A1%EC%B2%98%EA%B0%90%EC%A7%80%EC%9D%B4%EB%B2%A4%ED%8A%B8iOS%EC%A0%84%EC%9A%A9) - [OS Screen recording detection event (for iOS)](/docs/en/vpe-ios#OS%ED%99%94%EB%A9%B4%EB%85%B9%ED%99%94%EA%B0%90%EC%A7%80%EC%9D%B4%EB%B2%A4%ED%8A%B8iOS%EC%A0%84%EC%9A%A9) - [TimeUpdate event](/docs/en/vpe-ios#TimeUpdate%EC%9D%B4%EB%B2%A4%ED%8A%B8) - [PrevTrack event](/docs/en/vpe-ios#PrevTrack%EC%9D%B4%EB%B2%A4%ED%8A%B8) - [NextTrack event](/docs/en/vpe-ios#NextTrack%EC%9D%B4%EB%B2%A4%ED%8A%B8) - [Control bar activation event](/docs/en/vpe-ios#%EC%BB%A8%ED%8A%B8%EB%A1%A4%EB%B0%94%ED%99%9C%EC%84%B1%ED%99%94%EC%9D%B4%EB%B2%A4%ED%8A%B8) - [Playback event](/docs/en/vpe-ios#%EC%9E%AC%EC%83%9D%EC%9D%B4%EB%B2%A4%ED%8A%B8) - [Temporary pause event](/docs/en/vpe-ios#%EC%9D%BC%EC%8B%9C%EC%A0%95%EC%A7%80%EC%9D%B4%EB%B2%A4%ED%8A%B8) - [Playback completion event](/docs/en/vpe-ios#%EC%9E%AC%EC%83%9D%EC%99%84%EB%A3%8C%EC%9D%B4%EB%B2%A4%ED%8A%B8) - [Full screen event](/docs/en/vpe-ios#%EC%A0%84%EC%B2%B4%ED%99%94%EB%A9%B4%EC%9D%B4%EB%B2%A4%ED%8A%B8) #### Horizontal mode activation event To trigger an event when the device is switched to horizontal, use the `NCPlayerIsLandscape` method to set as follows: ``` import NCPlayerSDK ... class ViewController: UIViewController, NCPlayerDelegate{ ... func NCPlayerIsLandscape(state: Bool) { } } ``` #### Screen capture detection event (for iOS) To trigger an event when capturing screen, use the `NCPlayerIsCaptured` method to set as follows: ``` import NCPlayerSDK ... class ViewController: UIViewController, NCPlayerDelegate{ ... func NCPlayerIsCaptured(state: Bool) { } } ``` #### OS Screen recording detection event (for iOS) To trigger an event when recording screen, use the `NCPlayerIsRecording` method to set as follows: ``` import NCPlayerSDK ... class ViewController: UIViewController, NCPlayerDelegate{ ... func NCPlayerIsRecording(state: Bool) { } } ``` #### TimeUpdate event To trigger an event when detecting changes in playback time, use the `NCPlayerOnTimeUpdate` method to set as follows: ``` import NCPlayerSDK ... class ViewController: UIViewController, NCPlayerDelegate{ ... func NCPlayerOnTimeUpdate(data: Dictionary?) { //data = ["duration": 117, "percent": 31.26565391099825, "viewingTime": 37, "currentTime": 37, "sourceType": vod] } } ``` Note For more information about each property, see [timeupdate scipt](/docs/en/vpe-web#timeupdate%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8). #### PrevTrack event To trigger an event when you move to the previous video in the playlist, use the `NCPlayerOnPrevTrack` method to set as follows: ``` import NCPlayerSDK ... class ViewController: UIViewController, NCPlayerDelegate{ ... func NCPlayerOnPrevTrack(data: Dictionary?) { } } ``` Note For more information about each property, see [prevTrack script](/docs/en/vpe-web#prevTrack%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8). #### NextTrack event To trigger an event when you move to the next video in the playlist, use the `NCPlayerOnNextTrack` method to set as follows: ``` import NCPlayerSDK ... class ViewController: UIViewController, NCPlayerDelegate{ ... func NCPlayerOnNextTrack(data: Dictionary?) { } } ``` Note For more information about each property, see [nextTrack script](/docs/en/vpe-web#nextTrack%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8). #### Control bar activation event To trigger an event when you enable/disable control bar in a player, use the `NCPlayerOnControlbarActive` method to set as follows: ``` import NCPlayerSDK ... class ViewController: UIViewController, NCPlayerDelegate{ ... func NCPlayerOnControlbarActive(active: Bool) { // active: true , false } } ``` #### Playback event To trigger an event when playing a video in the player, use the `NCPlayerOnPlay` method to set as follows: ``` import NCPlayerSDK ... class ViewController: UIViewController, NCPlayerDelegate{ ... func NCPlayerOnPlay() { } } ``` #### Temporary pause event To trigger an event when pausing a video in the player, use the `NCPlayerOnPause` method to set as follows: ``` import NCPlayerSDK ... class ViewController: UIViewController, NCPlayerDelegate{ ... func NCPlayerOnPause() { } } ``` #### Playback completion event To trigger an event when a video is played completely in the player, use the `NCPlayerOnEnd` method to set as follows: ``` import NCPlayerSDK ... class ViewController: UIViewController, NCPlayerDelegate{ ... func NCPlayerOnEnd() { } } ``` #### Full screen event By enabling full screen, you can trigger an event and switch to full screen based on device rotation direction. To trigger an event when enabling full screen for a player, use the `NCPlayerOnFullscreen` method to set as follows: ``` import NCPlayerSDK ... class ViewController: UIViewController, NCPlayerDelegate{ ... // Event that occurs when full screen is off func NCPlayerOnFullscreenOff() { } // Event that occurs when full screen is on func NCPlayerOnFullscreenOn() { } // Classify true/false when full screen in on func NCPlayerOnFullscreen(state: Bool?) { } } ``` To enable full screen after detecting a button or device rotation direction, use the `NCPlayerRequestOrientation` method to set as follows: ``` import NCPlayerSDK ... class ViewController: UIViewController, NCPlayerDelegate{ var currentOrientationMask: UIInterfaceOrientationMask = .portrait var currentOrientation: UIInterfaceOrientation = .portrait // Switch to full screen when horizontally rotating and return when vertically rotated func NCPlayerRequestOrientation(orientation: String) { if (orientation == "landscape") { currentOrientationMask = .landscape currentOrientation = .landscapeRight } else { currentOrientationMask = .portrait currentOrientation = .portrait } applyOrientation(orientation: currentOrientation) } override var supportedInterfaceOrientations: UIInterfaceOrientationMask { return currentOrientationMask; } override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation { return currentOrientation; } override var prefersStatusBarHidden: Bool { return currentOrientation.isLandscape } } extension NSLayoutConstraint { func applyAspectRatio(view: UIView, ratio: CGFloat) -> NSLayoutConstraint { let newConstraint = NSLayoutConstraint(item: self.firstItem!, attribute: self.firstAttribute, relatedBy: self.relation, toItem: self.secondItem, attribute: self.secondAttribute, multiplier: ratio, constant: self.constant) view.removeConstraint(self) view.addConstraint(newConstraint) view.layoutIfNeeded() return newConstraint } } } ``` To enable full screen after detecting device rotation direction, use the `NCPlayerIsLandscape` method to set as follows: ``` import NCPlayerSDK ... class ViewController: UIViewController, NCPlayerDelegate{ var currentOrientationMask: UIInterfaceOrientationMask = .portrait var currentOrientation: UIInterfaceOrientation = .portrait func NCPlayerIsLandscape(state: Bool) { if state { currentOrientationMask = .landscape currentOrientation = UIDevice.current.orientation == .landscapeLeft ? .landscapeRight : .landscapeLeft }else{ currentOrientationMask = .portrait currentOrientation = .portrait } applyOrientation(orientation: currentOrientation) } override var supportedInterfaceOrientations: UIInterfaceOrientationMask { return currentOrientationMask; } override var preferredInterfaceOrientationForPresentation: UIInterfaceOrientation { return currentOrientation; } override var prefersStatusBarHidden: Bool { return currentOrientation.isLandscape } } extension NSLayoutConstraint { func applyAspectRatio(view: UIView, ratio: CGFloat) -> NSLayoutConstraint { let newConstraint = NSLayoutConstraint(item: self.firstItem!, attribute: self.firstAttribute, relatedBy: self.relation, toItem: self.secondItem, attribute: self.secondAttribute, multiplier: ratio, constant: self.constant) view.removeConstraint(self) view.addConstraint(newConstraint) view.layoutIfNeeded() return newConstraint } } } ```