web-audio-api-player
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -18,2 +18,5 @@ import { typeSoundModes } from './core'; | ||
} | ||
interface IOnEnded { | ||
(event?: Event): void; | ||
} | ||
interface IAudioOptions { | ||
@@ -27,10 +30,10 @@ customAudioContext?: AudioContext; | ||
interface IAudioBufferSourceOptions extends AudioBufferSourceOptions { | ||
onEnded: Function; | ||
onEnded: IOnEnded; | ||
} | ||
interface IMediaElementAudioSourceOptions extends MediaElementAudioSourceOptions { | ||
onEnded: Function; | ||
onEnded: IOnEnded; | ||
loop: boolean; | ||
} | ||
interface IMediaElementAudioSourceNode extends MediaElementAudioSourceNode { | ||
onended: Function; | ||
onended: IOnEnded; | ||
loop: boolean; | ||
@@ -37,0 +40,0 @@ } |
@@ -29,4 +29,2 @@ import { ISound, ISoundAttributes, ISoundSource } from './sound'; | ||
sound: ISound; | ||
resolve: Function; | ||
reject: Function; | ||
} | ||
@@ -103,3 +101,3 @@ interface IPlayOptions { | ||
protected _initializeAudioElementListeners(sound: ISound): void; | ||
protected _decodeSound({ sound, resolve, reject }: IDecodeSoundOptions): void; | ||
protected _decodeSound({ sound }: IDecodeSoundOptions): Promise<ISound>; | ||
play({ whichSound, playTimeOffset }?: IPlayOptions): Promise<void>; | ||
@@ -106,0 +104,0 @@ protected _play(sound: ISound): Promise<void>; |
{ | ||
"name": "web-audio-api-player", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "web audio api player", | ||
@@ -43,10 +43,10 @@ "keywords": [ | ||
"devDependencies": { | ||
"@typescript-eslint/eslint-plugin": "2.28.0", | ||
"@typescript-eslint/parser": "2.28.0", | ||
"eslint": "6.8.0", | ||
"eslint-plugin-import": "2.20.2", | ||
"rollup": "2.6.1", | ||
"rollup-plugin-typescript2": "0.27.0", | ||
"typescript": "3.8.3" | ||
"@typescript-eslint/eslint-plugin": "3.7.1", | ||
"@typescript-eslint/parser": "3.7.1", | ||
"eslint": "7.6.0", | ||
"eslint-plugin-import": "2.22.0", | ||
"rollup": "2.23.0", | ||
"rollup-plugin-typescript2": "0.27.1", | ||
"typescript": "3.9.7" | ||
} | ||
} |
@@ -8,2 +8,16 @@ [![Dependencies](https://david-dm.org/chrisweb/web-audio-api-player/status.svg)](https://david-dm.org/chrisweb/web-audio-api-player) | ||
<p align="center"><img width="400" src="./assets/web_audio_api_player_logo_small.png" alt="web audio API player logo"></p> | ||
## About this project | ||
🎶 An opensource javascript (typescript) audio player for the browser, built using the Web Audio API | ||
this player can be added to any javascript project and extended in many ways, it is not bound to a specific UI, this player is just a core that can be used to create any kind of player you can imagine and even be used to play sound in video games or for any other sound / song playing needs you may have | ||
TODO: add screenshot here showing the "simple example" UI, explain that this is just an example of an UI, you can bind your own custom UI to this player and use all or just some of it's features | ||
😔 there is almost no documentation yet (there is some, see next section below), to learn how to use this library I recommend you check out the source code of the [simple player example](examples/simple-player) to get started | ||
Want to help improve the documentation or contribute to this project by improving and fixing it, then first check out the [TODOs section](#todos-help-wanted-) below, maybe there is something in the list you want to help with. Any contribution, even things not listed on the TODO list are of course welcome. To get started check out the section ["contributing" section](#contributing) below. | ||
## installation | ||
@@ -15,6 +29,2 @@ | ||
😔 there is almost no documentation yet (there is some, see next section below), to learn how to use this library I recommend you check out the source code of the [simple player example](examples/simple-player) to get started | ||
Want to help improve the documentation or contribute to this project by improving and fixing it, then first check out the [TODOs section](#todos-help-wanted-) below, maybe there is something in the list you want to help with. Any contribution, even things not listed on the TODO list are of course welcome. To get started with your own local development, check out the ["development build" section](#development-build) below. | ||
## documentation | ||
@@ -84,6 +94,8 @@ | ||
git clone this repository if you haven't already | ||
git clone this repository to get a local copy | ||
open your favorite command line tool and go to the root directory of this repository | ||
`git clone git@github.com:chrisweb/web-audio-api-player.git` | ||
open your favorite command line tool and go to the root directory of this repository | ||
update npm to latest version | ||
@@ -93,3 +105,3 @@ | ||
install the dependencies | ||
install the dependencies | ||
@@ -117,4 +129,24 @@ `npm i` | ||
## publish package on npmjs.com | ||
## contributing | ||
you should first open a ticket and explain what fix or improvement you want to provide on the [github issues page](https://github.com/chrisweb/web-audio-api-player/issues) of this project (remember the github ticket number you will need it for the commit message later on) | ||
go the [github page of this project](https://github.com/chrisweb/web-audio-api-player) and hit the fork button | ||
follow the instructions in the previous section ["development: build"](#development-build), but instead of cloning this projects repository, clone your own fork of the project | ||
`git clone git@github.com:YOUR_USERNAME/web-audio-api-player.git` | ||
when you are done coding, commit your local changes (if your commit is related to a ticket start your commit message with the "#TICKER_NUMBER") | ||
`git commit -m "#TICKER_NUMBER commit message"` | ||
now open your forks github URL in your browser and hit the pull request button | ||
## examples | ||
the best way to get started is to check out the examples folder, start with [simple player example](examples/simple-player) | ||
## note to self: publish package on npmjs.com | ||
login to npmjs.com | ||
@@ -124,3 +156,3 @@ | ||
before hitting running the command ensure the version of your package in the package.json has been updated | ||
!!! before using the next the command ensure the version of your package in the package.json has been updated | ||
@@ -131,6 +163,2 @@ publish a new version on npmjs | ||
## examples | ||
the best way to get started is to check out the examples folder, start with [simple player example](examples/simple-player) | ||
## notes about problems I encountered during development | ||
@@ -137,0 +165,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
182742
0
3394
254