Skip to content

A simple video player for iOS, based on AVPlayer, using Swift.

License

Notifications You must be signed in to change notification settings

coolryze/YZPlayer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

YZPlayer

License MIT  Platform  Support 

A simple video player for iOS, based on AVPlayer. Support the vertical, horizontal screen. Support adjust volume, screen brigtness and video progress.

Features

  • Rotate automatically according to the screen.
  • Support for horizontal and vertical play mode.
  • Support play with online URL video file.
  • Adjust screen brightness by slide vertical at left side of screen.
  • Adjust volume by slide vertical at right side of screen.
  • Slide horizontal to fast forward and rewind.

Requirements

This library requires iOS 7.0+, Swift 3 and Xcode 8.0+.

Usage

####1. Add Key View controller-based status bar appearance value NO to info.plist.

####2. In your ViewController, override shouldAutorotate.

override var shouldAutorotate : Bool {
    return false
}

####3. Add YZPlayerView to play video.

let video = YZVideo(play_address: "https://mu.mumov.com/videogHDk7k6vxjiahC0yPRAXBN3omu", title: "旅游丨柏林的符号学")
let playerView = YZPlayerView()
playerView.video = video
playerView.delegate = self
playerView.containerController = self
self.view.addSubview(playerView)

playerView.play()

####4. Implements YZPlayerViewDelegate.

  • click back button
func backAction() {
    // _ = navigationController?.popViewController(animated: true)
}
  • click like button
func likeAction(isLike: Bool) {
    // isLike ? print("like") : print("dislike")
}

License

YZPlayer is provided under the MIT license. See LICENSE file for details.

About

A simple video player for iOS, based on AVPlayer, using Swift.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages