ActivityVideoPreviewSettings constructor

const ActivityVideoPreviewSettings({
  1. Duration duration = const Duration(seconds: 30),
  2. int fps = 30,
  3. int videoWidth = 1280,
  4. int videoHeight = 720,
  5. Duration introHold = const Duration(seconds: 5),
  6. double overviewFillFraction = 0.84,
  7. Duration outroHold = Duration.zero,
  8. Duration peakOrbit = Duration.zero,
  9. double peakOrbitDegrees = 360.0,
  10. double peakOrbitTiltDegrees = 62.0,
  11. bool showTrack = true,
  12. bool showStartMarker = true,
  13. bool showPositionMarker = true,
  14. double markerDiameterFraction = 0.035,
  15. Color trackColor = const Color.fromARGB(255, 131, 79, 255),
  16. double trackBorderFraction = 0.0,
  17. double trackWidthFraction = 0.0075,
  18. double watermarkHeightFraction = 0.028,
  19. double watermarkAlpha = 0.5,
  20. double chaseTiltDegrees = 55.0,
  21. double chaseWindowMeters = 300.0,
  22. double headingSmoothFactor = 0.12,
  23. double minLookAheadMeters = 25.0,
  24. double maxHeadingDegPerFrame = 1.5,
  25. int smoothingWindow = 9,
  26. Duration dataWarmup = const Duration(milliseconds: 3000),
  27. Duration frameSettleTimeout = const Duration(milliseconds: 800),
  28. Duration jumpSettleTimeout = const Duration(milliseconds: 4000),
})

Creates a new ActivityVideoPreviewSettings instance.

Omitted values take the native defaults.

Parameters

  • duration: Total length of the video. Defaults to 30 seconds.
  • fps: Video frame rate. Defaults to 30.
  • videoWidth: Video frame width in pixels. Defaults to 1280.
  • videoHeight: Video frame height in pixels. Defaults to 720.
  • introHold: Whole-track overview held before the fly-over. Defaults to 5 seconds.
  • overviewFillFraction: Fraction of the frame the whole track may span in the overviews. Defaults to 0.84.
  • outroHold: Whole-track overview held after the fly-over. Defaults to zero.
  • peakOrbit: Camera orbit around the track end after the fly-over. Defaults to zero.
  • peakOrbitDegrees: Angle the camera travels during peakOrbit. Defaults to 360.
  • peakOrbitTiltDegrees: Camera tilt at the middle of peakOrbit. Defaults to 62.
  • showTrack: Whether the track polyline is drawn. Defaults to true.
  • showStartMarker: Whether a green dot marks the track start. Defaults to true.
  • showPositionMarker: Whether a red dot marks the current position. Defaults to true.
  • markerDiameterFraction: Diameter of the start and position dots. Defaults to 0.035.
  • trackColor: Track polyline color. Defaults to Magic Lane purple (131, 79, 255).
  • trackBorderFraction: Track outline width. Defaults to zero (no outline).
  • trackWidthFraction: Track line width. Defaults to 0.0075.
  • watermarkHeightFraction: Height of the composited watermark. Defaults to 0.028.
  • watermarkAlpha: Opacity of the composited watermark. Defaults to 0.5.
  • chaseTiltDegrees: Camera tilt while following the track. Defaults to 55.
  • chaseWindowMeters: Minimum half-size of the chase window. Defaults to 300.
  • headingSmoothFactor: Per-frame smoothing of the camera heading. Defaults to 0.12.
  • minLookAheadMeters: Minimum look-ahead distance for the heading. Defaults to 25.
  • maxHeadingDegPerFrame: Largest heading change per frame. Defaults to 1.5.
  • smoothingWindow: Moving-average window applied to the track. Defaults to 9.
  • dataWarmup: Minimum wait for map data before the first frames. Defaults to 3 seconds.
  • frameSettleTimeout: Per-frame budget for map data. Defaults to 800 milliseconds.
  • jumpSettleTimeout: Budget after camera jumps and style switches. Defaults to 4 seconds.

Implementation

const ActivityVideoPreviewSettings({
  this.duration = const Duration(seconds: 30),
  this.fps = 30,
  this.videoWidth = 1280,
  this.videoHeight = 720,
  this.introHold = const Duration(seconds: 5),
  this.overviewFillFraction = 0.84,
  this.outroHold = Duration.zero,
  this.peakOrbit = Duration.zero,
  this.peakOrbitDegrees = 360.0,
  this.peakOrbitTiltDegrees = 62.0,
  this.showTrack = true,
  this.showStartMarker = true,
  this.showPositionMarker = true,
  this.markerDiameterFraction = 0.035,
  this.trackColor = const Color.fromARGB(255, 131, 79, 255),
  this.trackBorderFraction = 0.0,
  this.trackWidthFraction = 0.0075,
  this.watermarkHeightFraction = 0.028,
  this.watermarkAlpha = 0.5,
  this.chaseTiltDegrees = 55.0,
  this.chaseWindowMeters = 300.0,
  this.headingSmoothFactor = 0.12,
  this.minLookAheadMeters = 25.0,
  this.maxHeadingDegPerFrame = 1.5,
  this.smoothingWindow = 9,
  this.dataWarmup = const Duration(milliseconds: 3000),
  this.frameSettleTimeout = const Duration(milliseconds: 800),
  this.jumpSettleTimeout = const Duration(milliseconds: 4000),
}) : assert(fps > 0),
     assert(videoWidth >= 0 && videoHeight >= 0),
     assert(overviewFillFraction > 0 && overviewFillFraction < 1),
     assert(watermarkAlpha > 0 && watermarkAlpha <= 1),
     assert(headingSmoothFactor > 0 && headingSmoothFactor <= 1);