Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistently use webkitAudioContext as an alias for AudioContext #194

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/midi/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ MIDI.Player = MIDI.Player || {};
api = hash.substr(1);
} else if (supports.webmidi) {
api = 'webmidi';
} else if (window.AudioContext) { // Chrome
} else if (window.AudioContext || window.webkitAudioContext) {
api = 'webaudio';
} else if (window.Audio) { // Firefox
} else if (window.Audio) {
api = 'audiotag';
}

Expand Down
2 changes: 1 addition & 1 deletion js/midi/plugin.webaudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

(function(root) { 'use strict';

window.AudioContext && (function() {
(window.AudioContext || window.webkitAudioContext) && (function() {
var audioContext = null; // new AudioContext();
var useStreamingBuffer = false; // !!audioContext.createMediaElementSource;
var midi = root.WebAudio = {api: 'webaudio'};
Expand Down
4 changes: 2 additions & 2 deletions js/midi/plugin.webmidi.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@
midi.connect = function(opts) {
root.setDefaultPlugin(midi);
var errFunction = function(err) { // well at least we tried!
if (window.AudioContext) { // Chrome
if (window.AudioContext || window.webkitAudioContext) {
opts.api = 'webaudio';
} else if (window.Audio) { // Firefox
} else if (window.Audio) {
opts.api = 'audiotag';
} else { // no support
return;
Expand Down