Learning Byte Summary
Learning Objectives (LOs): describe how adaptive morphing helps a drone adjust during flight
Grade level: Middle school
Duration: ~7 min
Key ideas: Adaptive morphing; Control responses; Flight stability

// Serialize seeks so repeated back-and-forth clicks don’t thrash the player. let seekingLock = false; let resumeAfterSeek = false;

video.addEventListener(‘error’, () => { const e = video.error; console.warn(‘Video error:’, e && e.code, e); });

function clampTime(t) { const dur = video.duration || 0; return Math.max(0, Math.min(t, Math.max(0, dur - 0.05))); }

function seekTo(t) { if (!Number.isFinite(video.duration) || video.duration <= 0) { video.addEventListener(‘loadedmetadata’, () => seekTo(t), { once: true }); try { video.load(); } catch (_) {} return; }

// If a seek is already in-flight, wait for it to complete before starting a new one.
if (seekingLock) {
  // Queue a follow-up seek once current one completes.
  video.addEventListener('seeked', () => seekTo(t), { once: true });
  return;
}

seekingLock = true;

// Remember whether we were playing before the seek
const wasPlaying = !video.paused && !video.ended;
resumeAfterSeek = wasPlaying || true; // resume even if paused to feel snappy on chapter click

const target = clampTime(t);

// Do the actual seek
if (typeof video.fastSeek === 'function') {
  try { video.fastSeek(target); } catch (_) { video.currentTime = target; }
} else {
  video.currentTime = target;
}

// Only resume after the browser confirms the seek completed
video.addEventListener('seeked', () => {
  seekingLock = false;
  if (resumeAfterSeek) {
    // Small microtask helps some browsers after currentTime changes
    Promise.resolve().then(() => video.play()).catch(() => {});
  }
  highlightActiveButton();
}, { once: true });   }

function highlightActiveButton() { const ct = video.currentTime || 0; let best = 0; for (let i = 0; i < buttons.length; i++) { const mark = parseFloat(buttons[i].dataset.time) || 0; if (ct + 0.01 >= mark) best = i; } buttons.forEach((b, i) => b.classList.toggle(‘active’, i === best)); }

// Bind clicks buttons.forEach(btn => { btn.addEventListener(‘click’, () => { const t = parseFloat(btn.dataset.time); if (Number.isFinite(t)) seekTo(t); }); });

// Keep the button highlight in sync video.addEventListener(‘timeupdate’, highlightActiveButton); video.addEventListener(‘loadedmetadata’, highlightActiveButton);

// If metadata already available (bfcache/back nav), initialize immediately if (video.readyState >= 1) highlightActiveButton(); })(); </script>

Reflection
In your own words, what is the main idea of Adaptive Morphing?
Reflection
Summarize what you have learned today.
Reflection
What did you find most surprising or intriguing in this learning byte?
Understanding Check
How well do you understand: describe how adaptive morphing helps a drone adjust during flight?
1 out of 5
How to Cite: Sinha, R. (2026). Adaptive Morphing. Amazing Birds. https://amazing-birds.gitlab.io/
GenAI Assistance: Some content and materials on this page may have been developed with GenAI assistance; all content was reviewed, edited, and integrated by the author(s).
Creative Commons BY-NC-SA 4.0 license badge
This page is an open educational resource (OER) licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Feel free to use, link, or embed this page for non-commercial educational purposes with attribution. Please share any adaptations under the same CC BY-NC-SA 4.0 license.
This page may include third-party images, videos, and other materials that have their own licenses and terms of use. Please verify before reusing these materials.
Feedback: If you notice any accessibility issues, incorrect information, or have suggestions for improvement, please use the feedback form.

Updated: