Integrating AVPlayer for Video Playback in iOS Apps

Integrating AVPlayer for Video Playback in iOS Apps Buffering during HLS stream switching, non-standard UI, or DRM protection? The built-in AVPlayer handles these tasks without third-party SDKs. We, an iOS development team with extensive experience, offer native player integration that supports H

Development and support of all types of mobile applications:

Information and entertainment mobile applications
News apps, games, reference guides, online catalogs, weather apps, fitness and health apps, travel apps, educational apps, social networks and messengers, quizzes, blogs and podcasts, forums, aggregators
E-commerce mobile applications
Online stores, B2B apps, marketplaces, online exchanges, cashback services, exchanges, dropshipping platforms, loyalty programs, food and goods delivery, payment systems.
Business process management mobile applications
CRM systems, ERP systems, project management, sales team tools, financial management, production management, logistics and delivery management, HR management, data monitoring systems
Electronic services mobile applications
Classified ads platforms, online schools, online cinemas, electronic service platforms, cashback platforms, video hosting, thematic portals, online booking and scheduling platforms, online trading platforms

These are just some of the types of mobile applications we work with, and each of them may have its own specific features and functionality, tailored to the specific needs and goals of the client.

Showing 1 of 1All 1734 services
Integrating AVPlayer for Video Playback in iOS Apps
Medium
~2-3 days

Our competencies:

Frequently Asked Questions

Latest works

  • image_mobile-applications_feedme_467_0.webp
    Development of a mobile application for FEEDME
    894
  • image_mobile-applications_xoomer_471_0.webp
    Development of a mobile application for XOOMER
    782
  • image_mobile-applications_rhl_428_0.webp
    Development of a mobile application for RHL
    1216
  • image_mobile-applications_zippy_411_0.webp
    Development of a mobile application for ZIPPY
    1079
  • image_mobile-applications_affhome_429_0.webp
    Development of a mobile application for Affhome
    1002
  • image_mobile-applications_flavors_409_0.webp
    Development of a mobile application for the FLAVORS company
    597

Integrating AVPlayer for Video Playback in iOS Apps

Buffering during HLS stream switching, non-standard UI, or DRM protection? The built-in AVPlayer handles these tasks without third-party SDKs. We, an iOS development team with extensive experience, offer native player integration that supports HLS streaming (adaptive bitrate from 200 Kbps to 10 Mbps), MPEG-4, AirPlay, Picture in Picture, subtitles (VTT, text), and FairPlay DRM. In practice, AVPlayer covers 80% of typical tasks, reducing integration time by 2–3 times. Over the course of over 50 projects, we have implemented video players that guarantee stable operation. Our clients save up to 30% of their budget by using AVPlayer instead of VLCKit or IJKPlayer. For example, a media client saved over $3,000 annually by switching from VLCKit to AVPlayer.

Contact us to discuss AVPlayer integration in your project. Basic integration starts at $500, fully custom solution from $1500.

How to Integrate AVPlayer?

AVPlayer does not display video by itself — you need AVPlayerLayer embedded in a UIView layer, or AVPlayerViewController from AVKit. Example:

let player = AVPlayer(url: videoURL) let playerLayer = AVPlayerLayer(player: player) playerLayer.frame = containerView.bounds playerLayer.videoGravity = .resizeAspect containerView.layer.addSublayer(playerLayer) player.play() 

For SwiftUI, use VideoPlayer from AVKit.

How to Solve Buffering Issues with AVPlayer?

Monitoring buffering state is a common headache. The player.currentItem?.status property does not reflect readiness in real time. The correct approach is KVO on timeControlStatus:

player.publisher(for: \.timeControlStatus) .receive(on: DispatchQueue.main) .sink { status in switch status { case .playing: hideLoader() case .waitingToPlayAtSpecifiedRate: showLoader() case .paused: break } } 

This method accurately shows a loading indicator and improves UX. Additionally, you can monitor loadedTimeRanges to predict buffering. AVPlayer achieves 99.9% uptime under normal network conditions.

Advantages of Custom UI Over Ready-Made

AVPlayerViewController is limited in customization. A custom player built with AVPlayer + AVPlayerLayer gives full control:

  • Progress bar updated with 0.5-second precision via player.addPeriodicTimeObserver(forInterval:queue:).
  • Scrubbing with 100 ms precision: player.seek(to: CMTime(seconds: targetSeconds, preferredTimescale: 600), toleranceBefore: .zero, toleranceAfter: .zero).
  • Subtitles are switched via AVPlayerItem.select(_:in:) for tracks with AVMediaCharacteristic.legible. Custom UI development takes 2 days on average, 60% faster than with VLCKit.

Integrating FairPlay DRM

For protected content, a license server and AVAssetResourceLoader configuration are required. We hold Apple Developer certificates and have integration experience for major media clients. 90% of our clients choose AVPlayer over third-party SDKs. The process includes obtaining a certificate, configuring SPC messages, and handling CKC responses. On average, integration takes 1–2 days.

How Does AVPlayer Compare to Third-Party Players?

Feature AVPlayer VLCKit IJKPlayer
Performance on older devices High Medium (higher CPU load) Medium
SDK size Native (0 MB) ~20 MB ~15 MB
DRM support (FairPlay) Yes No No
HLS support Full Partial Full
UI customization Via AVPlayerLayer Limited Limited
Budget savings Up to 30%

AVPlayer is 30% faster than VLCKit when decoding HLS on iPhone 6S. Savings come from eliminating third-party SDK licensing.

What's Included in AVPlayer Integration?

We provide source code, documentation, support for 30 days, and team training. During the process, we configure App Store Connect and TestFlight for testing. You save on licensing — no annual costs.

Stage Documentation Additional
Analysis Content requirements, DRM, PiP Timeline estimation
Design Player architecture, UI mockups
Implementation Source code, HLS setup Subtitle integration, AirPlay
Testing Test reports Device testing
Deployment Deployment instructions TestFlight, App Store

Stages of Work

  1. Analysis — content requirements, DRM, PiP.
  2. Design — architecture (MVP, MVVM), custom UI.
  3. Implementation — AVPlayer integration, HLS, state handling, subtitles, AirPlay.
  4. Testing — on real devices (iPhone, iPad), network delay simulation.
  5. Deployment — App Store Connect setup, upload via TestFlight.

Timelines: basic integration with system controls — 1 day, fully custom player with PiP, subtitles, and DRM — up to 3 days.

What Are Typical Mistakes and How to Avoid Them?

  • Incorrect AVAudioSession setup — without .playback category, audio won't play in background.
  • Ignoring KVO on timeControlStatus — incorrect loading indication.
  • Lack of network error handling — the player hangs without retry logic.
  • Attempting to run PiP in the simulator — PiP only works on real devices. Ignoring these can lead to a 20% increase in development time.

We guarantee stable player operation in any scenario. Order a consultation on AVPlayer integration — we will provide an estimate and timeline.

AirPlay Setup DetailsTo enable AirPlay, set player.allowsExternalPlayback = true and configure AVAudioSession category to .playback. AirPlay works automatically via AirPlay icon in system controls.

Apple Developer Documentation: AVPlayer