ScreenAnnotationCapture class
Combines screen share video with annotation canvas into a single MediaStream.
This class replicates React's ScreenboardModal approach exactly:
- screenVideo: Hidden HTMLVideoElement playing the screen share
- mainScreenCanvas: Hidden HTMLCanvasElement that combines video + annotations
- drawCombined(): Draws video frame, then annotation overlay
- captureStream(30): Creates MediaStream from the combined canvas
The interval-based drawing (30ms in React) ensures smooth output.
Constructors
Properties
- annotationCanvas → HTMLCanvasElement?
-
The annotation canvas element for external drawing
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → int
-
no setter
- isCapturing → bool
-
Whether capture is currently active
no setter
- processedStream → MediaStream?
-
The combined MediaStream (video + annotations)
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- width → int
-
Canvas dimensions
no setter
Methods
-
clearAnnotationCanvas(
) → void - Clear the annotation canvas.
-
dispose(
) → void - Dispose of all resources.
-
drawToAnnotationCanvas(
{required String type, required double x1, required double y1, required double x2, required double y2, required String color, required double thickness, List< Map< ? freehandPoints}) → voidString, dynamic> > - Draw a shape to the annotation canvas.
-
initialize(
MediaStream localStreamScreen) → Future< HTMLCanvasElement?> - Initialize the annotation capture system with screen share stream.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
redrawShapes(
List< Map< shapes) → voidString, dynamic> > - Redraw all shapes to the annotation canvas.
-
startCapture(
{int frameRate = 30}) → Future< MediaStream?> - Start capturing the combined video + annotation stream.
-
stopCapture(
) → void - Stop capturing and clean up resources.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited