Skip to content

Commit

Permalink
start-up reverse proxy only when required
Browse files Browse the repository at this point in the history
include additional examples
  • Loading branch information
andrewjl-mux committed May 8, 2024
1 parent f64c27a commit 56dc7e3
Show file tree
Hide file tree
Showing 9 changed files with 639 additions and 179 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
/* Begin PBXBuildFile section */
193228BB2ACF6AC700966FE1 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 193228BA2ACF6AC700966FE1 /* AppDelegate.swift */; };
193228BD2ACF6AC700966FE1 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 193228BC2ACF6AC700966FE1 /* SceneDelegate.swift */; };
193228BF2ACF6AC700966FE1 /* MainViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 193228BE2ACF6AC700966FE1 /* MainViewController.swift */; };
193228C22ACF6AC700966FE1 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 193228C02ACF6AC700966FE1 /* Main.storyboard */; };
193228C42ACF6AC800966FE1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 193228C32ACF6AC800966FE1 /* Assets.xcassets */; };
193228C72ACF6AC800966FE1 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 193228C52ACF6AC800966FE1 /* LaunchScreen.storyboard */; };
Expand All @@ -18,6 +17,9 @@
193228DE2ACF6AC900966FE1 /* MuxPlayerSwiftExampleUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 193228DD2ACF6AC900966FE1 /* MuxPlayerSwiftExampleUITestsLaunchTests.swift */; };
193228EC2ACF6B3400966FE1 /* MuxPlayerSwift in Frameworks */ = {isa = PBXBuildFile; productRef = 193228EB2ACF6B3400966FE1 /* MuxPlayerSwift */; };
1966C5302BEB4740005486D5 /* ProcessInfo+EnvironmentVariables.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1966C52F2BEB4740005486D5 /* ProcessInfo+EnvironmentVariables.swift */; };
19DD16AF2BEC010400F4DF4F /* SinglePlayerExampleController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19DD16AE2BEC010400F4DF4F /* SinglePlayerExampleController.swift */; };
19DD16B12BEC028C00F4DF4F /* SmartCacheExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19DD16B02BEC028C00F4DF4F /* SmartCacheExampleViewController.swift */; };
19DD16B32BEC048300F4DF4F /* SinglePlayerLayerExampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19DD16B22BEC048300F4DF4F /* SinglePlayerLayerExampleViewController.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -41,7 +43,6 @@
193228B72ACF6AC700966FE1 /* MuxPlayerSwiftExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MuxPlayerSwiftExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
193228BA2ACF6AC700966FE1 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
193228BC2ACF6AC700966FE1 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
193228BE2ACF6AC700966FE1 /* MainViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainViewController.swift; sourceTree = "<group>"; };
193228C12ACF6AC700966FE1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
193228C32ACF6AC800966FE1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
193228C62ACF6AC800966FE1 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
Expand All @@ -52,6 +53,9 @@
193228DB2ACF6AC900966FE1 /* MuxPlayerSwiftExampleUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MuxPlayerSwiftExampleUITests.swift; sourceTree = "<group>"; };
193228DD2ACF6AC900966FE1 /* MuxPlayerSwiftExampleUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MuxPlayerSwiftExampleUITestsLaunchTests.swift; sourceTree = "<group>"; };
1966C52F2BEB4740005486D5 /* ProcessInfo+EnvironmentVariables.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "ProcessInfo+EnvironmentVariables.swift"; sourceTree = "<group>"; };
19DD16AE2BEC010400F4DF4F /* SinglePlayerExampleController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SinglePlayerExampleController.swift; sourceTree = "<group>"; };
19DD16B02BEC028C00F4DF4F /* SmartCacheExampleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SmartCacheExampleViewController.swift; sourceTree = "<group>"; };
19DD16B22BEC048300F4DF4F /* SinglePlayerLayerExampleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SinglePlayerLayerExampleViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -105,7 +109,9 @@
children = (
193228BA2ACF6AC700966FE1 /* AppDelegate.swift */,
193228BC2ACF6AC700966FE1 /* SceneDelegate.swift */,
193228BE2ACF6AC700966FE1 /* MainViewController.swift */,
19DD16AE2BEC010400F4DF4F /* SinglePlayerExampleController.swift */,
19DD16B02BEC028C00F4DF4F /* SmartCacheExampleViewController.swift */,
19DD16B22BEC048300F4DF4F /* SinglePlayerLayerExampleViewController.swift */,
193228C02ACF6AC700966FE1 /* Main.storyboard */,
193228C32ACF6AC800966FE1 /* Assets.xcassets */,
193228C52ACF6AC800966FE1 /* LaunchScreen.storyboard */,
Expand Down Expand Up @@ -269,8 +275,10 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
193228BF2ACF6AC700966FE1 /* MainViewController.swift in Sources */,
19DD16B32BEC048300F4DF4F /* SinglePlayerLayerExampleViewController.swift in Sources */,
193228BB2ACF6AC700966FE1 /* AppDelegate.swift in Sources */,
19DD16B12BEC028C00F4DF4F /* SmartCacheExampleViewController.swift in Sources */,
19DD16AF2BEC010400F4DF4F /* SinglePlayerExampleController.swift in Sources */,
1966C5302BEB4740005486D5 /* ProcessInfo+EnvironmentVariables.swift in Sources */,
193228BD2ACF6AC700966FE1 /* SceneDelegate.swift in Sources */,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
<rect key="frame" x="0.0" y="0.0" width="393" height="88"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Basic AVKit Example" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="2B6-Ra-0LL">
<rect key="frame" x="20" y="21.333333333333329" width="179.33333333333334" height="24"/>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Single Player Example" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="2B6-Ra-0LL" userLabel="Single Player Example">
<rect key="frame" x="20" y="21.333333333333329" width="192" height="24"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="20"/>
<nil key="textColor"/>
Expand All @@ -47,15 +47,42 @@
<segue destination="BYZ-38-t0r" kind="show" id="dET-KM-oHN"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" textLabel="3V8-cN-wHE" detailTextLabel="vof-0E-Ts3" rowHeight="88" style="IBUITableViewCellStyleSubtitle" id="7Ub-rm-FrO">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" textLabel="xkN-F9-pLN" detailTextLabel="7HI-AU-2S9" rowHeight="88" style="IBUITableViewCellStyleSubtitle" id="ab1-hf-fKH">
<rect key="frame" x="0.0" y="138" width="393" height="88"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="ab1-hf-fKH" id="NZP-hO-bjF">
<rect key="frame" x="0.0" y="0.0" width="393" height="88"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Smart Cache Example" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="xkN-F9-pLN" userLabel="Smart Cache Example">
<rect key="frame" x="20" y="21.333333333333329" width="193.33333333333334" height="24"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="20"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Using AVPlayerViewController" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="7HI-AU-2S9">
<rect key="frame" x="20" y="49" width="169.33333333333334" height="14.333333333333334"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="0.0"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue destination="Yly-Kg-jpw" kind="show" id="dDj-cY-Cha"/>
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="default" indentationWidth="10" textLabel="3V8-cN-wHE" detailTextLabel="vof-0E-Ts3" rowHeight="88" style="IBUITableViewCellStyleSubtitle" id="7Ub-rm-FrO">
<rect key="frame" x="0.0" y="226" width="393" height="88"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="7Ub-rm-FrO" id="rm2-cf-faX">
<rect key="frame" x="0.0" y="0.0" width="393" height="88"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Player Layer Example" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="3V8-cN-wHE">
<rect key="frame" x="20" y="21.333333333333329" width="186" height="24"/>
<label opaque="NO" multipleTouchEnabled="YES" contentMode="left" insetsLayoutMarginsFromSafeArea="NO" text="Single Player Layer Example" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="3V8-cN-wHE" userLabel="Single Player Layer Example">
<rect key="frame" x="19.999999999999986" y="21.333333333333329" width="244.66666666666666" height="24"/>
<autoresizingMask key="autoresizingMask"/>
<fontDescription key="fontDescription" type="system" pointSize="20"/>
<nil key="textColor"/>
Expand All @@ -70,6 +97,9 @@
</label>
</subviews>
</tableViewCellContentView>
<connections>
<segue destination="JrU-9c-zyG" kind="show" id="q3v-VV-Yv9"/>
</connections>
</tableViewCell>
</cells>
</tableViewSection>
Expand All @@ -85,20 +115,21 @@
</objects>
<point key="canvasLocation" x="-1095" y="-94"/>
</scene>
<!--View Controller-->
<!--Smart Cache Example View Controller-->
<scene sceneID="uMF-mp-lAo">
<objects>
<viewController id="Yly-Kg-jpw" sceneMemberID="viewController">
<viewController id="Yly-Kg-jpw" customClass="SmartCacheExampleViewController" customModule="MuxPlayerSwiftExample" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="jeE-3u-3Pt">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<viewLayoutGuide key="safeArea" id="5Od-pm-2EA"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
<navigationItem key="navigationItem" id="ewG-T6-Pq1"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="RFi-ME-QBi" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-83" y="232"/>
<point key="canvasLocation" x="608" y="-116"/>
</scene>
<!--Experimental Cache View Controller-->
<scene sceneID="e4E-2r-LPD">
Expand All @@ -116,6 +147,22 @@
</objects>
<point key="canvasLocation" x="-1095" y="754"/>
</scene>
<!--Single Player Layer Example View Controller-->
<scene sceneID="Uuu-F8-ITi">
<objects>
<viewController id="JrU-9c-zyG" customClass="SinglePlayerLayerExampleViewController" customModule="MuxPlayerSwiftExample" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="D7I-9K-v0W">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<viewLayoutGuide key="safeArea" id="yZ3-yd-HWZ"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</view>
<navigationItem key="navigationItem" id="KJY-ai-G61"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="Uka-0a-JlQ" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-161" y="271"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="2gk-Ck-Rao">
<objects>
Expand All @@ -132,10 +179,10 @@
</objects>
<point key="canvasLocation" x="-2271" y="-93"/>
</scene>
<!--Main View Controller-->
<!--Single Player Example Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="MainViewController" customModule="MuxPlayerSwiftExample" customModuleProvider="target" sceneMemberID="viewController">
<viewController id="BYZ-38-t0r" customClass="SinglePlayerExampleController" customModule="MuxPlayerSwiftExample" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="393" height="852"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// MainViewController.swift
// SinglePlayerExampleController.swift
// MuxPlayerSwiftExample
//

