• Decode the timestamp from a video element and compute the latency between the timestamp and the current date.

    Parameters

    • sourceEl: HTMLVideoElement

      the video element to get the image from

    • canvas: HTMLCanvasElement
    • context: CanvasRenderingContext2D
    • Optional now: Date

      current date, new Date() by default

    • Optional blocksPerRow: number

      number of blocks in the line, 32 by default

    • Optional tolerance: number

      percentage of tolerance for the black and white threshold, 0.2 by default

    Returns number

    The latency in millisecond between 'now' and the decoded timestamp, 0 if the timestamp cannot be decoded

Generated using TypeDoc