File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -57,9 +57,6 @@ export default class WebGlkOte extends GlkOte.GlkOteBase implements GlkOte.GlkOt
57
57
super ( )
58
58
59
59
this . metrics_calculator = new Metrics ( this )
60
- if ( typeof AudioContext !== 'undefined' ) {
61
- this . schannels = new SoundChannelManager ( this )
62
- }
63
60
this . windows = new Windows ( this )
64
61
}
65
62
@@ -139,6 +136,11 @@ export default class WebGlkOte extends GlkOte.GlkOteBase implements GlkOte.GlkOt
139
136
}
140
137
}
141
138
139
+ // Set up sound channels now to try to avoid the autoplaying-without-user input problem
140
+ if ( typeof AudioContext !== 'undefined' ) {
141
+ this . schannels = new SoundChannelManager ( this )
142
+ }
143
+
142
144
// Note that this must be called last as it will result in VM.start() being called
143
145
return super . init ( options )
144
146
}
@@ -187,7 +189,7 @@ export default class WebGlkOte extends GlkOte.GlkOteBase implements GlkOte.GlkOt
187
189
'hyperlinks' ,
188
190
'timer' ,
189
191
]
190
- if ( this . schannels ) {
192
+ if ( typeof AudioContext !== 'undefined' ) {
191
193
capabilities . push ( 'sounds' )
192
194
}
193
195
return capabilities
You can’t perform that action at this time.
0 commit comments