I was looking trough the code of the Fly Camera Control: Git Url
The function attachControl takes the Parameter element to apply the listener to but in the function itself actually never does anything with this parameter.
This seems like a serious bug since the function itself seems to offer support for other elements but the elements are never used.
I bet its a backwards compatibility thing. Im guessing its a relic of when from when we enabled the observable systems and got replaced with this._engine.onCanvasBlurObservable and this._scene.onKeyboardObservable I believe
The Youtube video is a html dom element and not set by babylon. Asides that I want to be able to use any html content there including iframes where I don’t have controle over the inner elements.
Then in this case you need to set the pointer-events to your HTML elements to none.
Then on the scene observerables on a mousedown get the pointer coordinates and that point is in any of your HTML elements clientBox if so simulate a mouse event to the element at that location?
The Html element (ifraame) has to be below the canvas which mean is so then it has to be the other way around. Moving setting the pointer-event of the canvas to none.
This is what I already tried and what worked to some extend, it just shows weird behavior on the phoen which i have to figure out why.
The coresponding added code is in lines 33 to 43. https://playground.babylonjs.com/#1DX9UE#77