Skip to content

Commit

Permalink
Moves objective-C samples to their own directory to prepare for swift…
Browse files Browse the repository at this point in the history
… samples.

PiperOrigin-RevId: 641374117
  • Loading branch information
gschoppe authored and IMA Developer Relations committed Jun 7, 2024
1 parent 8f78829 commit 1adde6b
Show file tree
Hide file tree
Showing 45 changed files with 49 additions and 407 deletions.
8 changes: 0 additions & 8 deletions AdvancedExample/Podfile

This file was deleted.

36 changes: 0 additions & 36 deletions AdvancedExample/app/AppDelegate.m

This file was deleted.

38 changes: 0 additions & 38 deletions AdvancedExample/app/CastManager.h

This file was deleted.

206 changes: 0 additions & 206 deletions AdvancedExample/app/CastManager.m

This file was deleted.

7 changes: 7 additions & 0 deletions Objective-C/AdvancedExample/Podfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '17'

target "AdvancedExample" do
pod 'GoogleAds-IMA-iOS-SDK'
end
File renamed without changes.
15 changes: 15 additions & 0 deletions Objective-C/AdvancedExample/app/AppDelegate.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#import "AppDelegate.h"
#import "MainViewController.h"

@interface AppDelegate ()

@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
return YES;
}

@end
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
#import "MainViewController.h"
#import "CastManager.h"
#import "Video.h"
#import "VideoViewController.h"

@import GoogleCast;
@import GoogleInteractiveMediaAds;

@interface MainViewController () <UIAlertViewDelegate, VideoViewControllerDelegate>

/// Storage point for videos.
@property(nonatomic, copy) NSArray<Video *> *videos;

/// Manages cast relationship.
@property(nonatomic, strong) CastManager *castManager;

// AdsLoader
@property(nonatomic, strong) IMAAdsLoader *adsLoader;

Expand All @@ -26,14 +21,6 @@ - (void)viewDidLoad {
[super viewDidLoad];
[self initVideos];

// Cast manager.
self.castManager = [[CastManager alloc] init];

// GoogleCast button
GCKUICastButton *castButton = [[GCKUICastButton alloc] initWithFrame:CGRectMake(0, 0, 24, 24)];
castButton.tintColor = [UIColor blackColor];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:castButton];

// AdsLoader
// Re-use this IMAAdsLoader instance for the entire lifecycle of your app.
self.adsLoader = [[IMAAdsLoader alloc] initWithSettings:nil];
Expand All @@ -58,7 +45,6 @@ - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
VideoViewController *destVC = (VideoViewController *)segue.destinationViewController;
destVC.delegate = self;
destVC.video = video;
destVC.castManager = self.castManager;
destVC.adsLoader = self.adsLoader;
}
}
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#import "Video.h"

@class CastManager;
@class IMAAdsLoader;
@class VideoViewController;

Expand Down Expand Up @@ -32,9 +31,6 @@
/// Video object to play.
@property(nonatomic, strong) Video *video;

/// Manages the relationship between this device and a reomte cast device.
@property(nonatomic, strong) CastManager *castManager;

// AdsLoader
@property(nonatomic, strong) IMAAdsLoader *adsLoader;

Expand All @@ -44,9 +40,6 @@
/// Tracks whether or not we have requested a stream locally.
@property(nonatomic, assign) BOOL localStreamRequested;

/// Starts local playback after cast playback is exited.
- (void)switchToLocalPlayback;

/// Returns the content time for the currently playing stream.
- (NSTimeInterval)getContentTime;

Expand All @@ -59,7 +52,4 @@
/// Updates the player controls with the provided current time and duration.
- (void)updatePlayHeadWithTime:(CMTime)time duration:(CMTime)duration;

/// Pauses the current content. Called by the CastManager when we start remote playback.
- (void)pauseContent;

@end
Loading

0 comments on commit 1adde6b

Please sign in to comment.