{"id":17676345,"url":"https://github.com/jermspeaks/autoplay-detection","last_synced_at":"2025-07-18T03:07:13.309Z","repository":{"id":57187607,"uuid":"106038419","full_name":"jermspeaks/autoplay-detection","owner":"jermspeaks","description":"Browser-based autoplay with sound on detector","archived":false,"fork":false,"pushed_at":"2017-10-06T21:42:22.000Z","size":207,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-02T09:10:28.754Z","etag":null,"topics":["audio","autoplay","browsers","video"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jermspeaks.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-06T18:39:20.000Z","updated_at":"2017-10-06T21:24:23.000Z","dependencies_parsed_at":"2022-08-28T10:51:31.063Z","dependency_job_id":null,"html_url":"https://github.com/jermspeaks/autoplay-detection","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jermspeaks%2Fautoplay-detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jermspeaks%2Fautoplay-detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jermspeaks%2Fautoplay-detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jermspeaks%2Fautoplay-detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jermspeaks","download_url":"https://codeload.github.com/jermspeaks/autoplay-detection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246352508,"owners_count":20763485,"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":["audio","autoplay","browsers","video"],"created_at":"2024-10-24T07:25:18.558Z","updated_at":"2025-03-30T17:24:37.867Z","avatar_url":"https://github.com/jermspeaks.png","language":"JavaScript","readme":"# Autoplay Detection\n\n**This Library is not production ready yet. Use with discretion.**\n\nA small library to detect if autoplay with sound is working on the page.\n\n## Installation\n\nThe package is bundled with [UMD](https://github.com/umdjs/umd), so there's support for AMD, CommonJS, and RequireJS.\n\n### Example\n\n```html\n\u003cscript src=\"./dist/main.min.js\"\u003e\u003c/script\u003e\n```\n\n## Usage\n\nThe library exposes a global variable called \"autoplayDetector\" with a single function that returns a promise, `canAutoplay`. The promise returns a `Boolean` whether this browser can autoplay with sound on. The promise is rejected if the browser does not support video, or support promises, or supports proper video attributes outlined in [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement).\n\n```js\nautoplayDetector.canAutoplay().then(canUse =\u003e {\n    if (canUse) {\n        console.log('Yes, this browser can autoplay');\n    } else {\n        console.log('Nope, this browser cannot autoplay');\n    }\n}).catch(error) {\n    console.log(\"If you're browser is this old, it needs to support video attributes.\", error);\n};\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjermspeaks%2Fautoplay-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjermspeaks%2Fautoplay-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjermspeaks%2Fautoplay-detection/lists"}