{# Embedded HTML5 video, with optional force-watch gating and telemetry. When `id` is set, three telemetry columns are written to the database: {id}_started (epoch seconds when first played, 0 if never), {id}_ended (epoch seconds at last observed activity), and {id}_watched (accumulated forward play time in seconds, excluding seeks and background-tab playback). Args: id (str, optional): When set, telemetry is recorded; when omitted, the video is purely embedded and produces no database columns. src (str): URL of the video file. width (int, optional): Pixel width of the video element. height (int, optional): Pixel height of the video element. autoplay (bool, optional): Start playback as soon as the page loads. Defaults to False. force_watch (bool, optional): When true, the Continue button is disabled until the participant has watched at least completion_threshold of the video. Defaults to False. completion_threshold (float, optional): Fraction of total duration that counts as "watched". Defaults to 0.98. minimal_controls (bool, optional): When true, hide native controls and show only a custom Play/Pause button. When false, native controls are shown; if force_watch is also true, a snap-back guard prevents seeking past the supposed playhead position. Defaults to False. Example: { "questiontype": "video", "id": "new_video", "instructions": "", "src": "/static/intro.mp4", "force_watch": false, "completion_threshold": 0.98, "minimal_controls": false } #} {% set fw = question.force_watch|default(false) %} {% set min_ctrl = question.minimal_controls|default(false) %} {% set threshold = question.completion_threshold|default(0.98) %} {% set prior_started = question.prior_started|default(0) %} {% set prior_ended = question.prior_ended|default(0) %} {% set prior_watched = question.prior_watched|default(0) %}