> For the complete documentation index, see [llms.txt](https://adpopcornssp.gitbook.io/ssp-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://adpopcornssp.gitbook.io/ssp-sdk/sdk/ios/ios-3.1.0+/undefined-5.md).

# 전면비디오광고

<figure><img src="/files/4uON9pniNLszMs49YyXM" alt="" width="214"><figcaption></figcaption></figure>

## 인스턴스 생성

{% tabs %}
{% tab title="Swift" %}

```swift
import APSSPSDK

var interstitialVideoAd: APSSPInterstitialVideoAd!

interstitialVideoAd = APSSPInterstitialVideoAd(
    appKey: "YOUR_APP_KEY",
    placementId: "YOUR_PLACEMENT_ID",
    rootViewController: self
)
interstitialVideoAd.delegate = self
```

{% endtab %}

{% tab title="Objective-C" %}

```objc
@import APSSPSDK;

APSSPInterstitialVideoAd *interstitialVideoAd = [[APSSPInterstitialVideoAd alloc] initWithAppKey:@"YOUR_APP_KEY"
                                                                                      placementId:@"YOUR_PLACEMENT_ID"
                                                                               rootViewController:self];
interstitialVideoAd.delegate = self;
```

{% endtab %}
{% endtabs %}

## 전면 비디오 광고 요청

{% tabs %}
{% tab title="Swift" %}

```swift
interstitialVideoAd.load()
```

{% endtab %}

{% tab title="Objective-C" %}

```objc
[interstitialVideoAd load];
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
loadAd 호출에 대한 결과로 광고 수신에 실패한 경우에는 loadAd 재호출을 하시면 안됩니다. \
**과도한 광고 요청 API 호출은 block 사유**가 됩니다.
{% endhint %}

## 전면 비디오 광고 노출

{% tabs %}
{% tab title="Swift" %}

```swift
interstitialVideoAd.present(from: self)
```

{% endtab %}

{% tab title="Objective-C" %}

```objc
[interstitialVideoAd presentFrom:self];
```

{% endtab %}
{% endtabs %}

## 전면 비디오 광고 중단

{% tabs %}
{% tab title="Swift" %}

```swift
interstitialVideoAd.stopAd()
```

{% endtab %}

{% tab title="Objective-C" %}

```objc
[interstitialVideoAd stopAd];
```

{% endtab %}
{% endtabs %}

## 이벤트 리스너

| 이벤트 리스너                               | 설명           |
| ------------------------------------- | ------------ |
| `apsspInterstitialVideoAdLoadSuccess` | 비디오 광고 로딩 성공 |
| `apsspInterstitialVideoAdLoadFail`    | 비디오 광고 로딩 실패 |
| `apsspInterstitialVideoAdShowSuccess` | 비디오 광고 노출 성공 |
| `apsspInterstitialVideoAdShowFail`    | 비디오 광고 노출 실패 |
| `apsspInterstitialVideoAdClicked`     | 비디오 광고 클릭    |
| `apsspInterstitialVideoAdClosed`      | 비디오 광고 닫기    |

{% tabs %}
{% tab title="Swift" %}

```swift
extension ViewController: APSSPInterstitialVideoAdDelegate {

    func apsspInterstitialVideoAdLoadSuccess(interstitialVideoAd: APSSPInterstitialVideoAd) {
        interstitialVideoAd.present(from: self)
    }

    func apsspInterstitialVideoAdLoadFail(interstitialVideoAd: APSSPInterstitialVideoAd, error: APSSPNetworkError) {
    }

    func apsspInterstitialVideoAdShowSuccess(interstitialVideoAd: APSSPInterstitialVideoAd) {
    }

    func apsspInterstitialVideoAdShowFail(interstitialVideoAd: APSSPInterstitialVideoAd, error: APSSPNetworkError) {
    }

    func apsspInterstitialVideoAdClicked(interstitialVideoAd: APSSPInterstitialVideoAd) {
    }

    func apsspInterstitialVideoAdClosed(interstitialVideoAd: APSSPInterstitialVideoAd) {
    }
}
```

{% endtab %}

{% tab title="Objective-C" %}

```objc
- (void)apsspInterstitialVideoAdLoadSuccessWithInterstitialVideoAd:(APSSPInterstitialVideoAd *)interstitialVideoAd {
    [interstitialVideoAd presentFrom:self];
}

- (void)apsspInterstitialVideoAdLoadFailWithInterstitialVideoAd:(APSSPInterstitialVideoAd *)interstitialVideoAd error:(enum APSSPNetworkError)error {
}

- (void)apsspInterstitialVideoAdShowSuccessWithInterstitialVideoAd:(APSSPInterstitialVideoAd *)interstitialVideoAd {
}

- (void)apsspInterstitialVideoAdShowFailWithInterstitialVideoAd:(APSSPInterstitialVideoAd *)interstitialVideoAd error:(enum APSSPNetworkError)error {
}

- (void)apsspInterstitialVideoAdClickedWithInterstitialVideoAd:(APSSPInterstitialVideoAd *)interstitialVideoAd {
}

- (void)apsspInterstitialVideoAdClosedWithInterstitialVideoAd:(APSSPInterstitialVideoAd *)interstitialVideoAd {
}
```

{% endtab %}
{% endtabs %}
