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: 3 months 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 (about 9 years ago)
 - Default Branch: master
 - Last Pushed: 2021-06-12T01:30:52.000Z (over 4 years ago)
 - Last Synced: 2024-12-07T08:50:25.041Z (11 months 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
- awesome-swift - SwiftVideoBackground - Easy to Use UIView subclass for implementating a video background. (Libs / Video)
 - awesome-swift - SwiftVideoBackground - Easy to Use UIView subclass for implementating a video background. (Libs / Video)
 - awesome-ios-star - SwiftVideoBackground - Easy to Use UIView subclass for implementing a video background. (UI / Font)
 - fucking-awesome-swift - SwiftVideoBackground - Easy to Use UIView subclass for implementating a video background. (Libs / Video)
 - awesome-ios - SwiftVideoBackground - Easy to Use UIView subclass for implementing a video background. (UI / Font)
 - awesome-swift - SwiftVideoBackground - Framework to Play a Video in the Background of any UIView ` 📝 15 days ago ` (Video [🔝](#readme))
 
README
          
  
[][podLink]
[](https://github.com/Carthage/Carthage)
[](https://cocoapods.org/pods/SwiftVideoBackground)
[](https://cocoapods.org/pods/SwiftVideoBackground)

[](https://swift.org)
[][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