{"id":17463593,"url":"https://github.com/rosszurowski/fitvids","last_synced_at":"2025-04-15T06:14:43.408Z","repository":{"id":7889792,"uuid":"9267193","full_name":"rosszurowski/fitvids","owner":"rosszurowski","description":"Make your video embeds responsive","archived":false,"fork":false,"pushed_at":"2020-12-12T01:40:45.000Z","size":800,"stargazers_count":117,"open_issues_count":3,"forks_count":10,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T06:14:38.060Z","etag":null,"topics":["fitvids","javascript","responsive","video"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rosszurowski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-04-06T21:51:50.000Z","updated_at":"2025-04-06T08:28:47.000Z","dependencies_parsed_at":"2022-09-03T09:51:07.098Z","dependency_job_id":null,"html_url":"https://github.com/rosszurowski/fitvids","commit_stats":null,"previous_names":["rosszurowski/vanilla-fitvids"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosszurowski%2Ffitvids","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosszurowski%2Ffitvids/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosszurowski%2Ffitvids/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rosszurowski%2Ffitvids/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rosszurowski","download_url":"https://codeload.github.com/rosszurowski/fitvids/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249016641,"owners_count":21198833,"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":["fitvids","javascript","responsive","video"],"created_at":"2024-10-18T10:24:33.194Z","updated_at":"2025-04-15T06:14:43.392Z","avatar_url":"https://github.com/rosszurowski.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fitvids\n\nLets your videos be responsive by wrapping them in an [aspect ratio container](http://alistapart.com/article/creating-intrinsic-ratios-for-video).\n\nThis module is based heavily off of Dave Rupert's [FitVids jQuery plugin](https://github.com/davatron5000/FitVids.js).\n\n## Install\n\n```bash\nnpm install fitvids --save\n```\n\nYou can also [download the files manually](https://raw.githubusercontent.com/rosszurowski/vanilla-fitvids/master/dist/fitvids.min.js) and include them via a `\u003cscript\u003e` tag.\n\n## Usage\n\n```javascript\nfitvids() // Bam, done.\n```\n\nThe module exports a single function. Just call it, and it'll wrap video embeds from Youtube, Vimeo, and Kickstarter in a responsive container. Other video players can be supported by passing a custom selector via [the options](#custom-players).\n\nTo wrap videos that have been added to the page dynamically, just call the function again. Fitvids is smart enough to only wrap the new videos.\n\n## Options\n\n#### Container Selector\n\nTo only wrap videos that are a child of an element, you can provide an optional selector:\n\n```javascript\nfitvids('.video-container')\n```\n\nOnly videos that are descendants of `.video-container` will be made responsive.\n\n#### Custom Players\n\nBy default, fitvids automatically wraps Youtube, Vimeo, and Kickstarter players, but if you'd like it to wrap others too, you can pass them in as selectors via the `players` property.\n\n```javascript\nfitvids({\n  players: 'iframe[src*=\"example.com\"]'\n})\n```\n\nOr several at once:\n\n```javascript\nfitvids('.video-container', {\n  players: ['iframe[src*=\"example1.com\"]', 'iframe[src*=\"example2.com\"]']\n})\n```\n\n#### Ignoring Selectors\n\nIf you'd like to ignore certain videos, you can pass a selector via the `ignore` option:\n\n```javascript\nfitvids({\n  ignore: ['object']\n})\n```\n\n### Browser Support\n\nThis module supports every modern browser. It uses [ES5 Array methods](http://caniuse.com/#feat=es5) and [`querySelector`](http://caniuse.com/#feat=queryselector). If you need to use fitvids on a legacy browser, fitvids will work as long as these features are polyfilled.\n\n### Contributing\n\nFeel free to make issues or pull requests with bug reports or suggestions.\n\nWhen contributing code, you can run tests via:\n\n```\nmake test\n```\n\nTo build distributable versions of the script, run:\n\n```\nmake build\n```\n\n### License\n\n[WTFPL](http://www.wtfpl.net)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frosszurowski%2Ffitvids","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frosszurowski%2Ffitvids","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frosszurowski%2Ffitvids/lists"}