Skip to content

Commit 4cd4bf5

Browse files
committed
Fixed RTE in WebAudioPlugin during capabilities check when there was no WebAudio support (IE)
1 parent 789e5a6 commit 4cd4bf5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/soundjs/webaudio/WebAudioPlugin.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,9 @@ this.createjs = this.createjs || {};
338338
s._createAudioContext = function() {
339339
// Slightly modified version of https://github.com/Jam3/ios-safe-audio-context
340340
// Resolves issues with first-run contexts playing garbled on iOS.
341-
var AudioCtor = (window.AudioContext || window.webkitAudioContext),
342-
context = new AudioCtor();
341+
var AudioCtor = (window.AudioContext || window.webkitAudioContext);
342+
if (AudioCtor == null) { return null; }
343+
var context = new AudioCtor();
343344

344345
// Check if hack is necessary. Only occurs in iOS6+ devices
345346
// and only when you first boot the iPhone, or play a audio/video

0 commit comments

Comments
 (0)