Skip to content

Commit

Permalink
[Examples] Add post-roll example
Browse files Browse the repository at this point in the history
  • Loading branch information
isair committed Dec 10, 2015
1 parent 0ba280c commit 0440658
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 0 deletions.
8 changes: 8 additions & 0 deletions MobilePlayer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
5F3F03CD1C18EA4900EF50C4 /* PrerollOverlayViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5F3F03CC1C18EA4900EF50C4 /* PrerollOverlayViewController.xib */; };
5F3F03CF1C18F3DA00EF50C4 /* PauseOverlayViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F3F03CE1C18F3DA00EF50C4 /* PauseOverlayViewController.swift */; };
5F3F03D11C18FED600EF50C4 /* PauseOverlayViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5F3F03D01C18FED600EF50C4 /* PauseOverlayViewController.xib */; };
5F3F03D31C1903E200EF50C4 /* PostrollOverlayViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F3F03D21C1903E200EF50C4 /* PostrollOverlayViewController.swift */; };
5F3F03D51C1903EF00EF50C4 /* PostrollOverlayViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5F3F03D41C1903EF00EF50C4 /* PostrollOverlayViewController.xib */; };
5F4CED431C054A5200EF50C4 /* WatermarkedPlayer.json in Resources */ = {isa = PBXBuildFile; fileRef = 5F4CED421C054A5200EF50C4 /* WatermarkedPlayer.json */; };
5F56CB721C0407F200EF50C4 /* MobilePlayerExampleStores.h in Headers */ = {isa = PBXBuildFile; fileRef = 5F56CB711C0407F200EF50C4 /* MobilePlayerExampleStores.h */; settings = {ATTRIBUTES = (Public, ); }; };
5F56CB7C1C04080500EF50C4 /* ProductStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5F56CB7B1C04080500EF50C4 /* ProductStore.swift */; };
Expand Down Expand Up @@ -150,6 +152,8 @@
5F3F03CC1C18EA4900EF50C4 /* PrerollOverlayViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PrerollOverlayViewController.xib; sourceTree = "<group>"; };
5F3F03CE1C18F3DA00EF50C4 /* PauseOverlayViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PauseOverlayViewController.swift; sourceTree = "<group>"; };
5F3F03D01C18FED600EF50C4 /* PauseOverlayViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PauseOverlayViewController.xib; sourceTree = "<group>"; };
5F3F03D21C1903E200EF50C4 /* PostrollOverlayViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PostrollOverlayViewController.swift; sourceTree = "<group>"; };
5F3F03D41C1903EF00EF50C4 /* PostrollOverlayViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PostrollOverlayViewController.xib; sourceTree = "<group>"; };
5F4CED421C054A5200EF50C4 /* WatermarkedPlayer.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; name = WatermarkedPlayer.json; path = Resources/WatermarkedPlayer.json; sourceTree = "<group>"; };
5F56CB6F1C0407F200EF50C4 /* MobilePlayerExampleStores.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = MobilePlayerExampleStores.framework; sourceTree = BUILT_PRODUCTS_DIR; };
5F56CB711C0407F200EF50C4 /* MobilePlayerExampleStores.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MobilePlayerExampleStores.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -315,6 +319,8 @@
5F3F03CC1C18EA4900EF50C4 /* PrerollOverlayViewController.xib */,
5F3F03CE1C18F3DA00EF50C4 /* PauseOverlayViewController.swift */,
5F3F03D01C18FED600EF50C4 /* PauseOverlayViewController.xib */,
5F3F03D21C1903E200EF50C4 /* PostrollOverlayViewController.swift */,
5F3F03D41C1903EF00EF50C4 /* PostrollOverlayViewController.xib */,
);
name = Overlays;
sourceTree = "<group>";
Expand Down Expand Up @@ -718,6 +724,7 @@
5F4CED431C054A5200EF50C4 /* WatermarkedPlayer.json in Resources */,
5F3F03CD1C18EA4900EF50C4 /* PrerollOverlayViewController.xib in Resources */,
5F56CB901C040E8D00EF50C4 /* LaunchScreen.storyboard in Resources */,
5F3F03D51C1903EF00EF50C4 /* PostrollOverlayViewController.xib in Resources */,
5FF829691C16924400EF50C4 /* MovielalaPlayer.json in Resources */,
5F56CB8D1C040E8D00EF50C4 /* Assets.xcassets in Resources */,
);
Expand Down Expand Up @@ -787,6 +794,7 @@
5F79747C1C17ED7800EF50C4 /* TimedOverlayExampleViewController.swift in Sources */,
5F3F03CF1C18F3DA00EF50C4 /* PauseOverlayViewController.swift in Sources */,
5FF829671C168E4700EF50C4 /* ProgConfigExampleViewController.swift in Sources */,
5F3F03D31C1903E200EF50C4 /* PostrollOverlayViewController.swift in Sources */,
5F7974781C17B02200EF50C4 /* OverlayExampleViewController.swift in Sources */,
5F56CBB71C041DAE00EF50C4 /* RemoteConfigExampleViewController.swift in Sources */,
5F56CBB31C04179700EF50C4 /* ExampleViewController.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "PostrollExampleCode.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.
6 changes: 6 additions & 0 deletions MobilePlayerExamples/PostrollExampleViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,11 @@ class PostrollExampleViewController: ExampleViewController {
}

override func showButtonDidGetTapped() {
let playerVC = MobilePlayerViewController(
contentURL: videoURL,
postrollViewController: PostrollOverlayViewController())
playerVC.title = videoTitle
playerVC.activityItems = [videoURL]
presentMoviePlayerViewControllerAnimated(playerVC)
}
}
22 changes: 22 additions & 0 deletions MobilePlayerExamples/PostrollOverlayViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// PostrollOverlayViewController.swift
// MobilePlayer
//
// Created by Baris Sencan on 09/12/2015.
// Copyright © 2015 MovieLaLa. All rights reserved.
//

import Foundation
import Foundation
import MobilePlayer

class PostrollOverlayViewController: MobilePlayerOverlayViewController {

init() {
super.init(nibName: "PostrollOverlayViewController", bundle: nil)
}

required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
44 changes: 44 additions & 0 deletions MobilePlayerExamples/PostrollOverlayViewController.xib
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9060" systemVersion="15B42" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9051"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="PostrollOverlayViewController" customModule="MobilePlayerExamples" customModuleProvider="target">
<connections>
<outlet property="view" destination="iN0-l3-epB" id="M6u-gr-ijO"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="This is a post-roll overlay; shown automatically when playback completes and dismissed if it starts again." textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="TKZ-Yq-MKN">
<rect key="frame" x="12" y="279" width="576" height="41"/>
<animations/>
<fontDescription key="fontDescription" type="system" weight="light" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="MovielalaLogo" translatesAutoresizingMaskIntoConstraints="NO" id="2Fo-g7-MLe">
<rect key="frame" x="225" y="214" width="150" height="57"/>
<animations/>
</imageView>
</subviews>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="TKZ-Yq-MKN" firstAttribute="width" secondItem="iN0-l3-epB" secondAttribute="width" constant="-24" id="FGT-6H-cLW"/>
<constraint firstItem="TKZ-Yq-MKN" firstAttribute="top" secondItem="2Fo-g7-MLe" secondAttribute="bottom" constant="8" id="K98-VL-RGH"/>
<constraint firstItem="TKZ-Yq-MKN" firstAttribute="centerY" secondItem="iN0-l3-epB" secondAttribute="centerY" id="Req-Dx-8yf"/>
<constraint firstItem="2Fo-g7-MLe" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="TTk-Hd-4iH"/>
<constraint firstItem="TKZ-Yq-MKN" firstAttribute="centerX" secondItem="iN0-l3-epB" secondAttribute="centerX" id="zWg-uZ-ZOM"/>
</constraints>
</view>
</objects>
<resources>
<image name="MovielalaLogo" width="150" height="57"/>
</resources>
</document>

0 comments on commit 0440658

Please sign in to comment.