UZPlayer 2.3.1

UZPlayer 2.3.1

Maintained by Nam Nguyen, Nam Kennic.



 
Depends on:
NKModalPresenter>= 0
FrameLayoutKit>= 0
UZM3U8Kit>= 0
SwiftIcons>= 0
 

UZPlayer 2.3.1

  • By
  • UIZA

License BSD  Version Build Status Swift Platform  Support 

UZPlayer is a framework allows you to play video with fully customizable controls.

Compatibility

UZPlayer requires Swift 4.2+ and iOS 9+

Installation

CocoaPods

To integrate UZPlayer into your Xcode project using CocoaPods, specify it in your Podfile:

pod 'UZPlayer'

Then run the following command:

$ pod install

Usage

let playerViewController = UZPlayerViewController()		
playerViewController.player.controlView.theme = UZTheme1()
playerViewController.player.loadVideo(url: VIDEO_URL)
present(playerViewController, animated: true, completion: nil)

You might have to add these lines to Info.plist to disable App Transport Security (ATS) to be able to play video:

<key>NSAppTransportSecurity</key>  
<dict>  
  <key>NSAllowsArbitraryLoads</key><true/>  
</dict>

Change Player Themes

let playerViewController = UZPlayerViewController()
playerViewController.player.controlView.theme = UZTheme1()

UZPlayer currently has 7 built-in themes:

UZTheme1

UZTheme2

UZTheme3

UZTheme4

UZTheme5

UZTheme6

UZTheme7

Create CustomTheme

You can create your own custom theme by creating a class inheriting from UZPlayerTheme Protocol following this template: UZCustomTheme

You can also create your custom end screen by subclassing UZEndscreenView, then set an instance to player.controlView.endscreenView

playerViewController.player.controlView.endscreenView = MyCustomEndScreen()

Create Player with Floating Mode

You can create player with "drag down to floating mode" like Facebook or Youtube, by subclassing UZFloatingPlayerViewController, then you can add more UI for displaying video details and add them to detailsContainerView

Then present using this code:

UZFloatingPlayerViewController().present(with: videoItem, playlist: playlist)

See Example

For API details, check API Document

Google ChromeCast supports

If developing using Xcode 10 and targeting iOS devices running iOS 12 or higher, the "Access WiFi Information" capability is required in order to discover and connect to Cast devices

Support

[email protected]

License

UZPlayer is released under the BSD license. See LICENSE for details.