커뮤니티 (댓글 / 좋아요 / 시청 기록)
댓글
typescript
// 댓글 작성 (앱 멤버 JWT 필요)
const comment = await cb.video.postComment('video-id', '좋은 영상이네요!')
// 대댓글 — 세 번째 인자로 부모 댓글 ID 전달
await cb.video.postComment('video-id', '동의합니다', comment.id)
// 댓글 목록 조회
const result = await cb.video.getComments('video-id', { limit: 20 })
// 댓글 삭제
await cb.video.deleteComment('comment-id')좋아요
typescript
// 좋아요 (앱 멤버 JWT 필요)
await cb.video.likeVideo('video-id')
// 좋아요 취소 (멱등 — 좋아요가 없으면 no-op)
await cb.video.unlikeVideo('video-id')💡
likeVideo는 토글이라 좋아요가 없으면 추가, 있으면 취소합니다. 명시적으로 취소만 하려면 멱등인unlikeVideo를 쓰세요.
시청 기록
typescript
// 재생 진행 보고 (position/duration: 초)
await cb.video.reportWatchProgress('video-id', 120, 600)
// 시청 기록 조회 (커서 페이지네이션)
const { items, next_cursor } = await cb.video.getWatchHistory({ limit: 20 })
// 시청 기록 전체 삭제
await cb.video.clearWatchHistory()