diff --git a/.gitignore b/.gitignore index 24ef104..f15c6d7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,15 @@ # OS X .DS_Store +**/.build +**/Build + +**/DistributionSummary.plist +**/ExportOptions.plist +**/Packaging.log +**/Payload/* +**/*.ipa + # Xcode build/ *.pbxuser diff --git a/Example/DemoApp/AppDelegate.swift b/Examples/DemoApp/AppDelegate.swift similarity index 100% rename from Example/DemoApp/AppDelegate.swift rename to Examples/DemoApp/AppDelegate.swift diff --git a/Example/DemoApp/Assets.xcassets/AccentColor.colorset/Contents.json b/Examples/DemoApp/Assets.xcassets/AccentColor.colorset/Contents.json similarity index 100% rename from Example/DemoApp/Assets.xcassets/AccentColor.colorset/Contents.json rename to Examples/DemoApp/Assets.xcassets/AccentColor.colorset/Contents.json diff --git a/Example/DemoApp/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/DemoApp/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from Example/DemoApp/Assets.xcassets/AppIcon.appiconset/Contents.json rename to Examples/DemoApp/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/Example/DemoApp/Assets.xcassets/Contents.json b/Examples/DemoApp/Assets.xcassets/Contents.json similarity index 100% rename from Example/DemoApp/Assets.xcassets/Contents.json rename to Examples/DemoApp/Assets.xcassets/Contents.json diff --git a/Example/DemoApp/Base.lproj/LaunchScreen.storyboard b/Examples/DemoApp/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from Example/DemoApp/Base.lproj/LaunchScreen.storyboard rename to Examples/DemoApp/Base.lproj/LaunchScreen.storyboard diff --git a/Example/DemoApp/Info.plist b/Examples/DemoApp/Info.plist similarity index 100% rename from Example/DemoApp/Info.plist rename to Examples/DemoApp/Info.plist diff --git a/Example/DemoApp/Main.storyboard b/Examples/DemoApp/Main.storyboard similarity index 100% rename from Example/DemoApp/Main.storyboard rename to Examples/DemoApp/Main.storyboard diff --git a/Example/DemoApp/SceneDelegate.swift b/Examples/DemoApp/SceneDelegate.swift similarity index 100% rename from Example/DemoApp/SceneDelegate.swift rename to Examples/DemoApp/SceneDelegate.swift diff --git a/Example/DemoApp/ViewController.swift b/Examples/DemoApp/ViewController.swift similarity index 100% rename from Example/DemoApp/ViewController.swift rename to Examples/DemoApp/ViewController.swift diff --git a/Example/DemoAppTests/Tests/Tests-Info.plist b/Examples/DemoAppTests/Tests/Tests-Info.plist similarity index 100% rename from Example/DemoAppTests/Tests/Tests-Info.plist rename to Examples/DemoAppTests/Tests/Tests-Info.plist diff --git a/Example/DemoAppTests/Tests/Tests-Prefix.pch b/Examples/DemoAppTests/Tests/Tests-Prefix.pch similarity index 100% rename from Example/DemoAppTests/Tests/Tests-Prefix.pch rename to Examples/DemoAppTests/Tests/Tests-Prefix.pch diff --git a/Example/DemoAppTests/Tests/en.lproj/InfoPlist.strings b/Examples/DemoAppTests/Tests/en.lproj/InfoPlist.strings similarity index 100% rename from Example/DemoAppTests/Tests/en.lproj/InfoPlist.strings rename to Examples/DemoAppTests/Tests/en.lproj/InfoPlist.strings diff --git a/Example/DemoAppUITests/DemoAppUITests.swift b/Examples/DemoAppUITests/DemoAppUITests.swift similarity index 100% rename from Example/DemoAppUITests/DemoAppUITests.swift rename to Examples/DemoAppUITests/DemoAppUITests.swift diff --git a/Example/MUXSDKIMATVOSExample/AppDelegate.swift b/Examples/MUXSDKIMATVOSExample/AppDelegate.swift similarity index 100% rename from Example/MUXSDKIMATVOSExample/AppDelegate.swift rename to Examples/MUXSDKIMATVOSExample/AppDelegate.swift diff --git a/Example/MUXSDKIMATVOSExample/Assets.xcassets/AccentColor.colorset/Contents.json b/Examples/MUXSDKIMATVOSExample/Assets.xcassets/AccentColor.colorset/Contents.json similarity index 100% rename from Example/MUXSDKIMATVOSExample/Assets.xcassets/AccentColor.colorset/Contents.json rename to Examples/MUXSDKIMATVOSExample/Assets.xcassets/AccentColor.colorset/Contents.json diff --git a/Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json similarity index 100% rename from Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json rename to Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Content.imageset/Contents.json diff --git a/Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json b/Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json similarity index 100% rename from Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json rename to Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Back.imagestacklayer/Contents.json diff --git a/Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Contents.json b/Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Contents.json similarity index 100% rename from Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Contents.json rename to Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Contents.json diff --git a/Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json similarity index 100% rename from Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json rename to Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Content.imageset/Contents.json diff --git a/Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json b/Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json similarity index 100% rename from Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json rename to Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Front.imagestacklayer/Contents.json diff --git a/Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json similarity index 100% rename from Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json rename to Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json diff --git a/Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json b/Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json similarity index 100% rename from Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json rename to Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon - App Store.imagestack/Middle.imagestacklayer/Contents.json diff --git a/Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json b/Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json similarity index 100% rename from Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json rename to Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Content.imageset/Contents.json diff --git a/Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json b/Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json similarity index 100% rename from Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json rename to Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Back.imagestacklayer/Contents.json diff --git a/Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Contents.json b/Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Contents.json similarity index 100% rename from Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Contents.json rename to Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Contents.json diff --git a/Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json b/Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json similarity index 100% rename from Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json rename to Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Content.imageset/Contents.json diff --git a/Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json b/Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json similarity index 100% rename from Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json rename to Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Front.imagestacklayer/Contents.json diff --git a/Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json b/Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json similarity index 100% rename from Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json rename to Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Content.imageset/Contents.json diff --git a/Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json b/Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json similarity index 100% rename from Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json rename to Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/App Icon.imagestack/Middle.imagestacklayer/Contents.json diff --git a/Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json b/Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json similarity index 100% rename from Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json rename to Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Contents.json diff --git a/Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json b/Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json similarity index 100% rename from Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json rename to Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image Wide.imageset/Contents.json diff --git a/Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json b/Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json similarity index 100% rename from Example/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json rename to Examples/MUXSDKIMATVOSExample/Assets.xcassets/App Icon & Top Shelf Image.brandassets/Top Shelf Image.imageset/Contents.json diff --git a/Example/MUXSDKIMATVOSExample/Assets.xcassets/Contents.json b/Examples/MUXSDKIMATVOSExample/Assets.xcassets/Contents.json similarity index 100% rename from Example/MUXSDKIMATVOSExample/Assets.xcassets/Contents.json rename to Examples/MUXSDKIMATVOSExample/Assets.xcassets/Contents.json diff --git a/Example/MUXSDKIMATVOSExample/Base.lproj/LaunchScreen.storyboard b/Examples/MUXSDKIMATVOSExample/Base.lproj/LaunchScreen.storyboard similarity index 100% rename from Example/MUXSDKIMATVOSExample/Base.lproj/LaunchScreen.storyboard rename to Examples/MUXSDKIMATVOSExample/Base.lproj/LaunchScreen.storyboard diff --git a/Example/MUXSDKIMATVOSExample/Base.lproj/Main.storyboard b/Examples/MUXSDKIMATVOSExample/Base.lproj/Main.storyboard similarity index 100% rename from Example/MUXSDKIMATVOSExample/Base.lproj/Main.storyboard rename to Examples/MUXSDKIMATVOSExample/Base.lproj/Main.storyboard diff --git a/Example/MUXSDKIMATVOSExample/ProcessInfo+Data.swift b/Examples/MUXSDKIMATVOSExample/ProcessInfo+Data.swift similarity index 100% rename from Example/MUXSDKIMATVOSExample/ProcessInfo+Data.swift rename to Examples/MUXSDKIMATVOSExample/ProcessInfo+Data.swift diff --git a/Example/MUXSDKIMATVOSExample/ViewController.swift b/Examples/MUXSDKIMATVOSExample/ViewController.swift similarity index 100% rename from Example/MUXSDKIMATVOSExample/ViewController.swift rename to Examples/MUXSDKIMATVOSExample/ViewController.swift diff --git a/Example/MUXSDKIMATVOSExampleTests/MUXSDKIMATVOSExampleTests.swift b/Examples/MUXSDKIMATVOSExampleTests/MUXSDKIMATVOSExampleTests.swift similarity index 100% rename from Example/MUXSDKIMATVOSExampleTests/MUXSDKIMATVOSExampleTests.swift rename to Examples/MUXSDKIMATVOSExampleTests/MUXSDKIMATVOSExampleTests.swift diff --git a/Example/MUXSDKIMATVOSExampleUITests/MUXSDKIMATVOSExampleUITests.swift b/Examples/MUXSDKIMATVOSExampleUITests/MUXSDKIMATVOSExampleUITests.swift similarity index 100% rename from Example/MUXSDKIMATVOSExampleUITests/MUXSDKIMATVOSExampleUITests.swift rename to Examples/MUXSDKIMATVOSExampleUITests/MUXSDKIMATVOSExampleUITests.swift diff --git a/Example/MUXSDKIMATVOSExampleUITests/MUXSDKIMATVOSExampleUITestsLaunchTests.swift b/Examples/MUXSDKIMATVOSExampleUITests/MUXSDKIMATVOSExampleUITestsLaunchTests.swift similarity index 100% rename from Example/MUXSDKIMATVOSExampleUITests/MUXSDKIMATVOSExampleUITestsLaunchTests.swift rename to Examples/MUXSDKIMATVOSExampleUITests/MUXSDKIMATVOSExampleUITestsLaunchTests.swift diff --git a/Example/MUXSDKImaListener.xcodeproj/project.pbxproj b/Examples/MUXSDKImaListener.xcodeproj/project.pbxproj similarity index 100% rename from Example/MUXSDKImaListener.xcodeproj/project.pbxproj rename to Examples/MUXSDKImaListener.xcodeproj/project.pbxproj diff --git a/Example/MUXSDKImaListener.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Examples/MUXSDKImaListener.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from Example/MUXSDKImaListener.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to Examples/MUXSDKImaListener.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/Example/MUXSDKImaListener.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Examples/MUXSDKImaListener.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from Example/MUXSDKImaListener.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to Examples/MUXSDKImaListener.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/Example/MUXSDKImaListener.xcodeproj/xcshareddata/xcschemes/DemoApp.xcscheme b/Examples/MUXSDKImaListener.xcodeproj/xcshareddata/xcschemes/DemoApp.xcscheme similarity index 100% rename from Example/MUXSDKImaListener.xcodeproj/xcshareddata/xcschemes/DemoApp.xcscheme rename to Examples/MUXSDKImaListener.xcodeproj/xcshareddata/xcschemes/DemoApp.xcscheme diff --git a/Example/MUXSDKImaListener.xcodeproj/xcshareddata/xcschemes/MUXSDKIMATVOSExample.xcscheme b/Examples/MUXSDKImaListener.xcodeproj/xcshareddata/xcschemes/MUXSDKIMATVOSExample.xcscheme similarity index 100% rename from Example/MUXSDKImaListener.xcodeproj/xcshareddata/xcschemes/MUXSDKIMATVOSExample.xcscheme rename to Examples/MUXSDKImaListener.xcodeproj/xcshareddata/xcschemes/MUXSDKIMATVOSExample.xcscheme diff --git a/Example/MUXSDKImaListener.xcodeproj/xcshareddata/xcschemes/MUXSDKImaListener-Example.xcscheme b/Examples/MUXSDKImaListener.xcodeproj/xcshareddata/xcschemes/MUXSDKImaListener-Example.xcscheme similarity index 100% rename from Example/MUXSDKImaListener.xcodeproj/xcshareddata/xcschemes/MUXSDKImaListener-Example.xcscheme rename to Examples/MUXSDKImaListener.xcodeproj/xcshareddata/xcschemes/MUXSDKImaListener-Example.xcscheme diff --git a/Example/MUXSDKImaListener.xcworkspace/contents.xcworkspacedata b/Examples/MUXSDKImaListener.xcworkspace/contents.xcworkspacedata similarity index 100% rename from Example/MUXSDKImaListener.xcworkspace/contents.xcworkspacedata rename to Examples/MUXSDKImaListener.xcworkspace/contents.xcworkspacedata diff --git a/Example/MUXSDKImaListener.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Examples/MUXSDKImaListener.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from Example/MUXSDKImaListener.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to Examples/MUXSDKImaListener.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/Example/MUXSDKImaListener.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Examples/MUXSDKImaListener.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings similarity index 100% rename from Example/MUXSDKImaListener.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings rename to Examples/MUXSDKImaListener.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings diff --git a/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS.xcodeproj/project.pbxproj b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS.xcodeproj/project.pbxproj similarity index 97% rename from MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS.xcodeproj/project.pbxproj rename to Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS.xcodeproj/project.pbxproj index 57bc444..119aa2e 100644 --- a/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS.xcodeproj/project.pbxproj +++ b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS.xcodeproj/project.pbxproj @@ -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 */ @@ -70,6 +71,7 @@ buildActionMask = 2147483647; files = ( 193D52B62CAB6B32004F20AA /* MuxStatsGoogleIMAPlugin in Frameworks */, + 19330C852CDB4A2C00F9221E /* MuxStatsGoogleIMAPlugin in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -131,6 +133,7 @@ name = MuxStatsGoogleIMAPluginSPMExampleIOS; packageProductDependencies = ( 193D52B52CAB6B32004F20AA /* MuxStatsGoogleIMAPlugin */, + 19330C842CDB4A2C00F9221E /* MuxStatsGoogleIMAPlugin */, ); productName = MuxStatsGoogleIMAPluginSPMExampleIOS; productReference = 193D52812CAB698F004F20AA /* MuxStatsGoogleIMAPluginSPMExampleIOS.app */; @@ -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 */; @@ -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; diff --git a/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved similarity index 73% rename from MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved rename to Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index e9f9c2b..04cf662 100644 --- a/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -6,8 +6,8 @@ "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" } }, { @@ -15,8 +15,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/muxinc/stats-sdk-objc.git", "state" : { - "revision" : "856a4a6eb418b85d12b3c3435ecb615eb356c623", - "version" : "5.1.0" + "revision" : "b75c77756b43d6dfe6d93c1f3445e23843d497ea", + "version" : "5.1.2" } } ], diff --git a/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS.xcodeproj/xcshareddata/xcschemes/MuxStatsGoogleIMAPluginSPMExampleIOS.xcscheme b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS.xcodeproj/xcshareddata/xcschemes/MuxStatsGoogleIMAPluginSPMExampleIOS.xcscheme similarity index 100% rename from MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS.xcodeproj/xcshareddata/xcschemes/MuxStatsGoogleIMAPluginSPMExampleIOS.xcscheme rename to Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS.xcodeproj/xcshareddata/xcschemes/MuxStatsGoogleIMAPluginSPMExampleIOS.xcscheme diff --git a/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/Assets.xcassets/AccentColor.colorset/Contents.json b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/Assets.xcassets/AccentColor.colorset/Contents.json similarity index 100% rename from MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/Assets.xcassets/AccentColor.colorset/Contents.json rename to Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/Assets.xcassets/AccentColor.colorset/Contents.json diff --git a/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/Assets.xcassets/AppIcon.appiconset/Contents.json b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/Assets.xcassets/AppIcon.appiconset/Contents.json rename to Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/Assets.xcassets/Contents.json b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/Assets.xcassets/Contents.json similarity index 100% rename from MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/Assets.xcassets/Contents.json rename to Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/Assets.xcassets/Contents.json diff --git a/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/ContentView.swift b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/ContentView.swift new file mode 100644 index 0000000..dd9ef14 --- /dev/null +++ b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/ContentView.swift @@ -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() + } + } +} diff --git a/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/Info.plist b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/Info.plist similarity index 100% rename from MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/Info.plist rename to Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/Info.plist diff --git a/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/MenuItem.swift b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/MenuItem.swift new file mode 100644 index 0000000..8b3caf7 --- /dev/null +++ b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/MenuItem.swift @@ -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" + ) +} diff --git a/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/MenuView.swift b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/MenuView.swift new file mode 100644 index 0000000..8d92a2d --- /dev/null +++ b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/MenuView.swift @@ -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) + } + } + +} + diff --git a/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOSApp.swift b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOSApp.swift similarity index 90% rename from MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOSApp.swift rename to Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOSApp.swift index 7f3236a..0244330 100644 --- a/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOSApp.swift +++ b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOSApp.swift @@ -9,7 +9,7 @@ import SwiftUI struct MuxStatsGoogleIMAPluginSPMExampleIOSApp: App { var body: some Scene { WindowGroup { - ContentView() + MenuView() } } } diff --git a/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/PlayerContainerViewController.swift b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/PlayerContainerViewController.swift similarity index 80% rename from MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/PlayerContainerViewController.swift rename to Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/PlayerContainerViewController.swift index b1bf7f3..7769426 100644 --- a/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/PlayerContainerViewController.swift +++ b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/PlayerContainerViewController.swift @@ -13,10 +13,17 @@ import MUXSDKStats import MuxCore class PlayerContainerViewController: UIViewController { - static let adTagURLString = - "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=" + + // Default URLs + + var adTagURLString = + "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=" + + var contentURLString = "https://stream.mux.com/qxb01i6T202018GFS02vp9RIe01icTcDCjVzQpmaB00CUisJ4.m3u8" + + // Google IMA var imaAdsSDKSettings: IMASettings { IMASettings() @@ -28,16 +35,27 @@ class PlayerContainerViewController: UIViewController { var contentPlayhead: IMAAVPlayerContentPlayhead? - static let contentURL = URL( - string: "https://stream.mux.com/qxb01i6T202018GFS02vp9RIe01icTcDCjVzQpmaB00CUisJ4.m3u8" - )! - var contentPlayer = AVPlayer( - url: PlayerContainerViewController.contentURL - ) - lazy var playerViewController = AVPlayerViewController() + // Mux Data + + var playerBinding: MUXSDKPlayerBinding? var adsListener: MUXSDKIMAAdsListener? + var environmentKey: String = ProcessInfo.processInfo.environmentKey ?? "" + + var playerName: String { + title ?? "adplayer" + } + + // Player + + lazy var contentPlayer = AVPlayer( + url: URL( + string: contentURLString + )! + ) + lazy var playerViewController = AVPlayerViewController() + // MARK: View controller lifecycle override func viewDidLoad() { @@ -62,17 +80,15 @@ class PlayerContainerViewController: UIViewController { adsLoader = IMAAdsLoader(settings: IMASettings()) adsLoader.delegate = self - - // MARK: Setup Mux Data - guard let environmentKey = ProcessInfo.processInfo.environmentKey else { - return - } + // MARK: Setup Mux Data let customerPlayerData = MUXSDKCustomerPlayerData() customerPlayerData.environmentKey = environmentKey let customerVideoData = MUXSDKCustomerVideoData() - customerVideoData.videoTitle = "Mux Data IMA SDK Example Preroll" + if let title { + customerVideoData.videoTitle = title + } let customerData = MUXSDKCustomerData() customerData.customerPlayerData = customerPlayerData @@ -80,22 +96,32 @@ class PlayerContainerViewController: UIViewController { guard let playerBinding = MUXSDKStats.monitorAVPlayerViewController( playerViewController, - withPlayerName: "adplayer", + withPlayerName: playerName, customerData: customerData ) else { return } + self.playerBinding = playerBinding + // MARK: Setup Mux Data IMA Plugin adsListener = MUXSDKIMAAdsListener( playerBinding: playerBinding, monitoringAdsLoader: adsLoader ) } - + override func viewWillAppear(_ animated: Bool) { - super.viewWillAppear(animated) - showContentPlayer() + super.viewWillAppear(animated) + showContentPlayer() + } + + override func viewWillDisappear(_ animated: Bool) { + MUXSDKStats.destroyPlayer( + playerName + ) + hideContentPlayer() + super.viewWillDisappear(animated) } // MARK: Show and hide content player @@ -137,7 +163,7 @@ class PlayerContainerViewController: UIViewController { // Create an ad request with our ad tag, display // container, and optional user context. let request = IMAAdsRequest( - adTagUrl: PlayerContainerViewController.adTagURLString, + adTagUrl: adTagURLString, adDisplayContainer: adDisplayContainer, contentPlayhead: contentPlayhead, userContext: nil @@ -152,7 +178,7 @@ class PlayerContainerViewController: UIViewController { // MARK: deinit deinit { - NotificationCenter.default.removeObserver(self) + NotificationCenter.default.removeObserver(self) } } @@ -168,11 +194,12 @@ extension PlayerContainerViewController: IMAAdsLoaderDelegate { } loadedAdsManager.delegate = self - + // MARK: Monitor the IMAAdsManager with Mux - // note - do this *after* setting your delegate but *before* + // note - do this *after* setting your delegate but + // not *before* adsListener?.monitorAdsManager(loadedAdsManager) - + let renderingSettings = IMAAdsRenderingSettings() renderingSettings.enablePreloading = true; loadedAdsManager.initialize( diff --git a/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/Preview Content/Preview Assets.xcassets/Contents.json b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/Preview Content/Preview Assets.xcassets/Contents.json similarity index 100% rename from MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/Preview Content/Preview Assets.xcassets/Contents.json rename to Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/Preview Content/Preview Assets.xcassets/Contents.json diff --git a/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/UIProcessInfo+Extensions.swift b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/UIProcessInfo+Extensions.swift similarity index 100% rename from MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/UIProcessInfo+Extensions.swift rename to Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/UIProcessInfo+Extensions.swift diff --git a/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOSTests/MuxStatsGoogleIMAPluginSPMExampleIOSTests.swift b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOSTests/MuxStatsGoogleIMAPluginSPMExampleIOSTests.swift similarity index 100% rename from MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOSTests/MuxStatsGoogleIMAPluginSPMExampleIOSTests.swift rename to Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOSTests/MuxStatsGoogleIMAPluginSPMExampleIOSTests.swift diff --git a/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOSUITests/MuxStatsGoogleIMAPluginSPMExampleIOSUITests.swift b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOSUITests/MuxStatsGoogleIMAPluginSPMExampleIOSUITests.swift similarity index 100% rename from MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOSUITests/MuxStatsGoogleIMAPluginSPMExampleIOSUITests.swift rename to Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOSUITests/MuxStatsGoogleIMAPluginSPMExampleIOSUITests.swift diff --git a/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOSUITests/MuxStatsGoogleIMAPluginSPMExampleIOSUITestsLaunchTests.swift b/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOSUITests/MuxStatsGoogleIMAPluginSPMExampleIOSUITestsLaunchTests.swift similarity index 100% rename from MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOSUITests/MuxStatsGoogleIMAPluginSPMExampleIOSUITestsLaunchTests.swift rename to Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOSUITests/MuxStatsGoogleIMAPluginSPMExampleIOSUITestsLaunchTests.swift diff --git a/Example/Podfile b/Examples/Podfile similarity index 100% rename from Example/Podfile rename to Examples/Podfile diff --git a/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/ContentView.swift b/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/ContentView.swift deleted file mode 100644 index 6c5ca60..0000000 --- a/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS/ContentView.swift +++ /dev/null @@ -1,55 +0,0 @@ -// -// ContentView.swift -// MuxStatsGoogleIMAPluginSPMExampleIOS -// - -import SwiftUI - -struct ContentView: View { - @State var didPressPlay: Bool = false - - var body: some View { - VStack { - Text("IMA SDK Basic Example App") - - ZStack { - PlayerView(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) - } -} - -struct ContentView_Previews: PreviewProvider { - static var previews: some View { - ContentView() - } -} - -private struct PlayerView: UIViewControllerRepresentable { - typealias UIViewControllerType = PlayerContainerViewController - @Binding var didPressPlay: Bool - - func makeUIViewController(context: Context) -> PlayerContainerViewController { - return PlayerContainerViewController() - } - - func updateUIViewController(_ uiViewController: PlayerContainerViewController, context: Context) { - if didPressPlay { - uiViewController.playButtonPressed() - } - } -} diff --git a/scripts/create-example-application-archive.sh b/scripts/create-example-application-archive.sh new file mode 100755 index 0000000..b7201e3 --- /dev/null +++ b/scripts/create-example-application-archive.sh @@ -0,0 +1,126 @@ +#!/bin/bash + +set -euo pipefail + +readonly EXPORT_OPTIONS_TEAM_ID="XX95P4Y787" + +readonly XCODE=$(xcodebuild -version | grep Xcode | cut -d " " -f2) +readonly EXAMPLE_APPLICATION_ARCHIVE_NAME=MuxStatsGoogleIMAPluginSPMExampleIOS +readonly EXAMPLE_APPLICATION_ARCHIVE_PATH="${PWD}/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/.build/${EXAMPLE_APPLICATION_ARCHIVE_NAME}.xcarchive" +readonly EXAMPLE_APPLICATION_EXPORT_PATH="${PWD}/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS" +readonly EXPORT_OPTIONS_PLIST_NAME="ExportOptions" +readonly EXPORT_OPTIONS_PLIST_PATH="${EXAMPLE_APPLICATION_EXPORT_PATH}/${EXPORT_OPTIONS_PLIST_NAME}.plist" +readonly PROJECT_DIR="${PWD}/Examples/MuxStatsGoogleIMAPluginSPMExampleIOS/MuxStatsGoogleIMAPluginSPMExampleIOS.xcodeproj" + +if [ $# -ne 1 ]; then + echo "▸ Usage: $0 SCHEME" + exit 1 +fi + +readonly SCHEME="$1" + +if ! command -v xcbeautify &> /dev/null +then + echo -e "\033[1;31m ERROR: xcbeautify could not be found please install it... \033[0m" + exit 1 +fi + +echo "▸ Current Xcode Path:" + +xcode-select -p + +echo "▸ Using Xcode Version: ${XCODE}" + +echo "▸ Using Swift Toolchain Version:" + +swift --version DEVELOPER_DIR=$(xcode-select -p) + +echo "▸ Available Xcode SDKs:" + +xcodebuild -showsdks -json + +echo "▸ Resolve Package Dependencies" + +cd Examples/MuxStatsGoogleIMAPluginSPMExampleIOS + +pwd + +echo $PROJECT_DIR + +echo "▸ Available Schemes:" + +xcodebuild -list -json -project $PROJECT_DIR + +echo "▸ Creating example application archive" + +xcodebuild clean archive -project $PROJECT_DIR \ + -scheme $SCHEME \ + -destination generic/platform=iOS \ + -archivePath $EXAMPLE_APPLICATION_ARCHIVE_PATH \ + -allowProvisioningUpdates \ + CODE_SIGNING_REQUIRED=YES | xcbeautify + +if [[ $? == 0 ]]; then + echo "▸ Successfully created archive at ${EXAMPLE_APPLICATION_ARCHIVE_PATH}" +else + echo -e "\033[1;31m ERROR: Failed to create archive at ${EXAMPLE_APPLICATION_ARCHIVE_PATH} \033[0m" + exit 1 +fi + +echo "▸ Creating export options plist" + +rm -rf "${EXPORT_OPTIONS_PLIST_PATH}" + +plutil -create xml1 "${EXPORT_OPTIONS_PLIST_PATH}" + +/usr/libexec/PlistBuddy -c "Add method string debugging" "${EXPORT_OPTIONS_PLIST_PATH}" + +/usr/libexec/PlistBuddy -c "Add teamID string ${EXPORT_OPTIONS_TEAM_ID}" "${EXPORT_OPTIONS_PLIST_PATH}" + +/usr/libexec/PlistBuddy -c "Add thinning string " "${EXPORT_OPTIONS_PLIST_PATH}" + +/usr/libexec/PlistBuddy -c "Add compileBitcode bool false" "${EXPORT_OPTIONS_PLIST_PATH}" + +echo "▸ Created export options plist: $(cat $EXPORT_OPTIONS_PLIST_PATH)" + +echo "▸ Exporting example application archive to ${EXAMPLE_APPLICATION_EXPORT_PATH}" + +# If exportArchive is failing and rvm is installed locally then run: rvm use system +# Xcode 15 ipatool requires system ruby to export an archive. +# To confirm this: run xcodebuild with -verbose flag and check IDEDistribution +# distribution logs (.xcdistributionlogs) to see if there is a sqlite installation error. + +xcodebuild -exportArchive \ + -archivePath $EXAMPLE_APPLICATION_ARCHIVE_PATH \ + -exportPath $EXAMPLE_APPLICATION_EXPORT_PATH \ + -exportOptionsPlist $EXPORT_OPTIONS_PLIST_PATH | xcbeautify + +if [[ $? == 0 ]]; then + echo "▸ Successfully exported archive at ${EXAMPLE_APPLICATION_EXPORT_PATH}" +else + echo -e "\033[1;31m ERROR: Failed to export archive to ${EXAMPLE_APPLICATION_EXPORT_PATH} \033[0m" + exit 1 +fi + +echo "▸ Creating example application test runner archive" + +xcodebuild build-for-testing -project $PROJECT_DIR \ + -scheme $SCHEME \ + -destination generic/platform=iOS \ + -derivedDataPath $PWD/Build | xcbeautify + +if [[ $? == 0 ]]; then + echo "▸ Successfully created test runner archive." +else + echo -e "\033[1;31m ERROR: Failed to create test runner archive. \033[0m" + exit 1 +fi + +mkdir -p $PWD/Payload + +cp -r "$(find $PWD/Build -name 'MuxStatsGoogleIMAPluginSPMExampleIOSUITests-Runner.app')" $PWD/Payload + +zip -ry "${SCHEME}UITests-Runner.ipa" Payload + +echo "▸ Created example application test runner archive at $PWD/MuxPlayerSwiftExampleUITests-Runner.ipa" +