Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
Hubs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ar-noc
Hubs
Commits
0c16dd16
Commit
0c16dd16
authored
6 years ago
by
Robert Long
Browse files
Options
Downloads
Patches
Plain Diff
Update audio-context-fix to work for in Chrome.
parent
5a8c9635
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/hub.js
+1
-1
1 addition, 1 deletion
src/hub.js
src/utils/audio-context-fix.js
+22
-0
22 additions, 0 deletions
src/utils/audio-context-fix.js
src/utils/ios-audio-context-fix.js
+0
-23
0 additions, 23 deletions
src/utils/ios-audio-context-fix.js
with
23 additions
and
24 deletions
src/hub.js
+
1
−
1
View file @
0c16dd16
...
@@ -17,7 +17,7 @@ import "aframe-billboard-component";
...
@@ -17,7 +17,7 @@ import "aframe-billboard-component";
import
"
aframe-rounded
"
;
import
"
aframe-rounded
"
;
import
"
webrtc-adapter
"
;
import
"
webrtc-adapter
"
;
import
"
aframe-slice9-component
"
;
import
"
aframe-slice9-component
"
;
import
"
./utils/
ios-
audio-context-fix
"
;
import
"
./utils/audio-context-fix
"
;
import
trackpad_dpad4
from
"
./behaviours/trackpad-dpad4
"
;
import
trackpad_dpad4
from
"
./behaviours/trackpad-dpad4
"
;
import
joystick_dpad4
from
"
./behaviours/joystick-dpad4
"
;
import
joystick_dpad4
from
"
./behaviours/joystick-dpad4
"
;
...
...
This diff is collapsed.
Click to expand it.
src/utils/audio-context-fix.js
0 → 100644
+
22
−
0
View file @
0c16dd16
/**
* Mobile Safari and Chrome will start Audio contexts in a "suspended" state.
* A user interaction (touch/mouse event) is needed in order to resume the AudioContext.
*/
document
.
addEventListener
(
"
DOMContentLoaded
"
,
()
=>
{
const
ctx
=
THREE
.
AudioContext
.
getContext
();
function
resume
()
{
ctx
.
resume
();
setTimeout
(
function
()
{
if
(
ctx
.
state
===
"
running
"
)
{
document
.
body
.
removeEventListener
(
"
touchend
"
,
resume
,
false
);
document
.
body
.
removeEventListener
(
"
mouseup
"
,
resume
,
false
);
}
},
0
);
}
document
.
body
.
addEventListener
(
"
touchend
"
,
resume
,
false
);
document
.
body
.
addEventListener
(
"
mouseup
"
,
resume
,
false
);
});
This diff is collapsed.
Click to expand it.
src/utils/ios-audio-context-fix.js
deleted
100644 → 0
+
0
−
23
View file @
5a8c9635
/**
* Mobile Safari will start Audio contexts in a "suspended" state.
* A user interaction (touch event) is needed in order to resume the AudioContext.
*/
const
iDevices
=
/
\b
iPhone.*Mobile|
\b
iPod|
\b
iPad|AppleCoreMedia/
;
if
(
iDevices
.
test
(
navigator
.
userAgent
))
{
document
.
addEventListener
(
"
DOMContentLoaded
"
,
()
=>
{
const
ctx
=
THREE
.
AudioContext
.
getContext
();
function
resume
()
{
ctx
.
resume
();
setTimeout
(
function
()
{
if
(
ctx
.
state
===
"
running
"
)
{
document
.
body
.
removeEventListener
(
"
touchend
"
,
resume
,
false
);
}
},
0
);
}
document
.
body
.
addEventListener
(
"
touchend
"
,
resume
,
false
);
});
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment