Search Unity

Videoplayer WebGL (URL) Not working

Discussion in 'Web' started by FireHawkX, Apr 21, 2017.

  1. jsleek

    jsleek

    Joined:
    Oct 3, 2014
    Posts:
    61
    The difference is I am hosting my video on a server, rather than having it built-in to the app via StreamingAssets. So it doesnt work
     
  2. jwho303

    jwho303

    Joined:
    Jul 23, 2015
    Posts:
    8
  3. jsleek

    jsleek

    Joined:
    Oct 3, 2014
    Posts:
    61
    upload_2020-7-28_20-28-46.png

    The webm format cannot be read by Unity.

    Could you please upload a simple project to github with Videoplayer WebGL working on mobile?
     
  4. jwho303

    jwho303

    Joined:
    Jul 23, 2015
    Posts:
    8
  5. jsleek

    jsleek

    Joined:
    Oct 3, 2014
    Posts:
    61
    Ah I see. The problem im having is that I'm combining it with Mozilla's WebXR export, as I want to be able to view 360 videos on mobile (via WebGL ) with Unity's Video Player.

    Here's the link to the repo (you will need to clone the source, as the version on the asset store is outdated).

    https://github.com/MozillaReality/unity-webxr-export

    I can get the big buck bunny video working on mobile via your app, but I'm using WebXRCameraSet prefab provided by Mozilla (for VR Cardboard purposes).

    It works on desktop, but on mobile, all I get is a black screen (where there is supposed to be the video) with the video's audio in the background.

    I'm using the Skybox technique for 360 video,I've included the unity package for you to try out.

    I see that the Big Buck Bunny is an mp4, so it wouldn't be using vp8 encoding. If I can't get Big Buck bunny to work, then i don't know what will..


    EDIT: Okay after changing the Render Texture setting Depth Buffer to No Depth Buffer I'm starting to see some results. I can get Big Buck working in XR, but i can't get my own video (MP4) working. What .mp4 video settings do i need for it to be compatible?
     

    Attached Files:

    Last edited: Jul 29, 2020
  6. jwho303

    jwho303

    Joined:
    Jul 23, 2015
    Posts:
    8
    upload_2020-7-29_6-46-46.png
    upload_2020-7-29_6-48-32.png

    This is what info I can get from the big bunny buck file. Looks like mp4 with .h264 codec
    You should be able to convert that with FFmpeg or handbrake (which has a nice n easy UI)
    Try those and see if you can get your video working without the 360 camera first.
     
  7. GrooveJones

    GrooveJones

    Joined:
    Aug 19, 2016
    Posts:
    11
    Mobile browsers will not play video/audio content before the user has at least interacted once with the page. Keep this in mind in your design, usually you want to have a "start" button at the beginning of your experience.

    To me (on 2019.4.3f1) the alpha video doesn't work as intended only on mobile: the alpha 0 is not transparent but has a background color. On desktop instead works as expected.
     
  8. timobixusi

    timobixusi

    Joined:
    Mar 5, 2018
    Posts:
    9
    I want to know, too.
     
    charmseer likes this.
  9. Raaph

    Raaph

    Joined:
    Nov 30, 2017
    Posts:
    1
    Late to the party but I've been struggling with this issue for a couple days and finally got it working by using Amazon AWS S3 to host the video's, this was really easy. The trick was to add the following JSON to the CORS settings of the bucket.

    Code (JavaScript):
    1. [
    2.     {
    3.         "AllowedHeaders": [],
    4.         "AllowedMethods": [
    5.             "GET"
    6.         ],
    7.         "AllowedOrigins": [
    8.             "*"
    9.         ],
    10.         "ExposeHeaders": []
    11.     }
    12. ]
    After that I just put the object URL provided by S3 into the videoplayer and used the play script provided in a different comment in this thread to play the video and it's now working on itch.io webGL build. Good luck to anyone.
     
  10. RockStar89

    RockStar89

    Joined:
    May 6, 2018
    Posts:
    3
    Hey, just wanted to say thank you for this - spent hours trying to figure out why my php wasn't responding in a webgl app, add this header to the .htaccess and it is now responding. Hoorah! Thank you, take care.