Skip to content

Commit

Permalink
adjust options
Browse files Browse the repository at this point in the history
  • Loading branch information
brustolin committed Mar 5, 2024
1 parent ec2bd0d commit 39f8f3d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions Sources/Sentry/SentrySessionReplay.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#import "SentryAttachment+Private.h"
#import "SentryLog.h"
#import "SentryOndemandReplay.h"
#import "SentryReplaySettings+Private.h"
#import "SentryReplayOptions+Private.h"
#import "SentryViewPhotographer.h"

#if SENTRY_HAS_UIKIT
Expand All @@ -17,16 +17,16 @@ @implementation SentrySessionReplay {
NSDate *_videoSegmentStart;
NSURL *_urlToCache;
NSDate *_sessionStart;
SentryReplaySettings *_settings;
SentryReplayOptions *_replayOptions;
SentryOnDemandReplay *_replayMaker;

NSMutableArray<UIImage *> *imageCollection;
}

- (instancetype)initWithSettings:(SentryReplaySettings *)replaySettings
- (instancetype)initWithSettings:(SentryReplayOptions *)replayOptions
{
if (self = [super init]) {
_settings = replaySettings;
_replayOptions = replayOptions;
}
return self;
}
Expand Down Expand Up @@ -67,7 +67,7 @@ - (void)start:(UIView *)rootView fullSession:(BOOL)full
}

_replayMaker = [[SentryOnDemandReplay alloc] initWithOutputPath:_urlToCache.path];
_replayMaker.bitRate = _settings.replayBitRate;
_replayMaker.bitRate = _replayOptions.replayBitRate;
_replayMaker.cacheMaxSize = full ? NSUIntegerMax : 32;
imageCollection = [NSMutableArray array];

Expand Down
10 changes: 5 additions & 5 deletions Sources/Sentry/SentrySessionReplayIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#import "SentryHub+Private.h"
#import "SentryOptions.h"
#import "SentryRandom.h"
#import "SentryReplaySettings.h"
#import "SentryReplayOptions.h"
#import "SentrySDK+Private.h"
#import "SentrySessionReplay.h"

Expand All @@ -24,17 +24,17 @@ - (BOOL)installWithOptions:(nonnull SentryOptions *)options
}

if (@available(iOS 16.0, tvOS 16.0, *)) {
if (options.sessionReplaySettings.replaysSessionSampleRate == 0
&& options.sessionReplaySettings.replaysOnErrorSampleRate == 0) {
if (options.sessionReplayOptions.replaysSessionSampleRate == 0
&& options.sessionReplayOptions.replaysOnErrorSampleRate == 0) {
return NO;
}

sessionReplay =
[[SentrySessionReplay alloc] initWithSettings:options.sessionReplaySettings];
[[SentrySessionReplay alloc] initWithSettings:options.sessionReplayOptions];

[sessionReplay
start:SentryDependencyContainer.sharedInstance.application.windows.firstObject
fullSession:[self shouldReplayFullSession:options.sessionReplaySettings
fullSession:[self shouldReplayFullSession:options.sessionReplayOptions
.replaysSessionSampleRate]];

SentryClient *client = [SentrySDK.currentHub getClient];
Expand Down
4 changes: 2 additions & 2 deletions Sources/Sentry/include/SentrySessionReplay.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#import "SentryClient+Private.h"
#import "SentryEvent.h"
#import "SentryReplaySettings.h"
#import "SentryReplayOptions.h"
#import <Foundation/Foundation.h>

#if SENTRY_HAS_UIKIT
Expand All @@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN

@interface SentrySessionReplay : NSObject <SentryClientAttachmentProcessor>

- (instancetype)initWithSettings:(SentryReplaySettings *)replaySettings;
- (instancetype)initWithSettings:(SentryReplayOptions *)replaySettings;

/**
* Start recording the session using rootView as image source.
Expand Down

0 comments on commit 39f8f3d

Please sign in to comment.