동영상에서 인터페이스 요소 재정의
SDK를 통해 시스템과 상호작용하기 위한 인터페이스 요소를 재정의할 수 있습니다. 특히 여기에는 다음에 대한 요소가 포함됩니다.
- 동영상 진행 제어(
VideoProgress
); - 동영상 소리 켜기/끄기(디자인 및 위치 변경).
1. VideoProgress 재정의
class CustomVideoProgressControl: UIProgressView, NativeVideoPlaybackProgressControl {
/// 위치 및 기간으로 진행 제어를 구성합니다.
/// - 매개 변수:
/// - 위치: 현재 OutStream 광고의 위치.
/// - 기간: 현재 OutStream 광고의 기간.
func configure(withPosition position: TimeInterval, duration: TimeInterval) {
}
/// 동영상 진행을 재설정합니다.
func reset() {
}
}
2. 소리 켜기/끄기 버튼 재정의
class CustomVideoPlaybackMuteControl: UIButton, NativeVideoPlaybackMuteControl {
/// 대리인은 동영상 재생 음소거 제어 이벤트에 대한 알림을 받습니다.
var delegate: NativeVideoPlaybackMuteControlDelegate?
/// 지정된 isMuted 플래그로 음소거 제어를 구성합니다.
/// - 매개 변수 isMuted: 음소거/음소거 해제 상태 설정 플래그.
func configure(withIsMuted isMuted: Bool) {
}
/// 지정된 isHidden 플래그로 음소거 제어를 구성합니다.
/// - 매개 변수 isHidden: 음소거/음소거 해제 상태 설정 플래그.
func configure(withIsHidden isHidden: Bool) {
}
}
3. 제어가 있는 객체 생성 및 연결
-
재정의가 완료되면 객체를 생성하세요.
let customVideoPlaybackControls = NativeVideoPlaybackControls( CustomVideoProgressControl(), CustomVideoPlaybackMuteControl() )
-
객체를
YMANativeMediaView
에 연결하세요.customVideoPlaybackControls.setupVideoPlaybackControls(to: YMANativeMediaView)
Was the article helpful?
Previous