Skip to content

Commit

Permalink
Merge 7116036 into 724865d
Browse files Browse the repository at this point in the history
  • Loading branch information
romtsn authored Oct 8, 2024
2 parents 724865d + 7116036 commit 3e89ea1
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- If you're using code obfuscation, adjust your proguard-rules accordingly, so your custom view class name is not minified
- Session Replay: Support Jetpack Compose masking ([#3739](https://github.com/getsentry/sentry-java/pull/3739))
- To selectively mask/unmask @Composables, use `Modifier.sentryReplayMask()` and `Modifier.sentryReplayUnmask()` modifiers
- Session Replay: Mask `WebView`, `VideoView` and `androidx.media3.ui.PlayerView` by default ([#3775](https://github.com/getsentry/sentry-java/pull/3775))

### Fixes

Expand Down
3 changes: 3 additions & 0 deletions sentry-android-replay/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@
# Rules to detect a compose view to parse its hierarchy
-dontwarn androidx.compose.ui.platform.AndroidComposeView
-keepnames class androidx.compose.ui.platform.AndroidComposeView
# Rules to detect a media player view to later mask it
-dontwarn androidx.media3.ui.PlayerView
-keepnames class androidx.media3.ui.PlayerView
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ internal class SimpleVideoEncoder(
)
format.setInteger(MediaFormat.KEY_BIT_RATE, bitRate)
format.setFloat(MediaFormat.KEY_FRAME_RATE, muxerConfig.frameRate.toFloat())
format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, -1) // use -1 to force always non-key frames, meaning only partial updates to save the video size
format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, 10) // use 10 to force non-key frames, meaning only partial updates to save the video size. Every 10th second is a key frame, which is useful for buffer mode

format
}
Expand Down
3 changes: 3 additions & 0 deletions sentry/api/sentry.api
Original file line number Diff line number Diff line change
Expand Up @@ -2709,8 +2709,11 @@ public final class io/sentry/SentryReplayEvent$ReplayType$Deserializer : io/sent
}

public final class io/sentry/SentryReplayOptions {
public static final field ANDROIDX_MEDIA_VIEW_CLASS_NAME Ljava/lang/String;
public static final field IMAGE_VIEW_CLASS_NAME Ljava/lang/String;
public static final field TEXT_VIEW_CLASS_NAME Ljava/lang/String;
public static final field VIDEO_VIEW_CLASS_NAME Ljava/lang/String;
public static final field WEB_VIEW_CLASS_NAME Ljava/lang/String;
public fun <init> ()V
public fun <init> (Ljava/lang/Double;Ljava/lang/Double;)V
public fun addMaskViewClass (Ljava/lang/String;)V
Expand Down
6 changes: 6 additions & 0 deletions sentry/src/main/java/io/sentry/SentryReplayOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ public final class SentryReplayOptions {

public static final String TEXT_VIEW_CLASS_NAME = "android.widget.TextView";
public static final String IMAGE_VIEW_CLASS_NAME = "android.widget.ImageView";
public static final String WEB_VIEW_CLASS_NAME = "android.webkit.WebView";
public static final String VIDEO_VIEW_CLASS_NAME = "android.widget.VideoView";
public static final String ANDROIDX_MEDIA_VIEW_CLASS_NAME = "androidx.media3.ui.PlayerView";

public enum SentryReplayQuality {
/** Video Scale: 80% Bit Rate: 50.000 */
Expand Down Expand Up @@ -99,6 +102,9 @@ public enum SentryReplayQuality {
public SentryReplayOptions() {
setMaskAllText(true);
setMaskAllImages(true);
maskViewClasses.add(WEB_VIEW_CLASS_NAME);
maskViewClasses.add(VIDEO_VIEW_CLASS_NAME);
maskViewClasses.add(ANDROIDX_MEDIA_VIEW_CLASS_NAME);
}

public SentryReplayOptions(
Expand Down

0 comments on commit 3e89ea1

Please sign in to comment.