addCuePoint
addCuePoint
(time
: number,data
: object):Promise
<string, (UnsupportedError|RangeError|Error)>
플레이어에 큐포인트를 추가한다.
currentTime
이 큐포인트 지정 시간을 넘어가면 cuepoint 이벤트
가 발생된다.참고: 큐 포인트는 10분의 1초 이내로 정확해야 하지만, 정밀도는 브라우저나 환경에 따라 달라질 수 있다.
params
time
: 큐포인트 추가할 시간data
: cuepoint 이벤트
핸들러 함수에서 사용하기 위한 커스텀 값 전달.반환값
큐포인트id
: 추가된 큐포인트의 id
를 반환한다.함수 예시
player.addCuePoint(15, { customKey: 'customValue' }).then(function(id) { // 큐포인트 추가 완료 시 }).catch(function(error) { switch (error.name) { case 'UnsupportedError': // 현재 플레이어 혹은 브라우저에서 큐포인트 지원안함. break; case 'RangeError': // 시간 지정 에러. (0보다 작거나 영상끝 보다 크게 적은 경우) break; default: // some other error occurred break; } });