Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2 from hollanderbart/fix-build
Browse files Browse the repository at this point in the history
Include NPOStream dependency
  • Loading branch information
hollanderbart authored Nov 4, 2017
2 parents 307d005 + 2639f53 commit 73986e4
Show file tree
Hide file tree
Showing 18 changed files with 458 additions and 182 deletions.
9 changes: 6 additions & 3 deletions NPO Live/PlayerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,17 @@ class PlayerViewController: AVPlayerViewController {

playerItem.externalMetadata.append(titleMetadataItem)

if let image = UIImage(named: channel.title) {
if
let image = UIImage(named: channel.title) {
let logo: AVMetadataItem = {
let _logo = AVMutableMetadataItem()
_logo.locale = Locale.current
_logo.key = AVMetadataKey.commonKeyArtwork as NSCopying & NSObjectProtocol
_logo.keySpace = AVMetadataKeySpace.common
_logo.value = UIImagePNGRepresentation(image) as? NSCopying & NSObjectProtocol

if let imagePNG = UIImagePNGRepresentation(image) {
_logo.value = imagePNG as NSCopying & NSObjectProtocol
}

return _logo
}()

Expand Down
53 changes: 0 additions & 53 deletions NPO Live/String+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,61 +9,8 @@
import Foundation

extension String {

func sliceFrom(_ start: String, to: String) -> String? {
return (range(of: start)?.upperBound)
.flatMap { sInd in
(range(of: to, range: sInd ..< endIndex)?.lowerBound)
.map { eInd in
substring(with: sInd ..< eInd)
}
}
}

var encodeURIComponent: String? {
return self.addingPercentEncoding(withAllowedCharacters: CharacterSet.urlQueryAllowed)
}

var decodeJSONUri: String {
return self.replacingOccurrences(of: "\\/", with: "/")
}

subscript (i: Int) -> Character {
get {
let index = characters.index(startIndex, offsetBy: i)
return self[index]
}
}

func setCharAt(_ index: Int, character: Character) -> String {
if index > self.characters.count - 1 {
return self
}

return self.subString(0, length: index) + String(character) + self.subString(index + 1, length: self.characters.count - index)
}

func subString(_ startIndex: Int, length: Int) -> String {
let start = self.characters.index(self.startIndex, offsetBy: startIndex)
let end = self.characters.index(self.startIndex, offsetBy: startIndex+length, limitedBy: self.characters.index(self.startIndex, offsetBy: self.characters.count))

return self.substring(with: (start ..< end!))
}

func htmlDecoded() -> String {
guard (self != "") else { return self }
var newStr = self
let entities = [
"&quot;" : "\"",
"&amp;" : "&",
"&apos;" : "'",
"&lt;" : "<",
"&gt;" : ">",
]

for (name,value) in entities {
newStr = newStr.replacingOccurrences(of: name, with: value)
}
return newStr
}
}
3 changes: 2 additions & 1 deletion Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ target 'NPO Live' do
use_frameworks!

# Pods for NPO Live
pod "NPOStream", :path => "../NPOStream/"
pod "NPOStream", "~> 0.0.6"

end
10 changes: 3 additions & 7 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@ PODS:
- NPOStream (0.0.6)

DEPENDENCIES:
- NPOStream (from `../NPOStream/`)

EXTERNAL SOURCES:
NPOStream:
:path: ../NPOStream/
- NPOStream (~> 0.0.6)

SPEC CHECKSUMS:
NPOStream: 2421d98cf68c89d2e22413023f3ba45bc20f3331
NPOStream: b22327c59cd8272e978cc961a4d343add4c80981

PODFILE CHECKSUM: 6f5845b39f165f24029830281b2f97933a1714c0
PODFILE CHECKSUM: e9d2ebf6f588c90d78d9f034ed311a29e4943ca2

COCOAPODS: 1.2.1
10 changes: 3 additions & 7 deletions Pods/Manifest.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions Pods/NPOStream/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions Pods/NPOStream/NPOStream/Channel.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

83 changes: 83 additions & 0 deletions Pods/NPOStream/NPOStream/ChannelProvider.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions Pods/NPOStream/NPOStream/Info.plist

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions Pods/NPOStream/NPOStream/NPOStream.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

63 changes: 63 additions & 0 deletions Pods/NPOStream/NPOStream/NPOStream.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions Pods/NPOStream/NPOStream/NPOStreamError.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions Pods/NPOStream/NPOStream/Result.swift

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 73986e4

Please sign in to comment.