Skip to content

onurtuna/TunaPlayer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Logo

Tuna Player

A video and audio player for iOS with DRM support.

View Demo · Report Bug · Request Feature

About The Project

Tuna Player is an easy to use video player supports DRM. The purpose of the project is to simplify the development process of the video parts for the iOS apps which do not have video-first properties.

Features:

  • HLS video and audio streaming
  • Control Bar
  • Digital Rights Management
  • Reverse Proxy and Caching

(back to top)

Built With

  • Swift
  • AVFoundation

(back to top)

Getting Started

Using Tuna Player for HLS playback is pretty easy.

  • Create an instance of Tuna Player.
  • For the first time use the player should be created.
  • The player should be added to a UIView.
  • Before playing a content the corresponding URL must be set. The playback won't start automatically.
var tunaPlayer = TunaPlayer()
tunaPlayer.createPlayer { [weak self] in
  guard let player = self?.tunaPlayer.getPlayer() else {
    return
  }
  playerView.addSubview(player)
  tunaPlayer.setUrl(contentUrl)
  tunaPlayer.play()
}

DRM support is also pretty easy.

tunaPlayer.setLicenseUrl(licenseUrl)
tunaPlayer.setCertificateData(certificateData)

The backend requirements for DRM

  • The license server should accept body keys as "spc" and "assetid".
  • The response from the license server should have the key "ckc".

Installation

  • SPM
https://github.com/onurtuna/TunaPlayer.git
  • Manual

Just copy and paste the XCFramework. Make sure the path is correct for framework search paths.

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Onur Tuna - @onurtuna

Project Link: https://github.com/onurtuna/TunaPlayer

(back to top)

Releases

No releases published

Packages

No packages published

Languages