Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
0
Question by atnartur · Sep 08, 2015 at 09:11 AM · javascriptwebgl

How can I run Unity3D WebGL player with absolute paths to assets?

We're working on a furniture 3D-model player made with Unity3D. After NPAPI support had been discontinued by Chrome and Unity3D Plugin had stopped working, we've started to move the player to the WebGL technology. Both player and furniture viewer work fine thoriugh Unity Editor.

But for furniture player library it's required to use absolute paths to files came from Unity build (example, before - WebPlayer.unity3d, after - WebGLPlayer.js, WebGLPlayer.data, WebGLPlayer.html.mem, etc.). After I've got all the files loaded, this error begun to appear. It's stack trace goes deep to the asm.js, which is unaccessable to read and debug.

Error description:

    exception thrown: TypeError: Cannot read property 'addEventListener' of undefined,TypeError: Cannot read property 'addEventListener' of undefined
     at Object.JSEvents.registerOrRemoveHandler (http://host/player/WebGL/Release/WebGLPlayer.path_fixed.js:1:115907)
     at Object.JSEvents.registerMouseEventCallback (http://host/player/WebGL/Release/WebGLPlayer.path_fixed.js:1:119681)
     at _emscripten_set_mousedown_callback (http://host/player/WebGL/Release/WebGLPlayer.path_fixed.js:1:191086)
     at BCc (http://host/player/WebGL/Release/WebGLPlayer.path_fixed.js:18:614839)
     at Object.eCc [as _main] (http://host/player/WebGL/Release/WebGLPlayer.path_fixed.js:18:609112)
     at Object.callMain (http://host/player/WebGL/Release/WebGLPlayer.path_fixed.js:31:49538)
     at doRun (http://host/player/WebGL/Release/WebGLPlayer.path_fixed.js:31:50368)
     at run (http://host/player/WebGL/Release/WebGLPlayer.path_fixed.js:31:50536)
     at runCaller (http://host/player/WebGL/Release/WebGLPlayer.path_fixed.js:31:48822)
     at Object.removeRunDependency (http://host/player/WebGL/Release/WebGLPlayer.path_fixed.js:1:28378)

WebGLPlayer.path_fixed.js is a WebGLPlayer.js copy with paths to WebGLPlayer.data and WebGLPlayer.html.mem files fixed.

Is there any way to fix this? Is it possible to make custom WebGLPlayer.js build to avoid this errors?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by atnartur · May 02, 2016 at 07:42 PM

At this time problem was fixed by using iframe HTML tag. We simply initialize iframe page with WebGL instance of player. Unity3D probably have not a way to customize paths to resources.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by TylerO · May 01, 2016 at 09:16 AM

Any solution to this yet? I am having the same issue! I can't seem to figure it out.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Import/Export PlayerPrefs 0 Answers

WebGL compiles with errors in scripts 1 Answer

Persistent data between different games - local save for WebGL 0 Answers

Unity 2020.1 sendMessage no longer works from browers JS 1 Answer

Pass mouseevents from Iframe to unity application (WebGL) 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges