Skip to content

Commit 88722ce

Browse files
authored
Merge 01a749e into fcec2f2
2 parents fcec2f2 + 01a749e commit 88722ce

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Improvements
66

77
- Fallback to distinct-id as user.id logging attribute when user is not set ([#4847](https://github.com/getsentry/sentry-java/pull/4847))
8+
- Session Replay: Add screenshot strategy serialization to RRWeb events ([#4851](https://github.com/getsentry/sentry-java/pull/4851))
89

910
## 8.25.0
1011

sentry/src/main/java/io/sentry/rrweb/RRWebOptionsEvent.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import io.sentry.JsonUnknown;
77
import io.sentry.ObjectReader;
88
import io.sentry.ObjectWriter;
9+
import io.sentry.ScreenshotStrategyType;
910
import io.sentry.SentryOptions;
1011
import io.sentry.SentryReplayOptions;
1112
import io.sentry.protocol.SdkVersion;
@@ -52,6 +53,12 @@ public RRWebOptionsEvent(final @NotNull SentryOptions options) {
5253
optionsPayload.put("quality", replayOptions.getQuality().serializedName());
5354
optionsPayload.put("maskedViewClasses", replayOptions.getMaskViewClasses());
5455
optionsPayload.put("unmaskedViewClasses", replayOptions.getUnmaskViewClasses());
56+
57+
final String screenshotStrategy =
58+
(replayOptions.getScreenshotStrategy() == ScreenshotStrategyType.PIXEL_COPY)
59+
? "pixelCopy"
60+
: "canvas";
61+
optionsPayload.put("screenshotStrategy", screenshotStrategy);
5562
}
5663

5764
@NotNull

sentry/src/test/resources/json/rrweb_options_event.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"maskedViewClasses": [],
1313
"nativeSdkName": "sentry.java",
1414
"sessionSampleRate": 0.5,
15-
"quality": "low"
15+
"quality": "low",
16+
"screenshotStrategy": "pixelCopy"
1617
}
1718
}
1819
}

0 commit comments

Comments
 (0)