@@ -61,8 +61,6 @@ class SentryFlutterPlugin :
6161 when (call.method) {
6262 " initNativeSdk" -> initNativeSdk(call, result)
6363 " closeNativeSdk" -> closeNativeSdk(result)
64- " setReplayConfig" -> setReplayConfig(call, result)
65- " captureReplay" -> captureReplay(result)
6664 else -> result.notImplemented()
6765 }
6866 }
@@ -354,73 +352,4 @@ class SentryFlutterPlugin :
354352 }
355353 }
356354 }
357-
358- private fun setReplayConfig (
359- call : MethodCall ,
360- result : Result ,
361- ) {
362- // Since codec block size is 16, so we have to adjust the width and height to it,
363- // otherwise the codec might fail to configure on some devices, see
364- // https://cs.android.com/android/platform/superproject/+/master:frameworks/base/media/java/android/media/MediaCodecInfo.java;l=1999-2001
365- val windowWidth = call.argument(" windowWidth" ) as ? Double ? : 0.0
366- val windowHeight = call.argument(" windowHeight" ) as ? Double ? : 0.0
367-
368- var width = call.argument(" width" ) as ? Double ? : 0.0
369- var height = call.argument(" height" ) as ? Double ? : 0.0
370-
371- val invalidConfig =
372- width == 0.0 ||
373- height == 0.0 ||
374- windowWidth == 0.0 ||
375- windowHeight == 0.0
376-
377- if (invalidConfig) {
378- result.error(
379- " 5" ,
380- " Replay config is not valid: width: $width , height: $height , " +
381- " windowWidth: $windowWidth , windowHeight: $windowHeight " ,
382- null ,
383- )
384- return
385- }
386-
387- // First update the smaller dimension, as changing that will affect the screen ratio more.
388- if (width < height) {
389- val newWidth = width.adjustReplaySizeToBlockSize()
390- height = (height * (newWidth / width)).adjustReplaySizeToBlockSize()
391- width = newWidth
392- } else {
393- val newHeight = height.adjustReplaySizeToBlockSize()
394- width = (width * (newHeight / height)).adjustReplaySizeToBlockSize()
395- height = newHeight
396- }
397-
398- val replayConfig =
399- ScreenshotRecorderConfig (
400- recordingWidth = width.roundToInt(),
401- recordingHeight = height.roundToInt(),
402- scaleFactorX = width.toFloat() / windowWidth.toFloat(),
403- scaleFactorY = height.toFloat() / windowHeight.toFloat(),
404- frameRate = call.argument(" frameRate" ) as ? Int ? : 0 ,
405- bitRate = call.argument(" bitRate" ) as ? Int ? : 0 ,
406- )
407- Log .i(
408- " Sentry" ,
409- " Configuring replay: %dx%d at %d FPS, %d BPS" .format(
410- replayConfig.recordingWidth,
411- replayConfig.recordingHeight,
412- replayConfig.frameRate,
413- replayConfig.bitRate,
414- ),
415- )
416- replay?.onConfigurationChanged(replayConfig)
417- result.success(" " )
418- }
419-
420- private fun captureReplay (
421- result : Result ,
422- ) {
423- replay!! .captureReplay(isTerminating = false )
424- result.success(replay!! .getReplayId().toString())
425- }
426355}
0 commit comments