OTT 특화 기능
인트로/오프닝/엔딩 스킵 버튼, 연령 고지, 콘텐츠 경고 등 OTT 서비스에 필요한 기능을 playlist 아이템 메타로 선언합니다.
스킵 구간 (intro / opening / ending)
해당 구간을 재생 중이면 우상단에 건너뛰기 버튼이 자동 노출되고, 탭하면 구간 끝으로 seek 합니다. start 는 "HH:MM:SS" 또는 "MM:SS", duration 은 초 단위입니다.
options = mapOf(
"playlist" to listOf(mapOf(
"file" to "https://.../master.m3u8",
"intro" to mapOf("start" to "00:05", "duration" to 15),
"opening" to mapOf("start" to "00:30", "duration" to 20),
"ending" to mapOf("start" to "09:30", "duration" to 30)
))
)연령 고지 / 콘텐츠 경고
ageRating 과 contentWarnings 를 지정하면 재생 시작 3초 후 좌상단에 고지 배너가 1회 노출됩니다. 문구는 i18n 으로 자동 번역됩니다.
options = mapOf(
"playlist" to listOf(mapOf(
"file" to "https://.../master.m3u8",
"ageRating" to "15", // "all" / "12" / "15" / "19"
"contentWarnings" to listOf("violence", "horror")
))
)다음 / 이전 콘텐츠
재생목록을 여러 아이템으로 구성하면 컨트롤러 메서드로 다음/이전 콘텐츠를 전환할 수 있습니다.
controller.loadPlaylist(items, startIndex = 0)
controller.playNext()
controller.playPrevious()
// 관찰: state.playIndex / state.currentItem / state.canPlayNext