MediaSFU Angular
    Preparing search index...

    Class ScreenboardModal

    ScreenboardModal - Modal for annotating on shared screen in real-time

    Provides drawing/annotation tools for marking up a shared screen during screen sharing. Displays canvas overlay for annotations that are visible to all participants.

    Supports three levels of customization:

    1. Basic Usage: Use default modal UI with canvas annotation tools
    2. Style Customization: Override modal appearance with overlayStyle and contentStyle
    3. Full Override: Provide a custom template via customTemplate for complete control

    Key Features:

    • Canvas-based screen annotation
    • Real-time annotation preview
    • Drawing tools (pen, highlighter, shapes)
    • Clear/undo annotations
    • Screen transport management
    • Annotation interval updates

    app-screenboard-modal

    true

    CommonModule, FormsModule, FontAwesomeModule

    parameters - Object containing screen stream, annotation settings, and MediaSoup transport methods. Default: {}

    isVisible - Whether the modal is currently visible. Default: false

    onClose - Callback function to close the modal. Default: () => {}

    position - Modal position on screen ('topRight', 'fullscreen', etc.). Default: 'topRight'

    backgroundColor - Background color of the modal content. Default: '#83c0e9'

    overlayStyle - Custom CSS styles for the modal overlay backdrop. Default: undefined

    contentStyle - Custom CSS styles for the modal content container. Default: undefined

    customTemplate - Custom TemplateRef to completely replace default modal template. Default: undefined

    ngOnInit - Initializes component (non-view dependent logic)

    ngOnDestroy - Cleanup: stops annotations and removes intervals

    ngOnChanges - Updates modal state when visibility changes

    ngAfterViewInit - Sets up canvas and video elements after view init

    showModal - Shows modal and initializes screen annotation

    hideModal - Hides modal and cleans up annotation resources

    annotationPreview - Handles real-time annotation preview rendering

    handleScreenTransport - Manages screen share transport logic

    stopAnnotation - Stops annotation intervals and resets canvas

    stopAllTracks - Stops all media tracks in cloned screen stream

    getCombinedOverlayStyle - Merges default and custom overlay styles

    getCombinedContentStyle - Merges default and custom content styles

    Implements

    • OnInit
    • OnDestroy
    • OnChanges
    • AfterViewInit
    Index

    Constructors

    Methods

    • A callback method that is invoked immediately after the default change detector has checked the directive's data-bound properties for the first time, and before any of the view or content children have been checked. It is invoked only once when the directive is instantiated.

      Returns void

    • A callback method that is invoked immediately after the default change detector has checked data-bound properties if at least one has changed, and before the view and content children are checked.

      Parameters

      • changes: SimpleChanges

        The changed properties.

      Returns void

    Properties

    parameters: ScreenboardModalParameters = ...
    isVisible: boolean = false
    onClose: () => void
    position: string = 'topRight'
    backgroundColor: string = '#83c0e9'
    overlayStyle?: Partial<CSSStyleDeclaration>
    contentStyle?: Partial<CSSStyleDeclaration>
    customTemplate?: any
    screenVideoRef: ElementRef<HTMLVideoElement>
    screenCanvasRef: ElementRef<HTMLCanvasElement>
    faTimes: IconDefinition = faTimes