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 /
avatar image
0
Question by JeffreyBennett · Jan 29, 2020 at 10:55 PM · javascriptwebglvideopublishing

WebGL Build - Video Player Shows Black Screen in all Browsers

Two Part Question

I have a video imported to a folder in my Unity 2019.2 project. The video player shows the video playing in the Game window on preview, but on WebGL Build-and-Run, both browsers (Firefox and Chrome) show only a black box and do not play the video.

Then I tried uploading the project to a web server, however there I run into another problem. On launch I get an error message that says: An error occurred running the Unity content on this page. See your browser JavaScript console for more info. The error was: SyntaxError: expected expression, got '<'

So I look at the error in the web developer console for the browser, which gives me no information at all that I know how to use. It just says: Invoking error handler due to SyntaxError: expected expression, got '<' and it shows me the line (4953) in UnityLoader.js that generates the error message.

So why would the video work in the Game window, but not in the browser, and how can you test it on the web server if the published files are generating JavaScript errors?

Any advise would be appreciated.

Comment
Add comment · Show 1
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 JeffreyBennett · Jan 30, 2020 at 02:30 PM 0
Share

Ok, I found the solution to Part II of this question, which is about the JavaScript error.

In Unity documents > https://docs.unity3d.com/$$anonymous$$anual/webgl-deploying.html?_ga=2.160056189.1547271299.1580113896-1099541612.1579098461

$$anonymous$$y web server is Windows based, so the part in the documentation about IIS and the web.config file allows my project to run in the browser (Only tried Firefox so far).

All I did was copy the provided code there and paste it into a new X$$anonymous$$L document, then save it and name it web.config. After that I dropped that file into the folder structure on the web server above the folder where I copied my Unity published files. It appears to work just fine for any folder below that level.

Now when I paste my testing URL into Firefox, the project loads and runs.

Edit > Reference Link > https://forum.unity.com/threads/syntaxerror-web-gl-build-in-web-server.485045/

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by JeffreyBennett · Jan 30, 2020 at 01:39 PM

Just trying to clear up anything that may possibly be causing that JavaScript error, I'm checking into this issue > https://answers.unity.com/questions/1695266/charactercontrollermove-called-on-inactive-control-2.html

I don't think they're related, but I'm striving for issue-free code.

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

176 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity WebGL video player on mobile 0 Answers

String coming as null from Unity to HTML WebGL 0 Answers

WebGL: Interacting with browser scripting unable to call java script method from C# 2 Answers

Unity WebGL Error Running on Local Server 0 Answers

Unity WebGL cannot load remote js source? 1 Answer


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