Skip to content

Commit

Permalink
update .gitignore
Browse files Browse the repository at this point in the history
chore: update example

ci: add script to archive example package

update .gitignore
  • Loading branch information
andrewjl-mux committed Nov 6, 2024
1 parent 9875350 commit e1f76fa
Show file tree
Hide file tree
Showing 71 changed files with 441 additions and 89 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# OS X
.DS_Store

**/.build
**/Build

**/DistributionSummary.plist
**/ExportOptions.plist
**/Packaging.log
**/Payload/*
**/*.ipa

# Xcode
build/
*.pbxuser
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
19330C852CDB4A2C00F9221E /* MuxStatsGoogleIMAPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 19330C842CDB4A2C00F9221E /* MuxStatsGoogleIMAPlugin */; };
193D52B62CAB6B32004F20AA /* MuxStatsGoogleIMAPlugin in Frameworks */ = {isa = PBXBuildFile; productRef = 193D52B52CAB6B32004F20AA /* MuxStatsGoogleIMAPlugin */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -70,6 +71,7 @@
buildActionMask = 2147483647;
files = (
193D52B62CAB6B32004F20AA /* MuxStatsGoogleIMAPlugin in Frameworks */,
19330C852CDB4A2C00F9221E /* MuxStatsGoogleIMAPlugin in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -131,6 +133,7 @@
name = MuxStatsGoogleIMAPluginSPMExampleIOS;
packageProductDependencies = (
193D52B52CAB6B32004F20AA /* MuxStatsGoogleIMAPlugin */,
19330C842CDB4A2C00F9221E /* MuxStatsGoogleIMAPlugin */,
);
productName = MuxStatsGoogleIMAPluginSPMExampleIOS;
productReference = 193D52812CAB698F004F20AA /* MuxStatsGoogleIMAPluginSPMExampleIOS.app */;
Expand Down Expand Up @@ -215,7 +218,7 @@
mainGroup = 193D52782CAB698F004F20AA;
minimizedProjectReferenceProxies = 1;
packageReferences = (
193D52B42CAB6B32004F20AA /* XCLocalSwiftPackageReference "../../mux-stats-google-ima" */,
19330C832CDB4A2C00F9221E /* XCLocalSwiftPackageReference "../../../mux-stats-google-ima" */,
);
preferredProjectObjectVersion = 77;
productRefGroup = 193D52822CAB698F004F20AA /* Products */;
Expand Down Expand Up @@ -584,13 +587,17 @@
/* End XCConfigurationList section */

/* Begin XCLocalSwiftPackageReference section */
193D52B42CAB6B32004F20AA /* XCLocalSwiftPackageReference "../../mux-stats-google-ima" */ = {
19330C832CDB4A2C00F9221E /* XCLocalSwiftPackageReference "../../../mux-stats-google-ima" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = "../../mux-stats-google-ima";
relativePath = "../../../mux-stats-google-ima";
};
/* End XCLocalSwiftPackageReference section */

/* Begin XCSwiftPackageProductDependency section */
19330C842CDB4A2C00F9221E /* MuxStatsGoogleIMAPlugin */ = {
isa = XCSwiftPackageProductDependency;
productName = MuxStatsGoogleIMAPlugin;
};
193D52B52CAB6B32004F20AA /* MuxStatsGoogleIMAPlugin */ = {
isa = XCSwiftPackageProductDependency;
productName = MuxStatsGoogleIMAPlugin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/muxinc/mux-stats-sdk-avplayer.git",
"state" : {
"revision" : "dec068faeaeb94165057a3ca96ee8e04041a1c1f",
"version" : "4.1.0"
"revision" : "9d4d18656216158a307330d96a0c54b3c35edbb0",
"version" : "4.1.2"
}
},
{
"identity" : "stats-sdk-objc",
"kind" : "remoteSourceControl",
"location" : "https://github.com/muxinc/stats-sdk-objc.git",
"state" : {
"revision" : "856a4a6eb418b85d12b3c3435ecb615eb356c623",
"version" : "5.1.0"
"revision" : "b75c77756b43d6dfe6d93c1f3445e23843d497ea",
"version" : "5.1.2"
}
}
],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
//
// ContentView.swift
// MuxStatsGoogleIMAPluginSPMExampleIOS
//

import SwiftUI

struct ContentView: View {
var title: String

@State var didPressPlay: Bool = false

@State var environmentKey: String = ProcessInfo.processInfo.environmentKey ?? ""
@State var adTagURL: String
@State var contentURL: String

var body: some View {
VStack(alignment: .leading) {
Text(
"Environment Key"
)
.frame(alignment: .leading)
.fontWeight(.bold)

TextField(
"Environment Key",
text: $environmentKey,
axis: .vertical
)
.lineLimit(nil)
.autocorrectionDisabled()

Text(
"Ad Tag URL"
)
.frame(alignment: .leading)
.fontWeight(.bold)

TextField(
"Ad Tag URL",
text: $adTagURL,
axis: .vertical
)
.lineLimit(nil)
.autocorrectionDisabled()

Text(
"Content URL"
)
.frame(alignment: .leading)
.fontWeight(.bold)

TextField(
"Content URL",
text: $contentURL,
axis: .vertical
)
.lineLimit(nil)
.autocorrectionDisabled()

ZStack {
PlayerView(
title: title,
adTagURL: adTagURL,
contentURL: contentURL,
environmentKey: environmentKey,
didPressPlay: $didPressPlay
)

Button {
didPressPlay = true
} label: {
Image(systemName: "play.fill")
.resizable()
.frame(width: 50, height: 50)
}
.opacity(didPressPlay ? 0 : 1)
}
.aspectRatio(16 / 9, contentMode: .fit)
.padding()

Spacer()
}
.padding(.top)
.navigationTitle(title)
}
}
//
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView(
title: MenuItem.standardPreRoll.name,
environmentKey: "",
adTagURL: MenuItem.standardPreRoll.adTagURL,
contentURL: MenuItem.standardPreRoll.contentURL
)
}
}

