재생 설정

자동 재생, 음소거, 화면비, 반복, 백그라운드 동작 등 재생 관련 옵션을 설정하는 방법입니다. 모든 옵션은 옵션 Map/JSON 최상위 키로 전달합니다.

기본 재생 옵션

VpePlayer(
    accessKey = "YOUR_ACCESS_KEY",
    options = mapOf(
        "autostart" to true,          // 자동 재생
        "muted" to true,              // 음소거 시작 (autostart 시 권장)
        "aspectRatio" to "16:9",      // "16:9" / "16/9" / "1.78" / "9:16"(세로)
        "objectFit" to "contain",     // contain·cover·fill·stretch·scale-down
        "repeat" to true,             // 반복 재생
        "playIndex" to 0,             // 시작 재생목록 인덱스
        "startTime" to 30,            // 시작 위치(초)
        "playlist" to listOf(mapOf("file" to "https://.../master.m3u8"))
    )
)
음소거 시작muted 는 서버 옵션으로도 지정될 수 있습니다(머지 우선순위: 로컬 > 서버 > 기본). 시작 시 state.muted 및 컨트롤바 음소거 아이콘에 반영되며, 음소거 버튼 탭 1회 또는 setMuted(false) 로 해제합니다.

백그라운드 / PiP 동작

기본설명
allowsPictureInPicturetruetrue 면 홈/백그라운드 시 자동 PiP 진입
staysActiveInBackgroundfalse백그라운드 / PiP 재생 유지
autoPausefalse백그라운드 진입 시 자동 일시정지
enableNowPlayingPlaybackStatetrueMediaSession + 잠금화면 미디어 알림

전체화면 / PiP / Now Playing 상세 동작은 전체화면 / PiP 페이지를 참고하세요.

화면 녹화 방지

screenRecordingPrevention 을 켜면 SDK 가 Activity 윈도우에 FLAG_SECURE 를 설정해 스크린샷·녹화·미러링을 차단합니다.

options = mapOf(
    "screenRecordingPrevention" to true,
    "playlist" to listOf(mapOf("file" to "https://.../master.m3u8"))
)

컨트롤바 / 진행바

기본설명
controlstrue내장 컨트롤바 표시
controlActiveTime3000컨트롤 자동 숨김 시간(ms)
progressBarColor진행바 색상(hex)
touchGesturestrue좌/우 더블탭 ±10초 누적 스킵 + 길게 눌러 1.5배속
seekingPreviewtrueSeekBar 프리뷰

전체 옵션 목록은 옵션 레퍼런스 를 참고하세요.

Android SDKBeta