{"id":15480126,"url":"https://github.com/andycall/mobile-audio-player","last_synced_at":"2025-03-28T14:28:43.368Z","repository":{"id":69962050,"uuid":"54043674","full_name":"andycall/mobile-audio-player","owner":"andycall","description":"跨平台音频播放器","archived":false,"fork":false,"pushed_at":"2016-03-19T08:05:53.000Z","size":7129,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-19T04:30:36.211Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andycall.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-16T15:27:17.000Z","updated_at":"2017-04-01T12:08:14.000Z","dependencies_parsed_at":"2023-02-22T04:31:12.828Z","dependency_job_id":null,"html_url":"https://github.com/andycall/mobile-audio-player","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andycall%2Fmobile-audio-player","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andycall%2Fmobile-audio-player/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andycall%2Fmobile-audio-player/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andycall%2Fmobile-audio-player/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andycall","download_url":"https://codeload.github.com/andycall/mobile-audio-player/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246045335,"owners_count":20714758,"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":"2024-10-02T04:40:43.639Z","updated_at":"2025-03-28T14:28:43.353Z","avatar_url":"https://github.com/andycall.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mobile-audio-player\n跨平台音频播放器\n\n## 使用方式\n\n```javascript\nvar player = $('#audioPlayer').audioPlayer({\n    controls: true, // 使用默认的控制界面\n    loop: false,  // 重播\n    debug: false, // 开启debug输出\n    src: 'http://localhost:9020/halfbottle.mp3', // 默认的音频播放地址\n    onSrcChange: function (e, src) {\n      console.log('src change', src);\n      $('#player_status').append('\u003cp\u003esrc change: ' + src + '\u003c/p\u003e');\n    },\n    onAudioEnd: function (e) {\n      console.log('this sound is end!');\n      $('#player_status').append('\u003cp\u003esound is end\u003c/p\u003e');\n    },\n    onPlaying: function (e, second) {\n      console.log('current played', second);\n      $('#played').html(second.toFixed(2) + 's');\n    },\n    onPause: function (e, src) {\n      console.log('sound paused', src);\n      $('#player_status').append('\u003cp\u003esound pause: ' + src + '\u003c/p\u003e');\n    },\n    onPlay: function (e, src) {\n      console.log('sound is going to play!', src);\n      $('#player_status').append('\u003cp\u003esound is going to play: ' + src + '\u003c/p\u003e')\n    },\n    onError: function (e, error) {\n      console.log(error);\n    },\n    selector: {\n      played: '#played', // 显示播放进度\n      playButton: '.play-button' // 播放按钮选择器\n    }\n  });\n\n```\n\n\n## 播放控制\n\n假如目前播放的地址为 `http://localhost:9020/halfbottle.mp3`\n\nplayer.play('http://localhost:9020/halfbottle.mp3') // 传入相同的地址可以控制播放与暂停\n\n\nvar button = document.querySelector('.play-button');\nplayer.play('http://localhost:9020/halfbottle.mp3', button); // 传入播放按钮的DOM对象就能为该DOM对象修改播放进度","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandycall%2Fmobile-audio-player","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandycall%2Fmobile-audio-player","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandycall%2Fmobile-audio-player/lists"}