Latest 0.0.4
Homepage https://github.com/PiXeL16/VideoBackgroundViewController
License MIT
Platforms ios 9.0, requires ARC
Authors

Banner

Build Status codecov.io GitHub licenseswift4

A View Controller that shows a video in the background, like Spotify!

VideoBackgroundViewControllerGif

star: Features

  • Customizable video URL.
  • Play video with sound or not.
  • Customizable sound level.
  • Customizable video alpha channel.
  • Loop the video or not
  • Customizable video scaling mode. Resize, ResizeAspect, ResizeAspectFill(Default)
  • Works in portrait and landscape orientation

octocat: Installation

Get VideoBackgroundViewController on CocoaPods, just add pod 'VideoBackgroundViewController' to your Podfile and then run pod install.

metal: Usage

Usage is pretty easy, just inherid your ViewController from VideoBackgroundViewController and set your initial video URL like:


import VideoBackgroundViewController

override func viewDidLoad() {
super.viewDidLoad()

 let url = NSURL.fileURLWithPath(NSBundle.mainBundle().pathForResource("spotifyVideo", ofType: "mp4")!)

 self.videoURL = url

}


You can also customize the default values like:

import VideoBackgroundViewController

override func viewDidLoad() {
super.viewDidLoad()

 let url = NSURL.fileURLWithPath(NSBundle.mainBundle().pathForResource("spotifyVideo", ofType: "mp4")!)

 self.videoURL = url
 self.videoFrame = view.frame
 self.videoShouldLoop = true
 self.alpha = 0.5
 self.playSound = true
 self.videoScalingMode = .ResizeAspectFill

}



TODO
-----
* Protocolize the f*ck out of this
* Better code coverage

:alien: Author
------
Chris Jimenez - http://chrisjimenez.net, [@chrisjimeneznat](http://twitter.com/chrisjimeneznat)

Some ideas where taken from https://github.com/allenwong/30DaysofSwift

:beer: Donate
------
If you want to buy me a beer, you can donate to my coin addresses below:
#### BTC
1BeGBew4CBdLgUSmvoyiU1LrM99GpkXgkj
#### ETH
0xa59a3793E3Cb5f3B1AdE6887783D225EDf67192d
#### LTC
Ld6FB3Tqjf6B8iz9Gn9sMr7BnowAjSUXaV

## License
`VideoBackgroundViewController` is released under the MIT license. See [LICENSE](https://github.com/pixel16/VideoBackground/blob/master/LICENSE) for details.

Latest podspec

{
    "name": "VideoBackgroundViewController",
    "version": "0.0.4",
    "summary": "A View Controller that shows a video in the background, like Spotify",
    "description": "A View Controller that shows a video in the background, like Spotify, written in Swift",
    "homepage": "https://github.com/PiXeL16/VideoBackgroundViewController",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "Chris Jimenez": "[email protected]"
    },
    "social_media_url": "http://twitter.com/chrisjimeneznat",
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/PiXeL16/VideoBackgroundViewController.git",
        "tag": "0.0.4"
    },
    "source_files": [
        "VideoBackgroundViewController/",
        "VideoBackgroundViewController/**/*.{h,m,swift}"
    ],
    "requires_arc": true,
    "pushed_with_swift_version": "4"
}

Pin It on Pinterest

Share This