<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Joel Adeleye</title>
    <description>The latest articles on DEV Community by Joel Adeleye (@lahd).</description>
    <link>https://dev.to/lahd</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4251376%2F9070a7c1-7765-4229-b0a8-077ffe18d48c.jpg</url>
      <title>DEV Community: Joel Adeleye</title>
      <link>https://dev.to/lahd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lahd"/>
    <language>en</language>
    <item>
      <title>Drift: a lecture player that pauses when you doze off, and rewinds to where you stopped following</title>
      <dc:creator>Joel Adeleye</dc:creator>
      <pubDate>Thu, 19 Nov 2026 21:43:43 +0000</pubDate>
      <link>https://dev.to/lahd/drift-a-lecture-player-that-pauses-when-you-doze-off-and-rewinds-to-where-you-stopped-following-3fac</link>
      <guid>https://dev.to/lahd/drift-a-lecture-player-that-pauses-when-you-doze-off-and-rewinds-to-where-you-stopped-following-3fac</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/presage-2026-11-04"&gt;Presage SmartSpectra SDK Challenge&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;It's late, I'm watching a recorded lecture, my eyes close "for a second"… and when I open them the lecturer is three slides ahead. Or I get up for water and come back to five minutes I never heard. Then I scrub back and forth trying to find where I stopped following.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Drift&lt;/strong&gt; is a desktop lecture player that notices those moments through the webcam and handles them for you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Eyes closed for 3 s&lt;/strong&gt; → the lecture pauses and a marker drops on the progress bar where your eyes closed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You leave your seat&lt;/strong&gt; → it pauses and waits: "Paused: you stepped away · Waiting for you…"&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;When you're back&lt;/strong&gt; → one key (R) rewinds to 30 seconds before you drifted.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Looking down at your notes never pauses it.&lt;/strong&gt; Only a long look-away (20 s, adjustable) does.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;At the end&lt;/strong&gt; → a list of every moment you missed, each one click away.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's a study aid for anyone learning from recorded video: university lectures, online courses, exam prep. It makes no health claims and doesn't judge whether you're tired; it only notices closed eyes and an empty seat.&lt;/p&gt;

&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/Zhb10wr5ytM" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv8avo6g788p89c40evy2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fv8avo6g788p89c40evy2.jpg" alt="Drift's consent screen: what the camera looks at, what Drift never does, and what leaves the computer" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwzi43dqdmil039u8lca7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwzi43dqdmil039u8lca7.jpg" alt="The lecture paused with the card 'Paused: your eyes were closed', offering Rewind or Continue" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fci5b8zmzvl3vk0bavk75.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fci5b8zmzvl3vk0bavk75.jpg" alt="End-of-lecture summary: You drifted 5 times, with a Watch from button for each moment" width="800" height="420"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/lahdlahd" rel="noopener noreferrer"&gt;
        lahdlahd
      &lt;/a&gt; / &lt;a href="https://github.com/lahdlahd/drift" rel="noopener noreferrer"&gt;
        drift
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Drift&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/lahdlahd/drift/docs/cover.png"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Flahdlahd%2Fdrift%2FHEAD%2Fdocs%2Fcover.png" alt="Drift: the lecture pauses when you drift off"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A lecture player that pauses when you drift off, and rewinds to where you stopped following.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You're studying from a recorded lecture late at night. Your eyes close for a few
seconds, or you get up for a drink, and when you're back you've lost your
place. Drift watches for that through your webcam, using
&lt;a href="https://smartspectra.presagetech.com/docs/" rel="nofollow noopener noreferrer"&gt;Presage SmartSpectra&lt;/a&gt; face signals:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It pauses the lecture&lt;/strong&gt; when your eyes stay closed for 3 s, you leave your seat, or you look away for a long time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It marks the moment&lt;/strong&gt; on the progress bar.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It offers to rewind&lt;/strong&gt; when you're back: "Rewind to 14:02?", 30 s before you drifted.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It lists the moments you missed&lt;/strong&gt; at the end, so you can rewatch just those parts.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Drift is built for the &lt;a href="https://dev.to/challenges/presage-2026-11-04/" rel="nofollow"&gt;DEV Presage SmartSpectra SDK Challenge&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Drift is a study aid. It is not a medical, fatigue or safety device, does not…&lt;/p&gt;
&lt;/blockquote&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/lahdlahd/drift" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Windows 11 / Apple Silicon Mac / Linux x64 · Node 20+ · &lt;code&gt;npm install &amp;amp;&amp;amp; npm start&lt;/code&gt; · bring your own Presage key and any MP4 lecture. A 3-minute test script for judges is in the README.&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Responds to Human Signals
&lt;/h2&gt;

