{"id":13401373,"url":"https://github.com/davland7/rplayer","last_synced_at":"2025-03-14T07:31:34.877Z","repository":{"id":8392502,"uuid":"58237276","full_name":"davland7/rplayer","owner":"davland7","description":"Play streaming radio HTML5 .mp3 \u0026 .m3u8","archived":false,"fork":false,"pushed_at":"2024-09-18T00:18:49.000Z","size":1049,"stargazers_count":39,"open_issues_count":4,"forks_count":12,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-09-18T12:24:04.228Z","etag":null,"topics":["hls","javascript","mp3"],"latest_commit_sha":null,"homepage":"https://rplayer.js.org","language":"HTML","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/davland7.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-05-06T22:04:01.000Z","updated_at":"2024-08-27T16:16:24.000Z","dependencies_parsed_at":"2024-07-13T00:24:18.383Z","dependency_job_id":"800daff2-a213-48e0-a4fb-834781fa9be0","html_url":"https://github.com/davland7/rplayer","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/davland7%2Frplayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davland7%2Frplayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davland7%2Frplayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/davland7%2Frplayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/davland7","download_url":"https://codeload.github.com/davland7/rplayer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243541975,"owners_count":20307798,"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":["hls","javascript","mp3"],"created_at":"2024-07-30T19:01:02.036Z","updated_at":"2025-03-14T07:31:34.535Z","avatar_url":"https://github.com/davland7.png","language":"HTML","funding_links":[],"categories":["TypeScript","HTML","JavaScript"],"sub_categories":[],"readme":"# rPlayer in Action\n\nrPlayer is a player play streaming radio, this player, offers the possibility to change different audio format. Example: .m3u8, .mp3, .aac.\n\n## Easy to use\n\n### NPM\n\n```\nnpm install @davland7/rplayer\n\nimport audio from '@davland7/rplayer';\n```\n\n### CDN\n\n```\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/hls.js@1.5.3/dist/hls.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"https://cdn.jsdelivr.net/npm/@davland7/rplayer@2.2.4/dist/rplayer.umd.min.js\"\u003e\u003c/script\u003e\n```\n\n```\nconst audio = new rPlayer();\n```\n\nrPlayer is extending [Audio](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/audio) HTMLMediaElement\n\n## Play\n\nPlay doesn't work with HLS. 🙁\n\n```\nconst audio = new Audio('URL.m3u8');\naudio.play();\n```\n\nOr\n\n```\naudio.src = 'URL.m3u8';\naudio.play();\n```\n\nWorks with HLS. It's Magic 💪\n\n```\naudio.playSrc('URL.m3u8');\n```\n\n\u003e [!IMPORTANT]\n\u003e **rPlayer** is optimized for HLS content. While HLS is native to Apple devices, for Windows and Android, it's crucial to use the hls.js library for proper .m3u8 stream functionality. Please ensure the use of hls.js on devices other than iPhone and iPad.\n\nIn addition to .m3u8, you can also use .mp3, .aac, .ogg and others. 😮\n\n```\naudio.playSrc('URL.aac');\n```\n\u003e [!TIP]\n\u003e You can use rPlayer without hls.js if you don't need to support HLS formats like .m3u8. juste not add hls.js to your project.\n\n## Set Volume\n\nThe volume must not be outside the range [0, 1].\n\n```\naudio.volume = 0.2; // 0.2 Default set in local storage\n```\n\nlocalStorage is very cool. 😎\n\n## Extras\n\n### Stop\n\n```\naudio.stop();\n```\n\n### Mute\n\n```\naudio.mute();\n```\n\n### Rewind\n\n```\naudio.rewind(10); // seconds\n```\n\n### Volume Up\n\n```\naudio.upVolume();\n```\n\nA way not to make a mistake if the range is not good. 😉\n\n### Volume Down\n\n10 levels up and down and blocks both ends. 😁\n\n```\naudio.downVolume();\n```\n\n\u003e [!WARNING]\n\u003e On iOS devices such as iPad and iPhone, the audio level is always controlled by the user physically. This means that the volume property is not adjustable through JavaScript on iOS devices. When you read the volume property on iOS, it will always return 1, reflecting that the user has direct control over the device's volume. Additionally, the library will always return 1 on iOS.\n\n## timeupdate event\n\nThe [timeupdate event](http://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/timeupdate_event) is fired when the time indicated by the currentTime attribute has been updated.\n\n```\naudio.ontimeupdate = function() {\n  console.log('Time:', audio.currentTime);\n};\n```\n\n## Infos\n\n```\nconsole.log('Source:', audio.url);\nconsole.log('Playing:', audio.playing);\nconsole.log('Paused:', audio.paused);\nconsole.log('Muted:', audio.muted);\nconsole.log('Volume:', audio.volume * 100);\nconsole.log('hls.js:', audio.isHls);\nconsole.log('Time:', audio.currentTime);\n```\n\nrPlayer 2.2.4\n\n[![](https://data.jsdelivr.com/v1/package/npm/@davland7/rplayer/badge)](https://www.jsdelivr.com/package/npm/@davland7/rplayer)\n\n## Used by\n\n[Mini Radio (Chrome extension)](https://chrome.google.com/webstore/detail/mini-radio/klcjochgjlcecbalpokmcldlfhngcnfh)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavland7%2Frplayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdavland7%2Frplayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdavland7%2Frplayer/lists"}