Hello everyone ✌️
Create a beautiful video background for your application. There are two methods in this project to achieve this goal:
- First - natively with the help of player frameworks AVPlayer and AVFoundation.
- Second - with the help of the dependency manager Cocoa Pods.
If you like the project, do not forget to put star and follow me on GitHub:
Swift 4+
. Ready for use on iOS 9+
.
To run the example project, clone the repo, and run scheme from .xcodeproj. You can see tutorial for this project on YouTube.
- Open Terminal
- Run command:
cd /project path
- Then to install project you need run the command on Terminal:
pod install or pod update
You can use one of two options.
I. For local video:
- Open .xcodeproj file
- Import video file to project. Check the box copy if needed
- Open swift file ViewController
- Then paste the file name and format into the appropriate place:
let videoURL: NSURL = Bundle.main.url(forResource: "file name", withExtension: ".format")! as NSURL
- Press
Command + R
orPlay
and run project
II. For url video:
- Uncomment a piece of code for url in method viewDidLoad:
try? VideoBackground.shared.play(view: view, videoName: "file name", videoType: "format")
- Then paste the file name and format into the appropriate place
- In method viewDidLoad, comment out a piece of code for local video
- Press
Command + R
orPlay
and run project. Great!
Support me with a monthly donation and help me continue activities. Become a sponsors Yandex.Money or Tinkoff Bank.
Email: studio@byidole.com
Available under the MIT license.
© IDOLE Studio.