GoogleChrome / omnitone

Spatial Audio Rendering on the web.
https://googlechrome.github.io/omnitone
Apache License 2.0
852 stars 114 forks source link

Omnitone integration ES6 #94

Closed madox35 closed 5 years ago

madox35 commented 6 years ago

Hello,

Is it possible to integrate Omnitone with ES6 ? My issue :

[!] Error: 'omnitone' is not exported by node_modules\omnitone\build\omnitone.js https://github.com/rollup/rollup/wiki/Troubleshooting#name-is-not-exported-by-module src\js\linkAudio360.js (2:9) 1: import videojs from 'video.js'; 2: import { omnitone } from 'omnitone'; ^

also tried : import { * as Omnitone } from 'omnitone'; and : import Omnitone from 'omnitone';

But doesn't seems to work..

Any help? Thanks in advance

[edit] : Last one seems to work but only like this : Omnitone.Omnitone.createFOARenderer... Can it be written in another way ?

hoch commented 6 years ago

ES6 module is currently not supported, but I believe this is easy to fix.

hoch commented 5 years ago

After some exploration, I have decided to create two different types of library files:

  1. omnitone.min.js (IIFE, just like old one)
  2. omnitone.min.esm.js (ES6 module)