# ความละเอียดวิดีโอ (Resolution)
ByteArk Player SDK for iOS รองรับการเลือกความละเอียดวิดีโอ ทั้งแบบ Adaptive Bitrate Streaming (ABR) อัตโนมัติและให้ผู้ชมเลือกเองได้
# Adaptive Bitrate Streaming (ABR)
โดยค่าเริ่มต้น AVPlayer จะปรับความละเอียดอัตโนมัติตามความเร็วของเครือข่ายผ่าน ABR ของ HLS
# เลือกความละเอียดผ่าน API
// ดูรายการความละเอียดทั้งหมด
let resolutions: [ByteArkPlayerMediaResolution] = player.resolutions
// ความละเอียดปัจจุบัน
let current: ByteArkPlayerMediaResolution? = player.resolution
// เลือกความละเอียด
player.setResolution(resolutions[0])
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
# รับ Event เมื่อความละเอียดเปลี่ยน
override func playbackResolutionChanged(
player: ByteArkPlayer,
resolution: ByteArkPlayerMediaResolution?
) {
super.playbackResolutionChanged(player: player, resolution: resolution)
// ความละเอียดถูกเปลี่ยน
}
1
2
3
4
5
6
7
2
3
4
5
6
7
Note
ดู Apple Quality Switcher ของ Web SDK สำหรับการแสดง UI เลือกความละเอียดบน Safari บน iOS/iPadOS หากต้องการให้ผู้ชมเลือกความละเอียดเองได้บน Web — บน Native iOS SDK ระบบจะใช้ AVPlayer ABR เป็นหลัก