ActivityVideoPreviewSettings constructor
const
ActivityVideoPreviewSettings({
- Duration duration = const Duration(seconds: 30),
- int fps = 30,
- int videoWidth = 1280,
- int videoHeight = 720,
- Duration introHold = const Duration(seconds: 5),
- double overviewFillFraction = 0.84,
- Duration outroHold = Duration.zero,
- Duration peakOrbit = Duration.zero,
- double peakOrbitDegrees = 360.0,
- double peakOrbitTiltDegrees = 62.0,
- bool showTrack = true,
- bool showStartMarker = true,
- bool showPositionMarker = true,
- double markerDiameterFraction = 0.035,
- Color trackColor = const Color.fromARGB(255, 131, 79, 255),
- double trackBorderFraction = 0.0,
- double trackWidthFraction = 0.0075,
- double watermarkHeightFraction = 0.028,
- double watermarkAlpha = 0.5,
- double chaseTiltDegrees = 55.0,
- double chaseWindowMeters = 300.0,
- double headingSmoothFactor = 0.12,
- double minLookAheadMeters = 25.0,
- double maxHeadingDegPerFrame = 1.5,
- int smoothingWindow = 9,
- Duration dataWarmup = const Duration(milliseconds: 3000),
- Duration frameSettleTimeout = const Duration(milliseconds: 800),
- 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 duringpeakOrbit. Defaults to 360.peakOrbitTiltDegrees: Camera tilt at the middle ofpeakOrbit. 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);