Skip to content

Release 1.2.0

Latest

Choose a tag to compare

@junil1030 junil1030 released this 15 Jan 09:06

🎬 Video Caching Support

CachingKit 1.2.0부터 비디오 캐싱을 지원합니다.

New Features

Video Caching

  • loadVideo(url:progressHandler:) - 비디오 다운로드 및 디스크 캐싱
    • 진행률 콜백 지원 (0.0~1.0)
    • 중복 요청 방지
    • 캐시된 비디오는 로컬 URL 반환

Thumbnail Generation

  • getThumbnail(videoURL:targetSize:) - 비디오에서 썸네일 추출
    • AVAssetImageGenerator 기반
    • 추출된 썸네일은 이미지 캐시에 저장

SwiftUI Support

  • CachedAsyncVideo - 비디오 캐싱을 지원하는 SwiftUI 뷰
    • 썸네일 표시 → 탭하면 재생 전환
    • 다운로드 진행률 표시
    • 커스텀 content, thumbnail, placeholder 지원

Cache Management

  • clearVideoCache() - 비디오 캐시 삭제
  • 비디오 캐시도 LRU+LFU 하이브리드 eviction 정책 적용 (200MB 제한)

Usage

// 비디오 로드
let localURL = try await CachingKit.shared.loadVideo(
    url: videoURL,
    progressHandler: { print("\\(Int($0 * 100))%") }
)

// SwiftUI
CachedAsyncVideo(url: videoURL, targetSize: CGSize(width: 300, height: 200))