GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - andreipitis/ASPVideoPlayer: A simple video player that allow animations to be performed on the view during playback.

BranchesTags
Open more actions menu

Latest commit

 

History

139 Commits
139 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
Example
Example
 
 
Sources
Sources
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
ASPVideoPlayer.gif
ASPVideoPlayer.gif
 
 
ASPVideoPlayer.podspec
ASPVideoPlayer.podspec
 
 
CHANGELOG.md
CHANGELOG.md
 
 
LICENSE
LICENSE
 
 
Package.swift
Package.swift
 
 
README.md
README.md
 
 
_Pods.xcodeproj
_Pods.xcodeproj
 
 

Repository files navigation

ASPVideoPlayer

CI Status codebeat badge codecov Version License Platform

Example

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

Usage

There are two objects you can use to display a video:

  1. ASPVideoPlayer
  2. ASPVideoPlayerView

1. ASPVideoPlayer

aspvideoplayer

ASPVideoPlayer is a full video player with UI controls.

You should use this if you just want to display videos in a player with controls such as play, pause, scrub, next, previous.

  • You can instantiate the object from code:
let videoPlayer = ASPVideoPlayer()
  • You can also instantiate it from Interface Builder and create an IBOutlet:
@IBOutlet weak var videoPlayer: ASPVideoPlayer!
  • Once you have the reference, you can set the video URLs, the gravity and whether the videos should loop:
let firstVideoURL = Bundle.main.url(forResource: "video", withExtension: "mp4")
let secondVideoURL = Bundle.main.url(forResource: "video2", withExtension: "mp4")

videoPlayer.videoURLs = [firstVideoURL!, secondVideoURL!]

videoPlayer.gravity = .aspectFit

videoPlayer.shouldLoop = true

2. ASPVideoPlayerView

ASPVideoPlayerView is a component that ASPVideoPlayer uses to display the video, but you can also use it by itself.

It's a simple UIView with no UI elements.

If you wish to implement your own video player, or want a simple component to display a single video with no other UI elements, you should use this.

  • You can instantiate the object from code:
let videoPlayer = ASPVideoPlayerView()
  • You can also instantiate it from Interface Builder and create an IBOutlet:
@IBOutlet weak var videoPlayer: ASPVideoPlayerView!
  • Once you have the reference, you can set a video url and use the closures to handle different events:
let videoURL = Bundle.main.url(forResource: "video", withExtension: "mp4")

videoPlayer.videoURL = videoURL

videoPlayer.readyToPlayVideo = {
  print("Video has been successfully loaded and can be played.")
}
    
videoPlayer.startedVideo = {
  print("Video has started playing.")			
}

Installation

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

pod "ASPVideoPlayer"

Author

Andrei-Sergiu Pitis, [email protected]

License

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

About

A simple video player that allow animations to be performed on the view during playback.

Topics

iosswiftuiviewvideo-player

Resources

Readme
MIT license
Activity

Stars

90 stars

Watchers

4 watching

Forks

44 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.