&lt;p&gt;Drift requests &lt;strong&gt;face metrics only&lt;/strong&gt; from SmartSpectra (&lt;code&gt;faceMetrics&lt;/code&gt;) and reacts in real time at 30 fps:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;What happens&lt;/th&gt;
&lt;th&gt;Signal&lt;/th&gt;
&lt;th&gt;Pause after&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Eyes closed&lt;/td&gt;
&lt;td&gt;Eye openness computed from the &lt;strong&gt;478 face landmarks&lt;/strong&gt;, below 60% of &lt;em&gt;your own&lt;/em&gt; open-eye level (measured in a 5-second calibration)&lt;/td&gt;
&lt;td&gt;3 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;You left&lt;/td&gt;
&lt;td&gt;Landmarks stop moving (the SDK repeats the last ones when the face is gone)&lt;/td&gt;
&lt;td&gt;4 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;You stood up (backup)&lt;/td&gt;
&lt;td&gt;No landmarks + validation code &lt;code&gt;NoFaceFound&lt;/code&gt; / &lt;code&gt;FaceTooHigh&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;4 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Long look-away&lt;/td&gt;
&lt;td&gt;No face tracked&lt;/td&gt;
&lt;td&gt;20 s&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Glance at notes&lt;/td&gt;
&lt;td&gt;No face tracked briefly, code &lt;code&gt;FaceTooLow&lt;/code&gt;
&lt;/td&gt;
&lt;td&gt;never&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;I tested the SDK before building on it.&lt;/strong&gt; My first plan was the obvious one: use &lt;code&gt;face.blinking&lt;/code&gt;. So before writing the app I built a small signal recorder and ran a 12-minute guided test (eyes closed 3 s × 10, notes, phone, leaving the seat) on my Dell Latitude's webcam. What I found changed the design:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;blinking&lt;/code&gt; reports &lt;em&gt;blinks&lt;/em&gt;, not closed eyes: it fired for only 0.14–0.21 s even during a 6-second closure, so it caught &lt;strong&gt;0/10&lt;/strong&gt; three-second closures.&lt;/li&gt;
&lt;li&gt;Eye openness from the landmarks caught &lt;strong&gt;10/10&lt;/strong&gt;, with &lt;strong&gt;0&lt;/strong&gt; false alarms in 5 minutes of normal watching, notes or phone use.&lt;/li&gt;
&lt;li&gt;After I left, validation still said &lt;code&gt;Ok&lt;/code&gt;, but the landmarks froze. That freeze is now the "away" signal.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;FaceTooLow&lt;/code&gt; appeared both when I looked down &lt;em&gt;and&lt;/em&gt; when I got up, so it never triggers a pause on its own.&lt;/li&gt;
&lt;li&gt;Lit from behind, my webcam fell to 15 fps and the SDK stopped (&lt;code&gt;kSustainedLowFrameRate&lt;/code&gt;); with a lamp in front it held 30 fps.&lt;/li&gt;
&lt;li&gt;Clear glasses work. Tinted or mirrored lenses hide the eyelids from the camera, so the camera check now tells you to take those off.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The recordings (eye-openness ratios and timings only, no images) are replayed by the unit tests, so every rule is checked against real data on every build.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How I integrated the SDK&lt;/strong&gt;, step by step:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Electron, following Presage's official quickstart.&lt;/strong&gt; &lt;code&gt;bindSmartSpectraIpc(win)&lt;/code&gt; in the main process, the SDK's preload bundled with my own narrow bridge (encrypted key + settings), context isolation and a sandboxed renderer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Drift owns the camera.&lt;/strong&gt; It opens the webcam at 640×480 / 30 fps, asks the camera to hold at least 24 fps, and hands the stream to the SDK with &lt;code&gt;useMediaStream&lt;/code&gt;. A camera check measures the real frame rate first, so the SDK never starts in light where it would stop.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Face metrics only, telemetry off:&lt;/strong&gt; &lt;code&gt;new SmartSpectraSDK({ apiKey, requestedMetrics: [...faceMetrics], enableTelemetry: false })&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Every &lt;code&gt;metrics&lt;/code&gt; event&lt;/strong&gt; is decoded with &lt;code&gt;decodeMetrics&lt;/code&gt;; from &lt;code&gt;face.landmarks&lt;/code&gt; Drift computes eye openness (the eye-aspect ratio on the MediaPipe eye points) and how much the face moved since the last frame. &lt;code&gt;validationStatus&lt;/code&gt; codes feed the position checks and the on-screen hints.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A presence tracker&lt;/strong&gt; turns those into watching / eyes closed / away / looking away, and &lt;strong&gt;a drift engine&lt;/strong&gt; maps the start of each episode onto the video timeline, pauses, and works out the rewind point. Only time while the lecture plays counts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Failure handling:&lt;/strong&gt; if the SDK stops (low frame rate, network) or Windows cuts the camera, the lecture pauses with an explanation instead of silently no longer watching, and Drift reconnects once by itself.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Best Thoughtful Real-World Use&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The need:&lt;/strong&gt; recorded lectures are now how many students learn, and they are often watched late and tired. Losing your place costs time and leaves gaps you don't notice until the exam.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Who it's for:&lt;/strong&gt; students and self-learners watching long recorded lectures and courses on a laptop.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How I designed it to be usable for them:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Calibrated to you:&lt;/strong&gt; a 20-second camera check measures your own normal eye openness and tells you in plain words if the light or framing is wrong.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Never in the way:&lt;/strong&gt; glancing at notes doesn't pause; only clear drifts do, and only while the lecture is playing. Three sensitivity presets and an adjustable look-away pause.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recovery in one key:&lt;/strong&gt; R rewinds to just before you drifted; Space continues. Markers and an end-of-lecture list show exactly what to rewatch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keyboard and screen-reader friendly:&lt;/strong&gt; every action has a shortcut; the pause card is announced; reduced motion is respected; status never relies on colour alone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Honest when it can't see you:&lt;/strong&gt; "Signal poor" and "Camera off" banners, and a pause card if the camera drops, so it never pretends to be watching.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Consent and Data Handling
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Consent first:&lt;/strong&gt; a plain-language screen explains what the camera looks at, what Drift never does and what leaves the computer. The camera stays off until you agree &lt;strong&gt;and&lt;/strong&gt; click "Turn on camera".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Always visible, always stoppable:&lt;/strong&gt; a "Camera on" pill shows whenever it's on; &lt;strong&gt;Esc&lt;/strong&gt; or &lt;strong&gt;Stop camera&lt;/strong&gt; turns it off from any screen, and you can withdraw consent in Settings. No covert or background monitoring: the camera only runs while Drift is open and you've turned it on.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No video stored or sent by Drift:&lt;/strong&gt; frames go only to the SmartSpectra SDK running inside the app. Drift never records, saves or uploads video or images.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Only what's needed:&lt;/strong&gt; face metrics only; no pulse, breathing or other vitals requested.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SDK telemetry:&lt;/strong&gt; turned off (&lt;code&gt;enableTelemetry: false&lt;/code&gt;). The SDK still contacts Presage with your key to check the key and credits.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Storage:&lt;/strong&gt; your API key, encrypted with Windows DPAPI via Electron &lt;code&gt;safeStorage&lt;/code&gt; (never plain text, never in the repo), and a small settings file (consent, preferences, your open-eye level). The list of drift moments lives in memory and is gone when you close the app.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Deletion:&lt;/strong&gt; Settings → Remove key; delete Drift's user-data folder (&lt;code&gt;%APPDATA%\Drift&lt;/code&gt;) to remove everything else.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sharing and retention:&lt;/strong&gt; nothing is shared and nothing else is retained.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI services:&lt;/strong&gt; none. Drift uses no AI service at run time.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not a health tool:&lt;/strong&gt; no diagnosis, no fatigue scores, no medical decisions, not for driving.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Agent Session
&lt;/h2&gt;

&lt;p&gt;I built Drift with Claude as a coding assistant, milestone by milestone, testing each one on my laptop before moving on.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>presagechallenge</category>
      <category>electron</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
