getCurrentChapter
getCurrentChapter
():Promise
<object, Error>
현재 챕터 반환
현재 챕터란?
현재 재생 위치(
currentTime
)가 아래의 범주에 속한다면 해당 챕터에 속해있다고 할 수 있음.if( 마지막 챕터가 아니라면 ) 챕터 범주 : 해당 챕터 startTime ~ 다음 챕터 startTime else 해당 챕터 startTime ~ 영상 종료 시간
chapter object 구조
{ "startTime": 15, "title": "Chapter Title", "index": 1 }
함수 예시
player.getCurrentChapter().then(function(chapter) { // chapter = a chapter object }).catch(function(error) { // an error occurred });