LoginSignup
1
1

More than 5 years have passed since last update.

A-FrameをIE11に対応させる方法

Posted at

MozillaのWebVRフレームワークA-FrameはInternet Explorer上でそのままでは実行できませんが、以下の関数をa-sceneタグより前で実行することでInternet Explorer11上で実行することができます。
(IE10以下はWebGLに対応していないのでどうにもなりません)

function PolyfillIE(){
  if ( typeof window.CustomEvent === "function" ) return false;

  function CustomEvent ( event, params ) {
    params = params || { bubbles: false, cancelable: false, detail: undefined };
    var evt = document.createEvent( 'CustomEvent' );
    evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );
    return evt;
  }
  CustomEvent.prototype = window.Event.prototype;

  window.CustomEvent = CustomEvent;
}

参考:https://github.com/aframevr/aframe/issues/1475

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1