{"id":22768598,"url":"https://github.com/verzsut/audiojs","last_synced_at":"2025-03-30T11:16:18.447Z","repository":{"id":65061575,"uuid":"256614177","full_name":"VerZsuT/AudioJS","owner":"VerZsuT","description":"Library for working with HTML Audio.","archived":false,"fork":false,"pushed_at":"2022-12-23T14:47:54.000Z","size":65,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T00:08:58.851Z","etag":null,"topics":["audio","audiojs","html","javascript","js","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/VerZsuT.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":"2020-04-17T21:31:42.000Z","updated_at":"2022-12-27T17:21:32.000Z","dependencies_parsed_at":"2023-01-03T09:25:50.894Z","dependency_job_id":null,"html_url":"https://github.com/VerZsuT/AudioJS","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VerZsuT%2FAudioJS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VerZsuT%2FAudioJS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VerZsuT%2FAudioJS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VerZsuT%2FAudioJS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VerZsuT","download_url":"https://codeload.github.com/VerZsuT/AudioJS/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246308049,"owners_count":20756482,"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","audiojs","html","javascript","js","typescript"],"created_at":"2024-12-11T14:12:03.028Z","updated_at":"2025-03-30T11:16:18.419Z","avatar_url":"https://github.com/VerZsuT.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AudioJS\n\nLibrary for working with HTML Audio.\n\n_Full ts support._\n\n## Installation\n\n```npm\nnpm i vzt-audio\n```\n\n## Example\n\nCreate a queue:\n\n```js\nimport { AudioJS } from 'vzt-audio'\n\nconst audiojs = new AudioJS(['URL1', 'URL2'])\n\n// OR\nconst audiojs = new AudioJS([\n  { src: 'URL1', name: 'First track' },\n  { src: 'URL2', name: 'Second track' }\n])\n\n// OR\nconst audiojs = new AudioJS({\n  queue: [\n    { src: 'URL1', name: 'First track' },\n    { src: 'URL2', name: 'Second track' }\n  ],\n  startIndex: 1,\n  autoplay: true,\n  loopQueue: true\n  // ...\n})\n```\n\nPlay a track:\n\n```js\naudiojs.play() // play current track\naudiojs.play(1) // play track with index 1\n```\n\nTo automatically start the next track, set `autoplay=true`:\n\n```js\naudiojs.autoplay = true\n\n// OR\nconst audiojs = new AudioJS({\n  autoplay: true\n  // ...\n})\n```\n\nEvents handling:\n\n```js\nconst audiojs = new AudioJS({\n  // ...\n  onQueueEnd(event) {\n    console.log('Queue was ended')\n    audiojs.queue = ['URL4', 'URL5']\n    audiojs.play()\n    // event.audiojs.play()\n  },\n  onTrackChange(event) {\n    console.log(event.track.name)\n  }\n  // on\u003cevent_name\u003e\n})\n\n// OR\naudiojs.on('trackLoad', event =\u003e console.log(`Track ${event.track.name} was loaded`))\naudiojs.once('queueEnd', console.log('once queueEnd'))\n```\n\nAvailable events:\n\n- queueEnd\n- trackLoad\n- trackChange\n- trackPlay\n- trackPause\n- trackStop\n- trackEnd\n- changeTime\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverzsut%2Faudiojs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fverzsut%2Faudiojs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fverzsut%2Faudiojs/lists"}