Latest 1.0.3
Homepage https://github.com/SolsmaHawk/SDLoopingVideoView
License MIT
Platforms ios 11.0
Authors

CI Status
Version
License
Platform

Description

SDLoopingVideoView is a looping video-view based off of AVPlayerLayer; it works great when used as a video background (see below for list of apps using SDLoopingVideoView). SDLoopingVideoView automatically scales any video displayed to aspect-fill the view you define; scaling can be set manually as well. SDLoopingVideoView responds to any UIView animations and scales accordingly without interuption of the video playing.

SDLoopingVideoView

Example

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

Requirements

Swift 4.2

Installation

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

pod 'SDLoopingVideoView'

How to use

Interface Builder

The easiest way to create a SDLoopingVideoView is to drag and drop a UIView in interface builder and set its class to SDLoopingVideoView. Then, under the attributes inspector tab, set the videoName property to the name of your video file and set the videoType property to the extension of your video file.

SDLoopingVideoView

Programatically

You can also initialize an SDLoopingVideoView by declaring it in code:

let loopingVideoView = SDLoopingVideoView.init(frame: 
CGRect.init(x: 0, y: 0, width: 200, height: 200), 
videoName: "your_video_name", 
videoType: "mp4")
view.addSubview(loopingVideoView)

Or if you want to manually set scaling (defaults to aspect-fill):

let loopingVideoView = SDLoopingVideoView.init(frame: 
CGRect.init(x: 0, y: 0, width: 200, height: 200), 
videoName: "your_video_name", 
videoType: "mp4",
scaling: .resizeAspectFill)
view.addSubview(loopingVideoView)

Simple!

Get Creative

You can setup multiple SDLoopingVideoViews to display simultaneously. (Video game footage taken from Velocity Breaker by Solsma Dev, available in the App Store.)

SDLoopingVideoView

Author

John Solsma (Solsma Dev Inc.), [email protected], http://SolsmaDev.com

Apps using SDLoopingVideoView

If you’re using SDLoopingVideoView in a public app, email me ([email protected]) and I will add it to the list!

License

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

Latest podspec

{
    "name": "SDLoopingVideoView",
    "version": "1.0.3",
    "summary": "An automatically scaling and looping video-view based off of AVPlayerLayer.",
    "description": "SDLoopingVideoView is a looping video-view based off of AVPlayerLayer; it works great when used as a video background (see below for list of apps using SDLoopingVideoView). SDLoopingVideoView automatically scales any video displayed to aspect-fill the view you define; scaling can be set manually as well. SDLoopingVideoView responds to any UIView animations and scales accordingly without interuption of the video playing.",
    "homepage": "https://github.com/SolsmaHawk/SDLoopingVideoView",
    "license": {
        "type": "MIT",
        "file": "SDLoopingVideoViewExample/LICENSE"
    },
    "authors": {
        "SolsmaHawk": "[email protected]"
    },
    "source": {
        "git": "https://github.com/SolsmaHawk/SDLoopingVideoView.git",
        "tag": "1.0.3"
    },
    "platforms": {
        "ios": "11.0"
    },
    "swift_version": "4.2",
    "source_files": "SDLoopingVideoView/*.{h,m,swift}"
}

Pin It on Pinterest

Share This