YHPlayer - An easy-to-use video player based on swift language

Related tags

Video YHPlayer
Overview

YHPlayer

An easy-to-use video player based on swift language

CI Status Version License Platform

Features

  • Plays local media or streams remote media over HTTP
  • Custom UI control layer screen
  • Support screen rotation
  • Simple API
  • Clear delegate method
  • Audio Default is muted
  • AutoPlay Default is False

Requirements

iOS 11.0 or later
xcode 11.0 or later

Installation

YHPlayer is available through CocoaPods. To install it, simply add the following line to your Podfile:

target 'YourProductName' do
    pod 'YHPlayer'
    ...

Install pods

$ pod install

And then import import YHPlayer where you use.

How to use

1.create YHPlayer
        let playView = YHPlayer(frame: .zero)
        playView.delegate = self
2.create YHPlayerItemConfig
        let itemConfig = YHPlayerItemConfig(videoURL: videoURL1,
                                            isMuted: false,
                                            isAutoPlay: false,
                                            thumbImg: .init(named: "thumbimg"))
3.set itemConfig to player
        playView.config(with: itemConfig)
4.custome your controlPanel
        playView.addCustomeControl(controlView)

YHPlayerDelegate

public protocol YHPlayerDelegate: NSObjectProtocol {
    /// 更新播放进度
    func yhPlayer(_ player: YHPlayer, notifyCurrentProgress progress: TimeInterval)
    
    /// 更新缓冲进度
    func yhPlayer(_ player: YHPlayer, notifyBufferProgress progress: TimeInterval)
    
    /// 准备播放
    func yhPlayerReadyToPlay(_ player: YHPlayer)
    
    /// 失败播放
    func yhPlayerFailedToPlay(_ player: YHPlayer, error: YHPlayer.Error)
    
    /// 播放完毕
    func yhPlayerDidEndPlaying(_ player: YHPlayer)
    
    /// 播放中断(来电话等优先级高的)
    func yhPlayerInterruptioned(_ player: YHPlayer, interruptionType type: YHPlayer.InterruptionType)
    
    /// 状态发生改变
    func yhPlayerStatusChanged(_ player: YHPlayer, status: YHPlayer.PlayStatus)
}

Run result

Author

YEHAN, [email protected]

License

YHPlayer is available under the MIT license. See the LICENSE file for more info.

You might also like...
iOS video player for trailer. You can customize layout for the control panel. Support PiP and DRM.

iOS video player for trailer. You can customize layout for the control panel. Support PiP and DRM.

IINA is the modern video player for macOS.
IINA is the modern video player for macOS.

IINA IINA is the modern video player for macOS. Website · Releases · Telegram Group Features Based on mpv, which provides the best decoding capacity o

Yattee: video player for Invidious and Piped built for iOS 15, tvOS 15 and macOS Monterey
Yattee: video player for Invidious and Piped built for iOS 15, tvOS 15 and macOS Monterey

Video player with support for Invidious and Piped instances built for iOS 15, tvOS 15 and macOS Monterey.

YouTube video player for iOS, tvOS and macOS
YouTube video player for iOS, tvOS and macOS

About XCDYouTubeKit is a YouTube video player for iOS, tvOS and macOS. Are you enjoying XCDYouTubeKit? You can say thank you with a tweet. I am also a

YoutubeKit is a video player that fully supports Youtube IFrame API and YoutubeDataAPI for easily create a Youtube app
YoutubeKit is a video player that fully supports Youtube IFrame API and YoutubeDataAPI for easily create a Youtube app

YoutubeKit YoutubeKit is a video player that fully supports Youtube IFrame API and YoutubeDataAPI to easily create Youtube applications. Important Ref

Versatile Video Player implementation for iOS, macOS, and tvOS
Versatile Video Player implementation for iOS, macOS, and tvOS

News 🎉 - Since 2.1.3 VersaPlayer now supports iOS, macOS, and tvOS Example Installation Usage Basic Usage Adding Controls Advanced Usage Encrypted Co

Yattee: video player for Invidious and Piped built for iOS, tvOS and macOS
Yattee: video player for Invidious and Piped built for iOS, tvOS and macOS

Video player for Invidious and Piped instances built for iOS, tvOS and macOS. Features Native user interface built with SwiftUI Multiple instances and

WatchTube: a standalone WatchOS youtube player utilizing Download API for search data and video streaming
WatchTube: a standalone WatchOS youtube player utilizing Download API for search data and video streaming

WatchTube is a standalone WatchOS youtube player utilizing Download API for sear

A high-performance, flexible, and easy-to-use Video compressor library written by Swift.

FYVideoCompressor A high-performance, flexible and easy to use Video compressor library written by Swift. Using hardware-accelerator APIs in AVFoundat

Owner
null
Musical Player - A Simple Musical Player For iOS

Musical_Player The app is a musical player. It was written as an task for a mobi

null 1 Nov 26, 2022
▶️ video player in Swift, simple way to play and stream media on iOS/tvOS

Player Player is a simple iOS video player library written in Swift. Looking for an obj-c video player? Check out PBJVideoPlayer (obj-c). Looking for

patrick piemonte 2k Jan 2, 2023
FWVideoPlayer is video Player for iOS in Swift.

FWVideoPlayer Desc FWVideoPlayer is video Player for iOS in Swift. It can play video and audio. You can use it easy. Example To run the example projec

null 1 Oct 15, 2021
360 video player for iOS written in swift - a subset of SceneKit that works

DDDKit An open source library to support 360 videos and pictures. It's designed as a generic 3D library that you can use for much more! Example of use

Guillaume Sabran 123 Aug 9, 2022
Overlay alpha channel video animation player view using Metal.

Overlay alpha channel video animation player view using Metal. Example To run the example project, clone the repo, and run pod install from the Exampl

noppefoxwolf 244 Jan 1, 2023
Swifty360Player - iOS 360-degree video player streaming from an AVPlayer.

Swifty360Player iOS 360-degree video player streaming from an AVPlayer. Demo Requirements Swifty360Player Version Minimum iOS Target Swift Version 0.2

Abdullah Selek 148 Dec 18, 2022
VGPlayer - 📺 A simple iOS video player by Vein.

Swift developed based on AVPlayer iOS player,support horizontal gestures Fast forward, pause, vertical gestures Support brightness and volume adjustment, support full screen, adaptive screen rotation direction.

Wen Rong 399 Dec 23, 2022
Open Source iOS 360 Degree Panorama Video Player.

?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? The Metal with Swift 5.0 version is comming ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? ?? 360 VR Player A Open Source, Ad-free, Na

Hanton Yang 2k Dec 24, 2022
📽 A video player for SwiftUI, support for caching, preload and custom control view.

Features QuickStart Advances Installation Requirements License Demo Clone or download the project. In the terminal, run swift package resolve. Open Vi

Gesen 437 Jan 5, 2023
SuperVideoPlayer is video player in Objc.

SuperVideoPlayer Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements Installation S

null 1 Oct 19, 2021