Giter Site home page Giter Site logo

furkanvijapura / videobackgroundviewcontroller Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pixel16/videobackgroundviewcontroller

0.0 1.0 0.0 15.79 MB

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

License: MIT License

Ruby 38.49% Swift 57.74% Objective-C 3.76%

videobackgroundviewcontroller's Introduction

Banner

Build Status codecov.io GitHub licenseswift4

VideoBackgroundViewController

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

VideoBackgroundViewControllerGif

โญ 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.

๐Ÿค˜ 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

๐Ÿ‘ฝ Author

Chris Jimenez - http://chrisjimenez.net, @chrisjimeneznat

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

๐Ÿบ 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 for details.

videobackgroundviewcontroller's People

Contributors

pixel16 avatar jerherrero avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.