-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update example ci: add script to archive example package update .gitignore
- Loading branch information
1 parent
9875350
commit e1f76fa
Showing
71 changed files
with
441 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
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.
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.
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.
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.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
123 changes: 123 additions & 0 deletions
123
...xStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/ContentView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
} | ||
} |
File renamed without changes.
66 changes: 66 additions & 0 deletions
66
.../MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/MenuItem.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
) | ||
} |
49 changes: 49 additions & 0 deletions
49
.../MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/MenuView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.