iOS 에서 HLS 와 DASH 를 지원하는 비디오를 재생해보며 스트리밍 프로토콜의 동작 원리를 학습한 기록입니다. AVPlayer 를 사용하며 플레이어 설정 및 제어부터 HLS 와 DASH 이해까지 다루었습니다.
AVPlayer설정 및 재생 제어 그리고 상태 관리
- Blog: [iOS] AVFoundation, AVKit 이해 그리고 AVPlayer 다뤄보기
- Github: https://github.com/sangjin-hash/VideoStreamingPlayer/tree/AVPlayer
.m3u8파일 톺아보기 + 비디오 세그먼트를 받아와AVPlayer에 재생해보기
- Custom scheme을 이용한
AVAssetResourceLoaderDelegate활용하기
- Blog: [iOS] AVPlayer 의 Custom ResourceLoader
- Github: https://github.com/sangjin-hash/VideoStreamingPlayer/tree/AVAssetResourceLoader
.mpd파일 톺아보기 + 가상의 HLS 플레이리스트로 변환하여AVPlayer에서 재생해보기
추후에 업데이트되는 내용이 있을 때 추가할 계획입니다.
ToyVideoStreamingPlayer/
├── App/
│ ├── AppDelegate.swift
│ └── SceneDelegate.swift
├── Player/
│ ├── VideoPlayerViewController.swift
│ ├── HLSResourceLoaderDelegate.swift
│ ├── DASHResourceLoaderDelegate.swift
│ ├── Models/
│ │ ├── PlaybackState.swift
│ │ ├── HLS/
│ │ │ ├── Master/ (HLSMasterPlaylist, HLSStreamInfo, HLSMediaInfo)
│ │ │ └── Media/ (HLSMediaPlaylist)
│ │ └── DASH/ (DASHMPD)
│ └── Views/
│ └── PlayerView.swift
├── Managers/
│ ├── StreamPlayerManager.swift
│ └── HLSDownloadManager.swift
└── Utilities/
├── HLSParser.swift
└── DASHParser.swift
Player/Models: HLS/DASH 매니페스트 및 재생 상태 모델Player/Views: 렌더링 레이어 (AVPlayerLayer)Player: ResourceLoaderDelegate, VideoPlayerViewControllerManagers: 스트리밍 재생 및 다운로드 관리Utilities: HLS/DASH 파서
[Apple Docs]
- https://developer.apple.com/documentation/avfoundation
- https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/00_Introduction.html#//apple_ref/doc/uid/TP40010188-CH1-SW3
- https://developer.apple.com/documentation/avfoundation/avplayer
- https://developer.apple.com/documentation/http-live-streaming
- https://developer.apple.com/documentation/avfoundation/avassetresourceloaderdelegate
[Docs]
- https://en.wikipedia.org/wiki/Dynamic_Adaptive_Streaming_over_HTTP
- https://www.cloudflare.com/ko-kr/learning/video/what-is-mpeg-dash/
[Blog]
[Naver Deview]