aboutsummaryrefslogtreecommitdiff
path: root/src/library_openal.js
diff options
context:
space:
mode:
authorEhsan Akhgari <ehsan.akhgari@gmail.com>2013-03-14 19:57:23 -0400
committerAlon Zakai <alonzakai@gmail.com>2013-03-15 11:53:16 -0700
commitff46d95e04588f0d328ef8c49b12ebaa99a782a0 (patch)
treeb789ffa49feff14d52518fa88682e9d3990a75ce /src/library_openal.js
parentbe5bc3b617c7cca563f3b1cfe4ab3a5083318e67 (diff)
Add tests for playback states
Diffstat (limited to 'src/library_openal.js')
-rw-r--r--src/library_openal.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/library_openal.js b/src/library_openal.js
index 2166a712..992b2557 100644
--- a/src/library_openal.js
+++ b/src/library_openal.js
@@ -288,7 +288,8 @@ var LibraryOpenAL = {
src.buffer = AL.currentContext.src[source - 1].buffer;
src.connect(AL.currentContext.src[source - 1].gain);
src.start(0, offset);
- AL.currentContext.src[source - 1].playTime = AL.currentContext.ctx.currentTime;
+ // Work around Firefox bug 851338
+ AL.currentContext.src[source - 1].playTime = AL.currentContext.ctx.currentTime || 0;
AL.currentContext.src[source - 1].paused = false;
AL.currentContext.src[source - 1]['src'] = src;
},
@@ -320,7 +321,8 @@ var LibraryOpenAL = {
if ("src" in AL.currentContext.src[source - 1] &&
!AL.currentContext.src[source - 1].paused) {
AL.currentContext.src[source - 1].paused = true;
- AL.currentContext.src[source - 1].pausedTime = AL.currentContext.ctx.currentTime;
+ // Work around Firefox bug 851338
+ AL.currentContext.src[source - 1].pausedTime = AL.currentContext.ctx.currentTime || 0;
AL.currentContext.src[source - 1]["src"].stop(0);
delete AL.currentContext.src[source - 1].src;
}