Skip to content

Commit

Permalink
Merge pull request #43 from dingwilson/cooca-pods
Browse files Browse the repository at this point in the history
Cocoapods
  • Loading branch information
quanvo87 authored Feb 19, 2018
2 parents 1182b8c + 2c45a9c commit f7e2077
Show file tree
Hide file tree
Showing 23 changed files with 45 additions and 37 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Change Log

## [2.1.0](https://github.com/dingwilson/SwiftVideoBackground/tree/2.1.0)
(2018-02-19)
- Added a singleton called `shared`. Now users don't need to retain an instance of `VideoBackground` to play a video.
- Users can still create new instances if needed, i.e. if they needed to play multiple videos simultaneously.
- Added throwing APIs that throw a `videoNotFound` error that returns the video name and type in question.
- Added deprecation warning for old API.
- Added new public struct `VideoInfo` that contains a video's name and type.
- Added new API that takes in an array of `VideoInfo`, and plays them in sequence.
- Added some clean up code that gets called on each play(), in an attempt to reset state in the event of multiple calls to `play()`.

## [2.0.4](https://github.com/dingwilson/SwiftVideoBackground/tree/2.0.4)
(2018-02-16)
- Fixed layout issues for alpha overlay when device orientation changed
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ SwiftVideoBackground is an easy to use Swift framework that provides the ability
- Loop videos *(optional)*
- Mute sound *(optional)*
- Darken videos so overlying UI stands out more *(optional)*
- [Documentation](http://wilsonding.com/SwiftVideoBackground/)

## Contents

Expand All @@ -51,7 +52,7 @@ You can use [CocoaPods](http://cocoapods.org/) to install `SwiftVideoBackground`

For Swift 4:
```ruby
pod 'SwiftVideoBackground', '~> 2.0'
pod 'SwiftVideoBackground', '~> 2.1'
```

For Swift 3:
Expand Down
2 changes: 1 addition & 1 deletion SwiftVideoBackground.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "SwiftVideoBackground"
s.version = "2.0.4"
s.version = "2.1.0"
s.summary = "An easy to use Swift framework that creates a video background for any ViewController."
s.description = "SwiftVideoBackground is an easy to use Swift framework that provides the ability to play a video on any UIView. This provides a beautiful UI for login screens, or splash pages, as implemented by Spotify and many others"
s.homepage = "https://github.com/dingwilson/SwiftVideoBackground"
Expand Down
1 change: 1 addition & 0 deletions SwiftVideoBackground/VideoBackground.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import UIKit

/// Class that plays a video on a UIView.
public class VideoBackground {
/// Singleton instance that can be used to play a video.
public static let shared = VideoBackground()

private lazy var player = AVQueuePlayer()
Expand Down
2 changes: 1 addition & 1 deletion docs/Classes.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<a title="Classes Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html">SwiftVideoBackground Docs</a> (92% documented)</p>
<p><a href="index.html">SwiftVideoBackground Docs</a> (100% documented)</p>
<p class="header-right"><a href="https://github.com/dingwilson/SwiftVideoBackground"><img src="img/gh.png"/>View on GitHub</a></p>
</div>
</header>
Expand Down
4 changes: 2 additions & 2 deletions docs/Classes/VideoBackground.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<a title="VideoBackground Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftVideoBackground Docs</a> (92% documented)</p>
<p><a href="../index.html">SwiftVideoBackground Docs</a> (100% documented)</p>
<p class="header-right"><a href="https://github.com/dingwilson/SwiftVideoBackground"><img src="../img/gh.png"/>View on GitHub</a></p>
</div>
</header>
Expand Down Expand Up @@ -83,7 +83,7 @@ <h1>VideoBackground</h1>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
<p>Singleton instance that can be used to play a video.</p>

</div>
<div class="declaration">
Expand Down
2 changes: 1 addition & 1 deletion docs/Enums.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<a title="Enumerations Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html">SwiftVideoBackground Docs</a> (92% documented)</p>
<p><a href="index.html">SwiftVideoBackground Docs</a> (100% documented)</p>
<p class="header-right"><a href="https://github.com/dingwilson/SwiftVideoBackground"><img src="img/gh.png"/>View on GitHub</a></p>
</div>
</header>
Expand Down
2 changes: 1 addition & 1 deletion docs/Enums/VideoBackgroundError.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<a title="VideoBackgroundError Enumeration Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftVideoBackground Docs</a> (92% documented)</p>
<p><a href="../index.html">SwiftVideoBackground Docs</a> (100% documented)</p>
<p class="header-right"><a href="https://github.com/dingwilson/SwiftVideoBackground"><img src="../img/gh.png"/>View on GitHub</a></p>
</div>
</header>
Expand Down
2 changes: 1 addition & 1 deletion docs/Structs.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<a title="Structures Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html">SwiftVideoBackground Docs</a> (92% documented)</p>
<p><a href="index.html">SwiftVideoBackground Docs</a> (100% documented)</p>
<p class="header-right"><a href="https://github.com/dingwilson/SwiftVideoBackground"><img src="img/gh.png"/>View on GitHub</a></p>
</div>
</header>
Expand Down
2 changes: 1 addition & 1 deletion docs/Structs/VideoInfo.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<a title="VideoInfo Structure Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftVideoBackground Docs</a> (92% documented)</p>
<p><a href="../index.html">SwiftVideoBackground Docs</a> (100% documented)</p>
<p class="header-right"><a href="https://github.com/dingwilson/SwiftVideoBackground"><img src="../img/gh.png"/>View on GitHub</a></p>
</div>
</header>
Expand Down
16 changes: 8 additions & 8 deletions docs/badge.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<a title="Classes Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html">SwiftVideoBackground Docs</a> (92% documented)</p>
<p><a href="index.html">SwiftVideoBackground Docs</a> (100% documented)</p>
<p class="header-right"><a href="https://github.com/dingwilson/SwiftVideoBackground"><img src="img/gh.png"/>View on GitHub</a></p>
</div>
</header>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<a title="VideoBackground Class Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftVideoBackground Docs</a> (92% documented)</p>
<p><a href="../index.html">SwiftVideoBackground Docs</a> (100% documented)</p>
<p class="header-right"><a href="https://github.com/dingwilson/SwiftVideoBackground"><img src="../img/gh.png"/>View on GitHub</a></p>
</div>
</header>
Expand Down Expand Up @@ -83,7 +83,7 @@ <h1>VideoBackground</h1>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
<p>Singleton instance that can be used to play a video.</p>

</div>
<div class="declaration">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<a title="Enumerations Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html">SwiftVideoBackground Docs</a> (92% documented)</p>
<p><a href="index.html">SwiftVideoBackground Docs</a> (100% documented)</p>
<p class="header-right"><a href="https://github.com/dingwilson/SwiftVideoBackground"><img src="img/gh.png"/>View on GitHub</a></p>
</div>
</header>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<a title="VideoBackgroundError Enumeration Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftVideoBackground Docs</a> (92% documented)</p>
<p><a href="../index.html">SwiftVideoBackground Docs</a> (100% documented)</p>
<p class="header-right"><a href="https://github.com/dingwilson/SwiftVideoBackground"><img src="../img/gh.png"/>View on GitHub</a></p>
</div>
</header>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<a title="Structures Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html">SwiftVideoBackground Docs</a> (92% documented)</p>
<p><a href="index.html">SwiftVideoBackground Docs</a> (100% documented)</p>
<p class="header-right"><a href="https://github.com/dingwilson/SwiftVideoBackground"><img src="img/gh.png"/>View on GitHub</a></p>
</div>
</header>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<a title="VideoInfo Structure Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../index.html">SwiftVideoBackground Docs</a> (92% documented)</p>
<p><a href="../index.html">SwiftVideoBackground Docs</a> (100% documented)</p>
<p class="header-right"><a href="https://github.com/dingwilson/SwiftVideoBackground"><img src="../img/gh.png"/>View on GitHub</a></p>
</div>
</header>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<a title="SwiftVideoBackground Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html">SwiftVideoBackground Docs</a> (92% documented)</p>
<p><a href="index.html">SwiftVideoBackground Docs</a> (100% documented)</p>
<p class="header-right"><a href="https://github.com/dingwilson/SwiftVideoBackground"><img src="img/gh.png"/>View on GitHub</a></p>
</div>
</header>
Expand Down Expand Up @@ -85,6 +85,7 @@ <h2 id='features' class='heading'>Features</h2>
<li>Loop videos <em>(optional)</em></li>
<li>Mute sound <em>(optional)</em></li>
<li>Darken videos so overlying UI stands out more <em>(optional)</em></li>
<li><a href="http://wilsonding.com/SwiftVideoBackground/">Documentation</a></li>
</ul>
<h2 id='contents' class='heading'>Contents</h2>

Expand Down Expand Up @@ -114,7 +115,7 @@ <h4 id='cocoapods' class='heading'>CocoaPods</h4>
<p>You can use <a href="http://cocoapods.org/">CocoaPods</a> to install <code>SwiftVideoBackground</code> by adding it to your <code>Podfile</code>:</p>

<p>For Swift 4:</p>
<pre class="highlight ruby"><code> <span class="n">pod</span> <span class="s1">'SwiftVideoBackground'</span><span class="p">,</span> <span class="s1">'~&gt; 2.0'</span>
<pre class="highlight ruby"><code> <span class="n">pod</span> <span class="s1">'SwiftVideoBackground'</span><span class="p">,</span> <span class="s1">'~&gt; 2.1'</span>
</code></pre>

<p>For Swift 3:</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Structs/VideoInfo.html#/s:20SwiftVideoBackground0B4InfoV4nameSSv":{"name":"name","abstract":"<p>String name of the video.</p>","parent_name":"VideoInfo"},"Structs/VideoInfo.html#/s:20SwiftVideoBackground0B4InfoV4typeSSv":{"name":"type","abstract":"<p>String type of the video, e.g. <q>mp4</q></p>","parent_name":"VideoInfo"},"Structs/VideoInfo.html#/s:20SwiftVideoBackground0B4InfoVACSS4name_SS4typetcfc":{"name":"init(name:type:)","abstract":"<p>Initializes a <code>VideoInfo</code>.</p>","parent_name":"VideoInfo"},"Structs/VideoInfo.html":{"name":"VideoInfo","abstract":"<p>Contains data on a video to be played.</p>"},"Enums/VideoBackgroundError.html#/s:20SwiftVideoBackground0bC5ErrorO13videoNotFoundAcA0B4InfoVcACmF":{"name":"videoNotFound","abstract":"<p>The video with given name and type could not be found.</p>","parent_name":"VideoBackgroundError"},"Enums/VideoBackgroundError.html#/s:20SwiftVideoBackground0bC5ErrorO16errorDescriptionSSSgv":{"name":"errorDescription","abstract":"<p>Description of the error.</p>","parent_name":"VideoBackgroundError"},"Enums/VideoBackgroundError.html":{"name":"VideoBackgroundError","abstract":"<p>Errors that can occur when playing a video.</p>"},"Classes/VideoBackground.html#/s:20SwiftVideoBackground0bC0C6sharedACvZ":{"name":"shared","abstract":"<p>Undocumented</p>","parent_name":"VideoBackground"},"Classes/VideoBackground.html#/s:20SwiftVideoBackground0bC0CACycfc":{"name":"init()","abstract":"<p>Initializes a VideoBackground instance.</p>","parent_name":"VideoBackground"},"Classes/VideoBackground.html#/s:20SwiftVideoBackground0bC0C4playySo6UIViewC4view_SS9videoNameSS0G4TypeSb7isMuted12CoreGraphics7CGFloatV5alphaSb08willLoopB0tF":{"name":"play(view:videoName:videoType:isMuted:alpha:willLoopVideo:)","abstract":"<p>Plays a video on a UIView.</p>","parent_name":"VideoBackground"},"Classes/VideoBackground.html#/s:20SwiftVideoBackground0bC0C4playySo6UIViewC4view_SS4nameSS4typeSb7isMuted12CoreGraphics7CGFloatV5alphaSb08willLoopB0tKF":{"name":"play(view:name:type:isMuted:alpha:willLoopVideo:)","abstract":"<p>Plays a video on a UIView.</p>","parent_name":"VideoBackground"},"Classes/VideoBackground.html#/s:20SwiftVideoBackground0bC0C4playySo6UIViewC4view_SayAA0B4InfoVG10videoInfosSb7isMuted12CoreGraphics7CGFloatV5alphaSb08willLoopB0tKF":{"name":"play(view:videoInfos:isMuted:alpha:willLoopVideo:)","abstract":"<p>Plays videos one after another on a UIView.</p>","parent_name":"VideoBackground"},"Classes/VideoBackground.html":{"name":"VideoBackground","abstract":"<p>Class that plays a video on a UIView.</p>"},"Classes.html":{"name":"Classes","abstract":"<p>The following classes are available globally.</p>"},"Enums.html":{"name":"Enumerations","abstract":"<p>The following enumerations are available globally.</p>"},"Structs.html":{"name":"Structures","abstract":"<p>The following structures are available globally.</p>"}}
{"Structs/VideoInfo.html#/s:20SwiftVideoBackground0B4InfoV4nameSSv":{"name":"name","abstract":"<p>String name of the video.</p>","parent_name":"VideoInfo"},"Structs/VideoInfo.html#/s:20SwiftVideoBackground0B4InfoV4typeSSv":{"name":"type","abstract":"<p>String type of the video, e.g. <q>mp4</q></p>","parent_name":"VideoInfo"},"Structs/VideoInfo.html#/s:20SwiftVideoBackground0B4InfoVACSS4name_SS4typetcfc":{"name":"init(name:type:)","abstract":"<p>Initializes a <code>VideoInfo</code>.</p>","parent_name":"VideoInfo"},"Structs/VideoInfo.html":{"name":"VideoInfo","abstract":"<p>Contains data on a video to be played.</p>"},"Enums/VideoBackgroundError.html#/s:20SwiftVideoBackground0bC5ErrorO13videoNotFoundAcA0B4InfoVcACmF":{"name":"videoNotFound","abstract":"<p>The video with given name and type could not be found.</p>","parent_name":"VideoBackgroundError"},"Enums/VideoBackgroundError.html#/s:20SwiftVideoBackground0bC5ErrorO16errorDescriptionSSSgv":{"name":"errorDescription","abstract":"<p>Description of the error.</p>","parent_name":"VideoBackgroundError"},"Enums/VideoBackgroundError.html":{"name":"VideoBackgroundError","abstract":"<p>Errors that can occur when playing a video.</p>"},"Classes/VideoBackground.html#/s:20SwiftVideoBackground0bC0C6sharedACvZ":{"name":"shared","abstract":"<p>Singleton instance that can be used to play a video.</p>","parent_name":"VideoBackground"},"Classes/VideoBackground.html#/s:20SwiftVideoBackground0bC0CACycfc":{"name":"init()","abstract":"<p>Initializes a VideoBackground instance.</p>","parent_name":"VideoBackground"},"Classes/VideoBackground.html#/s:20SwiftVideoBackground0bC0C4playySo6UIViewC4view_SS9videoNameSS0G4TypeSb7isMuted12CoreGraphics7CGFloatV5alphaSb08willLoopB0tF":{"name":"play(view:videoName:videoType:isMuted:alpha:willLoopVideo:)","abstract":"<p>Plays a video on a UIView.</p>","parent_name":"VideoBackground"},"Classes/VideoBackground.html#/s:20SwiftVideoBackground0bC0C4playySo6UIViewC4view_SS4nameSS4typeSb7isMuted12CoreGraphics7CGFloatV5alphaSb08willLoopB0tKF":{"name":"play(view:name:type:isMuted:alpha:willLoopVideo:)","abstract":"<p>Plays a video on a UIView.</p>","parent_name":"VideoBackground"},"Classes/VideoBackground.html#/s:20SwiftVideoBackground0bC0C4playySo6UIViewC4view_SayAA0B4InfoVG10videoInfosSb7isMuted12CoreGraphics7CGFloatV5alphaSb08willLoopB0tKF":{"name":"play(view:videoInfos:isMuted:alpha:willLoopVideo:)","abstract":"<p>Plays videos one after another on a UIView.</p>","parent_name":"VideoBackground"},"Classes/VideoBackground.html":{"name":"VideoBackground","abstract":"<p>Class that plays a video on a UIView.</p>"},"Classes.html":{"name":"Classes","abstract":"<p>The following classes are available globally.</p>"},"Enums.html":{"name":"Enumerations","abstract":"<p>The following enumerations are available globally.</p>"},"Structs.html":{"name":"Structures","abstract":"<p>The following structures are available globally.</p>"}}
Binary file modified docs/docsets/SwiftVideoBackground.tgz
Binary file not shown.
5 changes: 3 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<a title="SwiftVideoBackground Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="index.html">SwiftVideoBackground Docs</a> (92% documented)</p>
<p><a href="index.html">SwiftVideoBackground Docs</a> (100% documented)</p>
<p class="header-right"><a href="https://github.com/dingwilson/SwiftVideoBackground"><img src="img/gh.png"/>View on GitHub</a></p>
</div>
</header>
Expand Down Expand Up @@ -85,6 +85,7 @@ <h2 id='features' class='heading'>Features</h2>
<li>Loop videos <em>(optional)</em></li>
<li>Mute sound <em>(optional)</em></li>
<li>Darken videos so overlying UI stands out more <em>(optional)</em></li>
<li><a href="http://wilsonding.com/SwiftVideoBackground/">Documentation</a></li>
</ul>
<h2 id='contents' class='heading'>Contents</h2>

Expand Down Expand Up @@ -114,7 +115,7 @@ <h4 id='cocoapods' class='heading'>CocoaPods</h4>
<p>You can use <a href="http://cocoapods.org/">CocoaPods</a> to install <code>SwiftVideoBackground</code> by adding it to your <code>Podfile</code>:</p>

<p>For Swift 4:</p>
<pre class="highlight ruby"><code> <span class="n">pod</span> <span class="s1">'SwiftVideoBackground'</span><span class="p">,</span> <span class="s1">'~&gt; 2.0'</span>
<pre class="highlight ruby"><code> <span class="n">pod</span> <span class="s1">'SwiftVideoBackground'</span><span class="p">,</span> <span class="s1">'~&gt; 2.1'</span>
</code></pre>

<p>For Swift 3:</p>
Expand Down
Loading

0 comments on commit f7e2077

Please sign in to comment.