---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://ads.yandex.com/helpcenter/en/dev/ios7/video-control.md
  - https://ads.yandex.com/helpcenter/ru/dev/ios7/video-control.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ads.yandex.com/helpcenter/ru/llms.txt

<!--
Используется в Boost: boost/ru/ad-monetization/dev/ios
-->

# Переопределение элементов интерфейса в видео

SDK предоставляет возможность переопределить контролы (элементы интерфейса, с помощью которых пользователь взаимодействует с системой):

- прогресса видео (`VideoProgress`);
- включения и выключения звука в видео (изменение внешнего вида и расположения).

## 1. Переопределение для VideoProgress {#video-progress}

```swift
class CustomVideoProgressControl: UIProgressView, NativeVideoPlaybackProgressControl {
    
    /// Configures a progress control with position and duration.
    /// - Parameters:
    ///   - position: Position of current OutStream ad.
    ///   - duration: Duration of current OutStream ad.
    func configure(withPosition position: TimeInterval, duration: TimeInterval) {
    }
    
    /// Resets a video progress.
    func reset() {
    }
}
```

## 2. Переопределение для кнопки включения/выключения звука {#video-playback}

```swift
class CustomVideoPlaybackMuteControl: UIButton, NativeVideoPlaybackMuteControl {
    /// Delegate is notified about video playback mute control events.
    var delegate: NativeVideoPlaybackMuteControlDelegate?
    
    /// Configures a mute control with specified isMuted flag.
    /// - Parameter isMuted: Flag for setting mute/unmute state.
    func configure(withIsMuted isMuted: Bool) {
    }
    
    /// Configures a mute control with specified isHidden flag.
    /// - Parameter isHidden: Flag for setting mute/unmute state.
    func configure(withIsHidden isHidden: Bool) {
    }
}
```

## 3. Создание и привязка объекта с контролами

1. После переопределений создайте объект.

   ```swift
   let customVideoPlaybackControls = NativeVideoPlaybackControls(
       CustomVideoProgressControl(),
       CustomVideoPlaybackMuteControl()
   )
   ```
2. Свяжите созданный объект с `YMANativeMediaView`.
   
   ```swift
   customVideoPlaybackControls.setupVideoPlaybackControls(to: YMANativeMediaView)
   ```
