getPlayed

Column
promise
array
Tags
재생된 시간 범위 배열 반환 (played 된 영역 목록 반환)

getPlayed

getPlayed(): Promise<array, Error>
재생된 시간 범위 반환 (Get the played time ranges of the video.)

코드 예시

player.getPlayed().then((played)=>{ // played = array values of the played video time ranges. }).catch(function(error) { // an error occurred });
 

반환 예시

예시1

notion image
  1. 0~10초까지 듣고 pause
  1. 다시 재개해서 26초까지 들은 경우
    1. ⇒ 임의의 지점으로 seeking 하지 않고 그자리에서 누적해서 들은 경우에는 하나의 range가 갱신됨.
notion image

예시2

notion image
  1. 0~26초까지 들은 상태에서
  1. 임의로 위치를 48초로 옮긴 뒤 60초까지 들은 경우
    1. ⇒ 0~26초 까지 들었고, 48~60초까지가 실제로 플레이 한 영역임. 이대로 반환해줌.
notion image
 

한계

봤던 부분을 또 보는 경우 별도로 누적시간이 체크되진 않음.
⇒ 임의의 지점으로 여러번 seek 하면서 왔다갔다 한 경우 영상을 100% 다 채우려면 안들은 곳을 알아야함..-_-;;