{"id":2169,"url":"https://github.com/Guzlan/BackgroundVideoiOS","last_synced_at":"2025-07-31T13:30:27.295Z","repository":{"id":85196250,"uuid":"61937984","full_name":"Guzlan/BackgroundVideoiOS","owner":"Guzlan","description":"A swift and objective-C object that lets you add a background video to iOS views","archived":false,"fork":false,"pushed_at":"2019-06-14T02:08:54.000Z","size":11396,"stargazers_count":561,"open_issues_count":5,"forks_count":85,"subscribers_count":15,"default_branch":"master","last_synced_at":"2024-08-15T00:20:01.984Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Guzlan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-06-25T10:15:24.000Z","updated_at":"2024-01-05T07:09:09.000Z","dependencies_parsed_at":"2023-11-29T01:15:10.479Z","dependency_job_id":null,"html_url":"https://github.com/Guzlan/BackgroundVideoiOS","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guzlan%2FBackgroundVideoiOS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guzlan%2FBackgroundVideoiOS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guzlan%2FBackgroundVideoiOS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guzlan%2FBackgroundVideoiOS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Guzlan","download_url":"https://codeload.github.com/Guzlan/BackgroundVideoiOS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228248449,"owners_count":17891447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:16:06.457Z","updated_at":"2024-12-05T06:31:26.095Z","avatar_url":"https://github.com/Guzlan.png","language":"Objective-C","funding_links":[],"categories":["UI","Objective-C"],"sub_categories":["Other free courses","Font","Other Testing"],"readme":"# BackgroundVideoiOS\n#### *This is an Object/Class which lets you add a background video to iOS app views. This is seen at login views of some famous apps like Spotify, tumbler and Vimeo*\n\n##### This is how they look.. \n\u003csection\u003e\n\u003cimg  src=\"Screenshots/SpotifyGif.gif\" width=\"32%\" height=\"auto\"\u003e \u003cimg  src=\"Screenshots/VimeoGif.gif\" width=\"32%\" height=\"auto\"\u003e \u003cimg   src=\"Screenshots/TumblerGif.gif\" width=\"32%\" height=\"auto\"\u003e\n\u003c/section\u003e\n##### It does the following: \n* *Creates an AVPlayer object for you and plays a video from your app bundle*\n\n* *Handles video looping*\n\n* *Handles app going to background and coming back to foreground*\n\n* *Handles seguing away and back again to the view that plays the video*\n\n* *Mutes the video and does not allow it to interrupt other audio services. For example, it does not stop music playing from your music app or a VoIP call*\n\n##### Instructions for Swift:\n1. Have an awesome video that you want to show as your background \n2. Drag and drop **`BackgroundVideo.swift`** file to your Project navigator\n\n\t\u003cimg src=\"Screenshots/dragdrop1.png\"\u003e  \n\n3. Drag and drop the video to your project and make sure to check **`Copy items if needed`** as well as **`Add to targets`** (This is because the object will look at your app's main bunddle)\n\n\n \u003cimg src=\"Screenshots/dragdrop2.png\"\u003e \u003cimg src=\"Screenshots/instruction.png\"\u003e \n\n4. Go to the view controller where you want to display the video and declare an instance.\n\t```swift\n\t\tvar backgroundPlayer : BackgroundVideo? // Declare an instance of BackgroundVideo called backgroundPlayer\n\t```\n\n5. In your **`viewDidLoad()`** method, initialize your instance with the view controller you're using and the name of the `video file with it's extension` as parameters (make sure you seperate your name and extension by a period). In the following code I'm passing the same view controller where I declared my instance, namely **`self`**. Then, just call the function **`setUpBackground()`** on your instance.\n\n```swift\n override func viewDidLoad() {\n        super.viewDidLoad()\n        // Initializing your instance \n        backgroundPlayer = BackgroundVideo(onViewController: self, withVideoURL: \"test.mp4\") // Passing self and video name with extension\n        backgroundPlayer?.setUpBackground() \n    }\n```\n\n##### Instructions for Objective-C:\n1. Do steps 1-3 from the Swift steps above, but instead of dragging **`BackgroundVideo.swift`**, drag and drop **`BackgroundVideoObjC.h`** and **`BackgroundVideoObjC.m`**.\n2. Go to the view controller where you want to display the video and declare an instance.\n\n\t```objective-c\n\t\t@property (strong, nonatomic) BackgroundVideoObjC *backgroundVideo;\n\t```\n\n3. Same as 5 from Swift steps, except use this code: \n\n```objective-c\n- (void)viewDidLoad {\n    self.backgroundVideo = [[BackgroundVideoObjC alloc] initOnViewController:self withVideoURL:@\"test.mp4\"];\n    [self.backgroundVideo setUpBackground];\n}\n```\n\n\n##### That's it, you're ready to go :)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGuzlan%2FBackgroundVideoiOS","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FGuzlan%2FBackgroundVideoiOS","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FGuzlan%2FBackgroundVideoiOS/lists"}