About
PlayVibes.js is a lightweight JavaScript plugin that allows you to easily add a music player to your web page using YouTube's iframe API. With PlayVibes.js, you can enhance your website with a stylish vinyl record player interface that plays music from a YouTube playlist.
Docs
To install PlayVibes.js, you can either download the file and host it on your own server, or you can use our CDN, courtesy of jsDelivr:
<script src="https://cdn.jsdelivr.net/gh/Dheirya/PlayVibes.js/music.min.js"></script>
<!-- OR: <script src="path/to/playvibes.js"></script> -->
To initialize the PlayVibes.js plugin, you need to call the MusicPlayer() function with the following required configurations:
<script src="https://cdn.jsdelivr.net/gh/Dheirya/PlayVibes.js/playvibes.js"></script>
<script>
new MusicPlayer({
playlistID: 'PLwG4ajavaJ9Kuq_BwaJDLS58ilgLGJRKS',
autoplay: true,
functions: false,
position: "left",
hide: false
});
</script>
The configuration accepts the following:
- playlistID: ID of the youtube playlist as a string
- autoplay: Set it to true to autoplay based on user interaction and false to not
- functions: True/false, allows access to the JS functions of the player allowing custom buttons
- position: Positions vinyl disk on left or right bottom site of screen
- hide: Shows/hides the default vinyl disk. Useful when also using functions
Contributions
Contributions to PlayVibes.js are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.