@ceeblue/web-utils
    Preparing search index...

    Function getLatency

    • 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
      • now: Date = ...

        current date, new Date() by default

      • tolerance: number = 0.2

        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