Expand All @@ -11,7 +11,7 @@ import UIKit
import MuxPlayerSwift

// Single player example
class MainViewController: UIViewController {
class SinglePlayerExampleController: UIViewController {

// MARK: Player View Controller

Expand All @@ -21,7 +21,7 @@ class MainViewController: UIViewController {

// MARK: Mux Data Monitoring Parameters

var playerName: String = "MuxPlayerSwiftExample-MainPlayer"
var playerName: String = "MuxPlayerSwift-SinglePlayerExample"

var environmentKey: String? {
ProcessInfo.processInfo.environmentKey
Expand Down Expand Up @@ -203,7 +203,7 @@ class MainViewController: UIViewController {
]
)

let playbackModifiersMenu = UIMenu(
let optionsMenu = UIMenu(
children: [
maximumResolutionsMenu,
minimumResolutionsMenu,
Expand All @@ -213,8 +213,8 @@ class MainViewController: UIViewController {


navigationItem.rightBarButtonItem = UIBarButtonItem(
title: "Adjust Playback Modifiers",
menu: playbackModifiersMenu
title: "Adjust SDK Options",
menu: optionsMenu
)

displayPlayerViewController()
Expand Down Expand Up @@ -243,12 +243,6 @@ class MainViewController: UIViewController {
.view
.translatesAutoresizingMaskIntoConstraints = false
view.addConstraints([
playerViewController.view.centerXAnchor.constraint(
equalTo: view.centerXAnchor
),
playerViewController.view.centerYAnchor.constraint(
equalTo: view.centerYAnchor
),
playerViewController.view.leadingAnchor.constraint(
equalTo: view.leadingAnchor
),
Expand Down
Loading

0 comments on commit 56dc7e3

Please sign in to comment.