private struct PlayerView: UIViewControllerRepresentable {
var title: String
var adTagURL: String
var contentURL: String
var environmentKey: String

typealias UIViewControllerType = PlayerContainerViewController
@Binding var didPressPlay: Bool

func makeUIViewController(context: Context) -> PlayerContainerViewController {
let viewController = PlayerContainerViewController()
viewController.adTagURLString = adTagURL
viewController.contentURLString = contentURL
viewController.environmentKey = environmentKey
viewController.title = title
return viewController
}

func updateUIViewController(_ uiViewController: PlayerContainerViewController, context: Context) {
if didPressPlay {
uiViewController.playButtonPressed()
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
//
// MenuItem.swift
// MuxStatsGoogleIMAPluginSPMExampleIOS
//

import Foundation

struct MenuItem: Identifiable {
var name: String
var adTagURL: String
var contentURL: String

let id: UUID = UUID()
}

extension MenuItem {
static let standardPreRoll = MenuItem(
name: "Standard pre-roll",
adTagURL: "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/"
+ "single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinear&ciu_szs=300x250%2C728x90&"
+ "gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",
contentURL: "https://stream.mux.com/qxb01i6T202018GFS02vp9RIe01icTcDCjVzQpmaB00CUisJ4.m3u8"
)

static let skippablePreRoll = MenuItem(
name: "Skippable pre-roll",
adTagURL: "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/"
+ "single_preroll_skippable&sz=640x480&ciu_szs=300x250%2C728x90&gdfp_req=1&"
+ "output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",
contentURL: "https://stream.mux.com/qxb01i6T202018GFS02vp9RIe01icTcDCjVzQpmaB00CUisJ4.m3u8"
)

static let postRoll = MenuItem(
name: "Post-roll",
adTagURL: "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/"
+ "vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpostonly&ciu_szs=300x250&"
+ "gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&correlator=",
contentURL: "https://stream.mux.com/qxb01i6T202018GFS02vp9RIe01icTcDCjVzQpmaB00CUisJ4.m3u8"
)

static let adRules = MenuItem(
name: "Ad rules",
adTagURL: "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/"
+ "vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpremidpost&ciu_szs=300x250&"
+ "gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&cmsid=496&"
+ "vid=short_onecue&correlator=",
contentURL: "https://stream.mux.com/qxb01i6T202018GFS02vp9RIe01icTcDCjVzQpmaB00CUisJ4.m3u8"
)

static let vmapPods = MenuItem(
name: "VMAP Pods",
adTagURL: "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/"
+ "vmap_ad_samples&sz=640x480&cust_params=sample_ar%3Dpremidpostpod&ciu_szs=300x250&"
+ "gdfp_req=1&ad_rule=1&output=vmap&unviewed_position_start=1&env=vp&impl=s&cmsid=496&"
+ "vid=short_onecue&correlator=",
contentURL: "https://stream.mux.com/qxb01i6T202018GFS02vp9RIe01icTcDCjVzQpmaB00CUisJ4.m3u8"
)

static let custom = MenuItem(
name: "Custom",
adTagURL: "https://pubads.g.doubleclick.net/gampad/ads?iu=/21775744923/external/"
+ "single_ad_samples&sz=640x480&cust_params=sample_ct%3Dlinear&ciu_szs=300x250%2C728x90&"
+ "gdfp_req=1&output=vast&unviewed_position_start=1&env=vp&impl=s&correlator=",
contentURL: "https://stream.mux.com/qxb01i6T202018GFS02vp9RIe01icTcDCjVzQpmaB00CUisJ4.m3u8"
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
//
// MenuView.swift
// MuxStatsGoogleIMAPluginSPMExampleIOS
//

import SwiftUI



struct MenuItemView: View {
var item: MenuItem

var body: some View {
ContentView(
title: item.name,
adTagURL: item.adTagURL,
contentURL: item.contentURL
)
}
}

struct MenuView: View {
var items: [MenuItem] = [
.standardPreRoll,
.skippablePreRoll,
.postRoll,
.adRules,
.vmapPods,
.custom
]

var body: some View {
NavigationView {
List(items) { item in
NavigationLink(
destination: MenuItemView(
item: item
)
) {
Text(item.name)
}
}
.navigationTitle("IMA Ad Tag Variants")
.navigationBarTitleDisplayMode(.inline)
}
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import SwiftUI
struct MuxStatsGoogleIMAPluginSPMExampleIOSApp: App {
var body: some Scene {
WindowGroup {
ContentView()
MenuView()
}
}
}
Loading

0 comments on commit e1f76fa

Please sign in to comment.