Search Unity

Video Unity video player on iOS WebGL

Discussion in 'Audio & Video' started by dixonich, May 30, 2019.

  1. dixonich

    dixonich

    Joined:
    May 30, 2019
    Posts:
    1
    use unity with WebGL. VideoPlayer is ok on desktop browsers, but on iOS - don't play, only black screen :(

    I tried mp4, ogv, webm...

    My phone is iphone X, ios 12.2

    Code (CSharp):
    1.  
    2.         GameObject camera = GameObject.Find("Main Camera");
    3.         var videoPlayer = camera.AddComponent<UnityEngine.Video.VideoPlayer>();
    4.         videoPlayer.url = System.IO.Path.Combine (Application.streamingAssetsPath, "last-scene_all2.ogv");
    5.         videoPlayer.Play();
     
  2. jackerlo

    jackerlo

    Joined:
    Sep 19, 2018
    Posts:
    4
    struggling on same
     
  3. leedongwon

    leedongwon

    Joined:
    Jun 20, 2019
    Posts:
    8
    After building with WebGl, a videoPlayer appears in the browser of Desktop and Android, but the sound is played in IOS, but the screen is not played.

    How did you solve it?
     
    Last edited: Sep 20, 2019
  4. IvanBeneurope

    IvanBeneurope

    Joined:
    Mar 12, 2019
    Posts:
    3
    I have ran into the same, any advice or something new on this? :)
     
  5. fireicerailgun

    fireicerailgun

    Joined:
    Sep 6, 2018
    Posts:
    5
    I met the same issue. Can you solved it? Please help me!
     
  6. fireicerailgun

    fireicerailgun

    Joined:
    Sep 6, 2018
    Posts:
    5
    Can you sovled it? Please help me!
     
  7. fireicerailgun

    fireicerailgun

    Joined:
    Sep 6, 2018
    Posts:
    5
    Can you sovled it? Please help me!
     
  8. fireicerailgun

    fireicerailgun

    Joined:
    Sep 6, 2018
    Posts:
    5
    Can you sovled it? Please help me!
     
  9. fireicerailgun

    fireicerailgun

    Joined:
    Sep 6, 2018
    Posts:
    5
    Can you sovled it? Please help me!
     
  10. IvanBeneurope

    IvanBeneurope

    Joined:
    Mar 12, 2019
    Posts:
    3
    I am still looking for options, unluckily I did not find a solution yet :/
     
  11. xintao

    xintao

    Joined:
    Jan 24, 2018
    Posts:
    1
    I also encountered the same problem, tried a lot of plugins did not solve.Hope for a good solution
     
  12. IvanBeneurope

    IvanBeneurope

    Joined:
    Mar 12, 2019
    Posts:
    3
    If you find a solution please share it . Thanks :D
     
  13. Tangerunity3d

    Tangerunity3d

    Joined:
    Jun 9, 2020
    Posts:
    13
    Has anyone got some insights about how this is happening?

    I'm facing the same problem, videos from URL on streaming assets folder runs well on Editor, WebGL PC, WebGL Android but on WebGL Ipad/Iphone they don't show.
     
    kartoonist435 likes this.
  14. kartoonist435

    kartoonist435

    Joined:
    Feb 14, 2015
    Posts:
    73
    Same problem if anyone can help
     
  15. Tangerunity3d

    Tangerunity3d

    Joined:
    Jun 9, 2020
    Posts:
    13
    We gave up on this after spending some days reading forums and a lot of trial and error.

    Basically it seems to be a problem on the Apple side which doesn't support WebGL 2.0, hence any attempts to reproduce certain things that requires this feature will not work and apple seems to be not interested in supporting this on the nearby future.

    We managed to make a workaround by calling the videos over our website, with the help of our back-end devs by sending ID's for each video we wanted to play.

    Basically we draw a Videoplayer pop-up over Unity, so it uses native browser video player controls, but we call them from inside Unity.

    Every other attempt like streaming assets folder or videos from inside our project, failed.
     
    JoRangers likes this.
  16. jsleek

    jsleek

    Joined:
    Oct 3, 2014
    Posts:
    61
    Wow, what a workaround.

    "Basically we draw a Videoplayer pop-up over Unity"
    "so it uses native browser video player controls"
    "but we call them from inside Unity."

    How did you manage this??
     
  17. kartoonist435

    kartoonist435

    Joined:
    Feb 14, 2015
    Posts:
    73
    https://docs.unity3d.com/Manual/webgl-interactingwithbrowserscripting.html

    You can add calls to the webpage and back into Unity if you follow the link above. I used it for something else not the video issue. Interesting work around for sure but I wish there was a better way
     
  18. iasarmientoj

    iasarmientoj

    Joined:
    Jul 22, 2018
    Posts:
    2