Giter Site home page Giter Site logo

basic-html5-audio-player's Introduction

Basic html5 audio player

basic html5 audio player(with playlist) using material icons, css and js api.

live demo

Screenshot 2023-09-17 at 2 33 55 PM

CDN JS CSS

<link
    rel="stylesheet"
    href="https://cdn.jsdelivr.net/gh/imbillal/basic-html5-audio-player/css/audio.css"
/>
<script src="https://cdn.jsdelivr.net/gh/imbillal/basic-html5-audio-player/js/audio.min.js" />

Supported browsers: Chrome, Firefox, Safari, Edge

2. how to use plagin

  1. insert Js and CSS CDN in your file
  2. use AudioPlayer.init function

code example:

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <title>Basic HTML5 Audio player</title>
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <link rel="stylesheet" href="./css/audio.css" />
        <style>
            #player {
                position: relative;
                max-width: 800px;
                margin: 100px auto;
                border: solid 1px #dadada;
            }
        </style>
    </head>

    <body>
        <div id="player" />
        <script src="./js/audio.js"></script>
        <script>
            AudioPlayer.init({
                container: "#player",
                volume: 0.7,
                autoPlay: false,
                playList: [
                    {
                        file: "./mp3/audio1.mp3",
                    },
                    {
                        file: "./mp3/audio2.mp3",
                    },
                ],
            });
        </script>
    </body>
</html>

Available Props

Props Type Default Note
playList Array
autoPlay boolean false
layout string stacked layout options stacked stacked-reverse horizontal horizontal-reverse
loop boolean false
hideVolume boolean false
hideTitle boolean true
volume number 0.5
shuffle boolean true
customIcons Object NodeEl material-icons material-icons used for action buttons. icons. customIcons options { prev next play pause }
themeColor string blue

basic-html5-audio-player's People

Contributors

imbillal avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.