Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Beginner needs help to play an mp4 in unity video player in web gl build

Discussion in 'Editor & General Support' started by Stubbornnut, Jan 11, 2019.

  1. Stubbornnut

    Stubbornnut

    Joined:
    Oct 3, 2018
    Posts:
    11
    I have been searching for days now on how to do this. Alot of the documentation I have found assumes that I would know how to upload to a server and things like that. I dont have any experience with servers.

    Here is where I am.

    I am making an educational game where I would like to start off by playing a short video(level 0)

    I made an empty game object and added the videoplayer component. i assigned the main camera and dragged the mp4 file into the field. hit the play button and it played. no problem. i had a beer while i did my web gl build.

    then when i uploaded the game to itch.io the video wasnt there. damn........

    i did some research and I found out that you need a url to play in webgl. then i looked up what a url was.
    blah blah blah, a day later, I know that i need to host the mp4 I have made on a "server". I need a url, that ends in mp4.
    so I found a test url of an overwieght rabbit, and tested it and it worked. so inside of unity things are straight. my problem is how to get a link to my video. can someone out there make step by step for me on how to get a url for an mp4 file to play in a web gl build in unity PLEASE. Assume you are explaining it to your grampa or uncle or something.



    Thank you.
     
  2. Stubbornnut

    Stubbornnut

    Joined:
    Oct 3, 2018
    Posts:
    11
    if it helps, this i show I setup my video player. this tutorial, however this setup uses a mp4 file in the unity project. My mp4s work fine in unity when I do it this way. and when I use the bunny test video it works also.



    Thank you. please know that I have done extensive research to try and solve this myself. my next step it seems is to setup an apache server? and code a website?
     
  3. Stubbornnut

    Stubbornnut

    Joined:
    Oct 3, 2018
    Posts:
    11
    OK, thanks but no thanks unity forum. i figured it out. thought that I would post my own solution. its a thing called streamable. you can upload your videos for free. then hit the edit button and you will go to a screen where you can crop and crudely edit the video. from there right click on the video and hit open in new tab. you will see a url in the bar that has the mp4 designation. copy and paste that into the Video player url spot in unity. build your web gl and embed it and it should work fine.
     
  4. Stubbornnut

    Stubbornnut

    Joined:
    Oct 3, 2018
    Posts:
    11
  5. Stubbornnut

    Stubbornnut

    Joined:
    Oct 3, 2018
    Posts:
    11
    this apparently is a CORS issue?!???