mirror of
https://github.com/mrkite/soundsmith.git
synced 2024-12-22 01:29:19 +00:00
fixed safari support
This commit is contained in:
parent
05a3571ede
commit
0f5bcc71ef
7
fta.js
7
fta.js
@ -233,10 +233,13 @@ var FTAPlayer = (function () {
|
||||
FTAPlayer.prototype.play = function () {
|
||||
var _this = this;
|
||||
try {
|
||||
this.ctx = new AudioContext();
|
||||
this.ctx = new (window.AudioContext || window.webkitAudioContext)();
|
||||
if (this.ctx == undefined) {
|
||||
throw new Error("No audio support!");
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
alert('No audio support');
|
||||
alert(e.message);
|
||||
return;
|
||||
}
|
||||
this.audioNode = this.ctx.createScriptProcessor(0, 0, 2);
|
||||
|
7
smith.js
7
smith.js
@ -250,10 +250,13 @@ var Player = (function () {
|
||||
Player.prototype.play = function () {
|
||||
var _this = this;
|
||||
try {
|
||||
this.ctx = new AudioContext();
|
||||
this.ctx = new (window.AudioContext || window.webkitAudioContext)();
|
||||
if (this.ctx == undefined) {
|
||||
throw new Error("No audio support!");
|
||||
}
|
||||
}
|
||||
catch (e) {
|
||||
alert('No audio support');
|
||||
alert(e.message);
|
||||
return;
|
||||
}
|
||||
this.audioNode = this.ctx.createScriptProcessor(0, 0, 2);
|
||||
|
@ -68,9 +68,12 @@ class FTAPlayer {
|
||||
|
||||
public play(): void {
|
||||
try {
|
||||
this.ctx = new AudioContext();
|
||||
this.ctx = new ((<any>window).AudioContext || (<any>window).webkitAudioContext)();
|
||||
if (this.ctx == undefined) {
|
||||
throw new Error("No audio support!");
|
||||
}
|
||||
} catch (e) {
|
||||
alert('No audio support');
|
||||
alert(e.message);
|
||||
return;
|
||||
}
|
||||
this.audioNode = this.ctx.createScriptProcessor(0, 0, 2);
|
||||
|
@ -85,9 +85,12 @@ class Player {
|
||||
|
||||
public play(): void {
|
||||
try {
|
||||
this.ctx = new AudioContext();
|
||||
this.ctx = new ((<any>window).AudioContext || (<any>window).webkitAudioContext)();
|
||||
if (this.ctx == undefined) {
|
||||
throw new Error("No audio support!");
|
||||
}
|
||||
} catch (e) {
|
||||
alert('No audio support');
|
||||
alert(e.message);
|
||||
return;
|
||||
}
|
||||
this.audioNode = this.ctx.createScriptProcessor(0, 0, 2);
|
||||
|
Loading…
Reference in New Issue
Block a user