GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - rafaelsq/audio: HTML5 Audio Wrap

BranchesTags
Open more actions menu

Latest commit

 

History

11 Commits
11 Commits

Folders and files

NameName
Last commit message
Last commit date
.babelrc
.babelrc
 
 
.eslintrc.js
.eslintrc.js
 
 
.gitignore
.gitignore
 
 
.prettierrc
.prettierrc
 
 
README.md
README.md
 
 
index.js
index.js
 
 

Repository files navigation

HTML5 Audio Wrapper

Examples; React, HyperApp.

Usage

Method Description
reset() reset player state to default
src(string) set player src(file url)
on(state: Object => void) set the callback function that will be called with the player state
play() play the song
pause() pause the song
stop() stop the song
seek(second: number) seek to the second
volume(0~1: number) set volume
toggleMute() toggle mute
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width" />
        <title>Example</title>
    </head>
    <body>
        <script type="module">
            import Audio from "./audio.js"

            const audio = new Audio()
            audio.on(state => console.log("new state:", state))
            audio.src("MP3_URL")
            audio.play()
        </script>
    </body>
</html>

Yarn

$ yarn add https://github.com/rafaelsq/audio

import Audio from "audio"

const audio = new Audio()
audio.on(state => console.log("new state:", state))
audio.src("MP3_URL")
audio.play()

About

HTML5 Audio Wrap

Topics

audiohtml-audiohtml-audio-playerhtml5html5-audiohyperappreactjs

Resources

Readme
Activity

Stars

5 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.