Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dingwilson/swiftvideobackground
📹 Framework to Play a Video in the Background of any UIView
https://github.com/dingwilson/swiftvideobackground
background background-video ios swift ui uiview video video-background
Last synced: 2 days ago
JSON representation
📹 Framework to Play a Video in the Background of any UIView
- Host: GitHub
- URL: https://github.com/dingwilson/swiftvideobackground
- Owner: dingwilson
- License: mit
- Created: 2016-09-26T20:00:57.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-06-12T01:30:52.000Z (over 3 years ago)
- Last Synced: 2025-01-12T10:06:09.427Z (10 days ago)
- Topics: background, background-video, ios, swift, ui, uiview, video, video-background
- Language: Swift
- Homepage: https://wilsonding.com/SwiftVideoBackground
- Size: 38.7 MB
- Stars: 347
- Watchers: 10
- Forks: 53
- Open Issues: 10
-
Metadata Files:
- Readme: README-0.06.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[![CocoaPods Version Status](https://img.shields.io/cocoapods/v/SwiftVideoBackground.svg)][podLink]
[![Carthage compatible](https://img.shields.io/badge/Carthage-Compatible-brightgreen.svg?style=flat)](https://github.com/Carthage/Carthage)
[![CocoaPods](https://img.shields.io/cocoapods/dt/SwiftVideoBackground.svg)](https://cocoapods.org/pods/SwiftVideoBackground)
[![CocoaPods](https://img.shields.io/cocoapods/dm/SwiftVideoBackground.svg)](https://cocoapods.org/pods/SwiftVideoBackground)
![Platform](https://img.shields.io/badge/platforms-iOS-333333.svg)
[![Swift](https://img.shields.io/badge/Swift-3.0+-orange.svg)](https://swift.org)
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)][mitLink]
SwiftVideoBackground is an easy to use Swift framework that provides the ability to add a UIView of a video playing in the background to any ViewController. This provides a beautiful UI for login screens, or splash pages, as implemented by Spotify and many others.
1. [Requirements](#requirements)
2. [Integration](#integration)
- [Cocoapods](#cocoapods)
- [Carthage](#carthage)
- [Manually](#manually)
3. [Usage](#usage)
4. [License](#license)## Requirements
- Swift 3+
- iOS 8+## Integration
#### CocoaPods
You can use [CocoaPods](https://cocoapods.org/) to install `SwiftVideoBackground` by adding it to your `Podfile`:For Swift 3:
```ruby
pod 'SwiftVideoBackground', '0.06'
```#### Carthage
You can use [Carthage](https://github.com/Carthage/Carthage) to install `SwiftVideoBackground` by adding it to your `Cartfile`:
```
github "dingwilson/SwiftVideoBackground"
```#### Manually
To use this library in your project manually you may:
1. for Projects, just drag BackgroundVideo.swift to the project tree
2. for Workspaces, include the whole SwiftVideoBackground.xcodeproj## Usage
Import the framework into the ViewController
```swift
import SwiftVideoBackground
```Link a UIView within a ViewController within the Storyboard to a BackgroundVideo item, or link it programmatically.
```swift
var backgroundVideo : BackgroundVideo!
```Use the `createBackgroundVideo` function, with the name of the video or gif under `name`, and the file type under `type`. You can also include an alpha value between 0 and 1 under `alpha`, to adjust the brightness of the video.
```swift
backgroundVideo.createBackgroundVideo(name: "Background", type: "mp4")
```
```swift
backgroundVideo.createBackgroundVideo(name: "Background", type: "mp4", alpha: 0.5)
```Note: Make sure you have added a video file to the project, and targeted the project. Also, make sure that you have set the module to `SwiftVideoBackground` for the BackgroundVideo UIView.
## License
`SwiftVideoBackground` is released under an [MIT License][mitLink]. See `LICENSE` for details.
**Copyright © 2016-present Wilson Ding.**
*Please provide attribution, it is greatly appreciated.*
[podLink]:https://cocoapods.org/pods/SwiftVideoBackground
[mitLink]:https://opensource.org/licenses/MIT