audio-context
Advanced tools
Comparing version 1.0.0 to 1.0.1
10
index.js
@@ -32,3 +32,11 @@ 'use strict' | ||
ctx = new Context(options) | ||
//several versions of firefox have issues with the | ||
//constructor argument | ||
//see: https://bugzilla.mozilla.org/show_bug.cgi?id=1361475 | ||
try { | ||
ctx = new Context(options) | ||
} | ||
catch (err) { | ||
ctx = new Context() | ||
} | ||
cache[ctx.sampleRate] = cache[sampleRate] = ctx | ||
@@ -35,0 +43,0 @@ |
{ | ||
"name": "audio-context", | ||
"description": "A WebAudio Context singleton", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"scripts": { | ||
"test": "node test.js" | ||
"test": "browserify test.js | tape-run" | ||
}, | ||
@@ -17,4 +17,6 @@ "repository": { | ||
"devDependencies": { | ||
"browserify": "^14.3.0", | ||
"is-browser": "^2.0.1", | ||
"tape": "*" | ||
"tape": "*", | ||
"tape-run": "^3.0.0" | ||
}, | ||
@@ -21,0 +23,0 @@ "keywords": [ |
@@ -1,2 +0,2 @@ | ||
# audio-context [![Build Status](https://travis-ci.org/audiojs/audio-context.svg?branch=master)](https://travis-ci.org/audiojs/audio-context) [![unstable](https://img.shields.io/badge/stability-unstable-brightgreen.svg)](http://github.com/badges/stability-badges) [![Greenkeeper badge](https://badges.greenkeeper.io/audiojs/audio-context.svg)](https://greenkeeper.io/) [![npm](https://img.shields.io/npm/v/audio-context.svg)](https://www.npmjs.com/package/audio-context) [![license](https://img.shields.io/npm/l/audio-context.svg)](https://www.npmjs.com/package/audio-context) | ||
# audio-context [![Build Status](https://travis-ci.org/audiojs/audio-context.svg?branch=master)](https://travis-ci.org/audiojs/audio-context) [![unstable](https://img.shields.io/badge/stability-unstable-green.svg)](http://github.com/badges/stability-badges) [![Greenkeeper badge](https://badges.greenkeeper.io/audiojs/audio-context.svg)](https://greenkeeper.io/) [![npm](https://img.shields.io/npm/v/audio-context.svg)](https://www.npmjs.com/package/audio-context) [![license](https://img.shields.io/npm/l/audio-context.svg)](https://www.npmjs.com/package/audio-context) | ||
@@ -39,4 +39,17 @@ Creates a WebAudio context singleton with the given options. Returns `null` if not supported. | ||
## Running tests | ||
```sh | ||
# Run tests in tape-run's default browser | ||
npm test | ||
# Run in a specified browser. | ||
# See https://github.com/juliangruber/tape-run#runopts for options | ||
npm test -- --browser firefox | ||
``` | ||
## License | ||
MIT |
@@ -17,6 +17,8 @@ 'use strict'; | ||
var ctx2 = createContext() | ||
var ctx3 = createContext(44100) | ||
var ctx4 = createContext({sampleRate: 44100}) | ||
var rate = ctx2.sampleRate | ||
var ctx3 = createContext(rate) | ||
var ctx4 = createContext({sampleRate: rate}) | ||
t.ok(ctx1) | ||
t.equal(typeof ctx2.sampleRate, 'number') | ||
t.equal(ctx1, ctx2) | ||
@@ -23,0 +25,0 @@ t.equal(ctx3, ctx4) |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
7739
124
55
0
4