{# Video question type. Renders an HTML5 from an arbitrary URL. Optionally enforces "watch to completion" before allowing the participant to continue, and (when `id` is set) logs viewing telemetry to the database. JSON fields: src (required) URL of the video. width, height (optional) pixel dimensions for the video element. autoplay (optional, default false) force_watch (optional, default false) When true, btnNext is disabled until the participant watches at least `completion_threshold` of the video's duration. completion_threshold (optional, default 0.98) Fraction of duration that counts as "watched". minimal_controls (optional, default false) When true, hides the native controls and shows 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. id (optional) When set, three columns are written to the questionnaire table: {id}_started — epoch seconds when the participant first pressed play (0 if never). {id}_ended — epoch seconds at last observed activity (play/timeupdate/pause). {id}_watched — accumulated forward play time (seconds), excluding seeks and background-tab playback. #} {% 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) %} Your browser does not support HTML5 video. {% if min_ctrl %} Play {% endif %} {% if question.id %} {% endif %}