{"id":26722943,"url":"https://github.com/useallfive/scrub.js","last_synced_at":"2025-06-22T07:04:35.882Z","repository":{"id":19126838,"uuid":"22356278","full_name":"UseAllFive/scrub.js","owner":"UseAllFive","description":null,"archived":false,"fork":false,"pushed_at":"2015-03-27T18:41:53.000Z","size":236,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-03-27T20:43:16.111Z","etag":null,"topics":[],"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/UseAllFive.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":"2014-07-28T20:12:00.000Z","updated_at":"2015-03-30T21:51:17.000Z","dependencies_parsed_at":"2022-07-21T07:00:24.508Z","dependency_job_id":null,"html_url":"https://github.com/UseAllFive/scrub.js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/UseAllFive/scrub.js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UseAllFive%2Fscrub.js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UseAllFive%2Fscrub.js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UseAllFive%2Fscrub.js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UseAllFive%2Fscrub.js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UseAllFive","download_url":"https://codeload.github.com/UseAllFive/scrub.js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UseAllFive%2Fscrub.js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261250272,"owners_count":23130540,"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":[],"created_at":"2025-03-27T20:38:22.366Z","updated_at":"2025-06-22T07:04:30.867Z","avatar_url":"https://github.com/UseAllFive.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"scrub.js ![](logo.png)\n==================\nMap scroll progress to a video timeline. As seen on http://useallfive.com/process/.\n\n## Examples\n[Video mapped to document scroll](https://useallfive.github.io/scrub.js/document-example.html)\n\n[Video mapped to div scroll](https://useallfive.github.io/scrub.js/inside-div-example.html)\n\n\n# Usage\n\n## Options\n* **`preload`**: Download the entire video file into browser memory, and use its object URL as the video source. Yields best scrubbing performance.\n    * default: `true`\n* **`container`**: The viewable 'window' of the scrollable content.\n    * default: `$(window)` \n* **`contentBody`**: The scrollable content body within `container`.\n    * default: `$(document)` \n* **`urls`**: Array of video asset URLs.\n    * default: `[]` \n\n## Setup\n### Include plugin after jQuery.\n```html\n\u003cscript src=\"http://code.jquery.com/jquery-2.1.1.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"dist/scrub.min.js\"\u003e\u003c/script\u003e\n```\n\n### Add video element. (Minimum markup)\n```html\n\u003c!-- ... --\u003e\n\u003cvideo id=\"background\"\u003e\u003c/video\u003e\n\u003c!-- ... --\u003e\n```\n\n# Code samples\n### Map video `currentTime` to document scroll progress (default)\n[Working example](https://useallfive.github.io/scrub.js/document-example.html)\n\nJavascript\n```javascript\nvar $video = $('#background');\n$video.scrub({\n    urls: [\n        'aboutBg.mov',\n        'aboutBg.ogv'\n    ]\n});\n```\n\n### Map video `currentTime` to an element's scroll progress.\n[Working example](https://useallfive.github.io/scrub.js/inside-div-example.html)\n\nExample scrollable div markup\n```html\n\u003chtml\u003e\n  \u003chead\u003e\n    \u003cstyle type=\"text/css\"\u003e\n      #container {\n        overflow: scroll;\n      }\n    \u003c/style\u003e\n  \u003c/head\u003e\n  \u003c!-- ... --\u003e\n    \u003cvideo id=\"background\"\u003e\u003c/video\u003e\n    \u003c!-- Scrollable container (with overflow scroll) --\u003e\n    \u003cdiv id=\"container\"\u003e\n        \u003c!-- Scrollable content body --\u003e\n        \u003cdiv id=\"content\"\u003e\u003c/div\u003e\n    \u003c/div\u003e\n    \u003c!-- ... --\u003e\n```\n\nJavascript\n```javascript\nvar $video = $('#background');\n$video.scrub({\n    container: '#container',\n    contentBody: '#content',\n    urls: [\n        'aboutBg.mov',\n        'aboutBg.ogv'\n    ]\n});\n```\n\n### Video ready event\nThe jQuery selector on which the plugin was called will trigger a `loaded` event once scrubbing functionality has been bound. Be sure to bind to the `loaded` event before calling `scrub()` to ensure that the loaded event doesn't fire before the custom event is bound.\n```javascript\n// Assume #loading is some div containing a loading indicator\nvar $loading = $('#loading');\nvar $video = $('#video');\n// Bind to the `loaded` event before calling scrub to ensure that the \n// loaded event doesn't fire before the custom event is bound.\n$video.on('loaded', function() {\n    $loading.hide();\n    $video.show();\n});\n// ...\n$video.scrub({ // ...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuseallfive%2Fscrub.js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuseallfive%2Fscrub.js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuseallfive%2Fscrub.js/lists"}