KASM-2034 Unlock mobile audio playing on first mobile touch event
This commit is contained in:
parent
66cf8fd53e
commit
66c5812b4e
|
@ -960,6 +960,15 @@ export default class RFB extends EventTargetMixin {
|
|||
}
|
||||
|
||||
_focusCanvas(event) {
|
||||
// Hack:
|
||||
// On most mobile phones it's only possible to play audio
|
||||
// only if it's triggered by a user action. Moreover, since it's also
|
||||
// impossible to listen for touch events on child frames (only on mobile phones)
|
||||
// we delegate the audio unlocking to the parent window.
|
||||
if (window.parent && !window.parent.KASM_AUDIO_UNLOCKED) {
|
||||
window.parent.unlockAudio();
|
||||
}
|
||||
|
||||
if (!this.focusOnClick) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue