{"id":29362914,"url":"https://github.com/acmertz/intermezzo.js","last_synced_at":"2026-05-18T11:05:14.311Z","repository":{"id":17069404,"uuid":"76999609","full_name":"acmertz/intermezzo.js","owner":"acmertz","description":"A virtual timeline written in JavaScript","archived":false,"fork":false,"pushed_at":"2022-12-29T20:07:49.000Z","size":1532,"stargazers_count":2,"open_issues_count":23,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-29T09:54:30.589Z","etag":null,"topics":["es2015","javascript","playback","timeline","webpack","workers"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/acmertz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-20T23:33:59.000Z","updated_at":"2020-04-02T09:28:35.000Z","dependencies_parsed_at":"2023-01-13T19:08:41.137Z","dependency_job_id":null,"html_url":"https://github.com/acmertz/intermezzo.js","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/acmertz/intermezzo.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmertz%2Fintermezzo.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmertz%2Fintermezzo.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmertz%2Fintermezzo.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmertz%2Fintermezzo.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acmertz","download_url":"https://codeload.github.com/acmertz/intermezzo.js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acmertz%2Fintermezzo.js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264428793,"owners_count":23606693,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["es2015","javascript","playback","timeline","webpack","workers"],"created_at":"2025-07-09T09:17:38.522Z","updated_at":"2026-05-18T11:05:09.280Z","avatar_url":"https://github.com/acmertz.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# intermezzo.js\n\n## Goals\n- Schedule events on a virtual timeline\n- Play, pause, and seek the timeline\n- Minimal performance impact to UI thread\n- Works in browsers that support [`performance.now()`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/now) (IE10+ and modern Chrome, FF, Edge, and Safari)\n\n## What it does\n- Schedule callbacks when events on the timeline begin and end\n- Compute timing in a Worker to minimize the amount of work that is done on the UI thread\n- Correct for `setTimeout` drift during playback\n\n## What it doesn't do\n- Animation and tweening\n- Update the UI (you should use [`requestAnimationFrame`](https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame) to repeatedly check the playback state if you want to perform your own actions during playback)\n- Render to a Canvas\n\n## Why intermezzo.js?\nintermezzo.js provides a simple way for you to create a timeline of arbitrary \"events\" and perform actions when those events begin or end. It makes no assumptions about the purpose of those events (you have to specify your own callbacks).\n\n## Usage and examples\n### Create a new instance of Intermezzo:\nYou may create multiple instances of Intermezzo within the same page. Instances operate independently of each other, and each instance creates its own Worker thread.\n\n    var intermezzo = new Intermezzo()\n\n### Add an event to the timeline:\nAdd an event to the timeline with the specified `time` and `duration`. If included, function `callback` is called when the event begins or ends during timeline playback. The event's unique ID (within this particular instance of Intermezzo) is returned.\n\n    var eventId = intermezzo.addEvent(time, duration, callback)\n\n### Remove an event from the timeline:\nRemove an existing event from the timeline by passing the ID returned from `addEvent`.\n\n    intermezzo.removeEvent(eventId)\n\n### Begin playback:\nStart playing back the timeline. Playback can only begin if the duration is greater than 0ms (calling `play` on an instance of Intermezzo with no events will have no effect).\n\n    intermezzo.play()\n\n### Pause playback:\nPause the playback. Has no effect if playback is already paused.\n\n    intermezzo.pause()\n\n### Seek to a time in milliseconds:\nSeek the timeline to a specific time in milliseconds. Has no effect if playback is in progress (you must pause playback before seeking).\n\n    intermezzo.seek(time)\n\n### Register a callback:\nFire a callback when one of the following things occurs (use one of these for the value of `type`):\n\n- `begin`: a timeline event has begun\n- `end`: a timeline event has ended\n- `play`: playback began\n- `pause`: playback paused\n- `stop`: playback stopped at the end of the timeline\n- `seek`: finished seeking to a new time\n\nThe registered callback will fire whenever an event of that type occurs.\n\n    intermezzo.registerCallback(type, callback)\n\n### Unregister a previously-added callback:\n    intermezzo.unregisterCallback(type, callback)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facmertz%2Fintermezzo.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facmertz%2Fintermezzo.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facmertz%2Fintermezzo.js/lists"}