Skip to content

Commit

Permalink
[Examples] Add programmatic configuration example
Browse files Browse the repository at this point in the history
  • Loading branch information
isair committed Dec 8, 2015
1 parent 5b8e304 commit b100027
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 1 deletion.
4 changes: 4 additions & 0 deletions MobilePlayer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
5FBFEA361BA8AD0200EF50C4 /* SliderConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FBFEA351BA8AD0200EF50C4 /* SliderConfig.swift */; };
5FD756941BAC494800EF50C4 /* WatermarkConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FD756931BAC494800EF50C4 /* WatermarkConfig.swift */; };
5FD756961BAC4AE700EF50C4 /* WatermarkViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FD756951BAC4AE700EF50C4 /* WatermarkViewController.swift */; };
5FF829671C168E4700EF50C4 /* ProgConfigExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5FF829661C168E4700EF50C4 /* ProgConfigExampleViewController.swift */; };
C308B3C01B150F7600CB1515 /* MobilePlayerConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = C308B3BE1B150F7600CB1515 /* MobilePlayerConfig.swift */; };
C35497A31B70007500FDDBFF /* SkinTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = C35497A21B70007500FDDBFF /* SkinTests.swift */; };
C38833C91B266C2500918C94 /* Skin.json in Resources */ = {isa = PBXBuildFile; fileRef = C38833C81B266C2500918C94 /* Skin.json */; };
Expand Down Expand Up @@ -189,6 +190,7 @@
5FBFEA351BA8AD0200EF50C4 /* SliderConfig.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SliderConfig.swift; sourceTree = "<group>"; };
5FD756931BAC494800EF50C4 /* WatermarkConfig.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WatermarkConfig.swift; sourceTree = "<group>"; };
5FD756951BAC4AE700EF50C4 /* WatermarkViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WatermarkViewController.swift; sourceTree = "<group>"; };
5FF829661C168E4700EF50C4 /* ProgConfigExampleViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProgConfigExampleViewController.swift; sourceTree = "<group>"; };
6CCEC38BCAA197BDB85EEE44 /* Pods-MobilePlayer.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MobilePlayer.release.xcconfig"; path = "Pods/Target Support Files/Pods-MobilePlayer/Pods-MobilePlayer.release.xcconfig"; sourceTree = "<group>"; };
AAC564F266BFE6E6667728D5 /* Pods-MobilePlayer.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MobilePlayer.debug.xcconfig"; path = "Pods/Target Support Files/Pods-MobilePlayer/Pods-MobilePlayer.debug.xcconfig"; sourceTree = "<group>"; };
C308B3BE1B150F7600CB1515 /* MobilePlayerConfig.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MobilePlayerConfig.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -283,6 +285,7 @@
5F56CBB01C04178C00EF50C4 /* PlainExampleViewController.swift */,
5F56CBB41C041DA200EF50C4 /* ConfigExampleViewController.swift */,
5F56CBB61C041DAE00EF50C4 /* RemoteConfigExampleViewController.swift */,
5FF829661C168E4700EF50C4 /* ProgConfigExampleViewController.swift */,
5F56CB8C1C040E8D00EF50C4 /* Assets.xcassets */,
5F56CB8E1C040E8D00EF50C4 /* LaunchScreen.storyboard */,
5F56CB911C040E8D00EF50C4 /* Info.plist */,
Expand Down Expand Up @@ -724,6 +727,7 @@
buildActionMask = 2147483647;
files = (
5F56CB841C040E8D00EF50C4 /* AppDelegate.swift in Sources */,
5FF829671C168E4700EF50C4 /* ProgConfigExampleViewController.swift in Sources */,
5F56CBB71C041DAE00EF50C4 /* RemoteConfigExampleViewController.swift in Sources */,
5F56CBB31C04179700EF50C4 /* ExampleViewController.swift in Sources */,
5F56CBB11C04178C00EF50C4 /* PlainExampleViewController.swift in Sources */,
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "ProgConfigExampleCode.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion MobilePlayerExamples/ExamplesTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ import UIKit

class ExamplesTableViewController: UITableViewController {
private let cellReuseIdentifier = "exampleCell"
private let examples = [PlainExampleViewController(), ConfigExampleViewController(), RemoteConfigExampleViewController()]
private let examples = [
PlainExampleViewController(),
ConfigExampleViewController(),
RemoteConfigExampleViewController(),
ProgConfigExampleViewController()
]

init() {
super.init(nibName: nil, bundle: nil)
Expand Down
33 changes: 33 additions & 0 deletions MobilePlayerExamples/ProgConfigExampleViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// ProgConfigExampleViewController.swift
// MobilePlayer
//
// Created by Baris Sencan on 07/12/2015.
// Copyright © 2015 MovieLaLa. All rights reserved.
//

import UIKit
import MobilePlayer

class ProgConfigExampleViewController: ExampleViewController {

override init() {
super.init()
title = "Programmatic Configuration"
codeImageView.image = UIImage(named: "ProgConfigExampleCode")
}

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

override func showButtonDidGetTapped() {
let playerVC = MobilePlayerViewController(
contentURL: videoURL,
config: MobilePlayerConfig(
dictionary: ["watermark": ["image": "MovielalaLogo"]]))
playerVC.title = "Watermarked Player - \(videoTitle)"
playerVC.activityItems = [videoURL]
presentMoviePlayerViewControllerAnimated(playerVC)
}
}

0 comments on commit b100027

Please sign in to comment.