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

Video Unity videoPlayer not working on android when using a URL

Discussion in 'Audio & Video' started by akash437, Feb 11, 2019.

  1. akash437

    akash437

    Joined:
    Jun 28, 2013
    Posts:
    6
    videoPlayer is not working in unity 2018.3.0f2 when using url on android (tested it on android 9), it works fine in the editor.I tried assigning a video clip and it works (on android and editor) but when I try to stream a video from url it doesn't work,

    I tried turning off auto graphic api and forcing GLES2 but it still doesn't work.

    tried using this url

    http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_640x360.m4v

    gives the following error

    androidVideoMedia: Error opening extractor: -10000
     
  2. AnttiKuusisto

    AnttiKuusisto

    Joined:
    Feb 27, 2019
    Posts:
    1
    Same problem here with some difference. Samsung Galaxy S8+ works fine, but OnePlus 5 does not work. iOS and Editor works fine.
     
  3. DMStudio_

    DMStudio_

    Joined:
    Feb 13, 2019
    Posts:
    2
    동일한 문제가 있습니다. 안드로이드 9 가 나오기 전에는 정상적으로 영상이 재생되었으나 안드로이드 9 업데이트 이후 해당 폰들은 모두 재생이 되지 않습니다.
     
  4. DMStudio_

    DMStudio_

    Joined:
    Feb 13, 2019
    Posts:
    2
    나도 같은 문제가있어. Android 9 업데이트 후에는 동영상을 재생할 수 없습니다.
     
  5. akash437

    akash437

    Joined:
    Jun 28, 2013
    Posts:
    6
    Code (xml):
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <manifest ...>
    3.     <uses-permission android:name="android.permission.INTERNET" />
    4.     <application
    5.         ...
    6.         android:usesCleartextTraffic="true"
    7.         ...>
    8.         ...
    9.     </application>
    10. </manifest>
    add android:usesCleartextTraffic="true" to your androidmanifest.xml
     
    mb-taqawifar and gxgpau like this.
  6. jswami123

    jswami123

    Joined:
    Apr 15, 2019
    Posts:
    1
    Even i am facing this same issue. please suggest some way to sort. Device using one + 6.
     
    Last edited: Jun 22, 2019
  7. Makhkk

    Makhkk

    Joined:
    Sep 23, 2014
    Posts:
    3
    I am also facing this issue. Have anyone found a fix?
     
  8. ookk47oo

    ookk47oo

    Joined:
    Mar 17, 2017
    Posts:
    80
    Got the same error on my android phone. Works fine on PC and IOS
    UnityVersion: 2017.4.14f
    Video Format:MP4
     
    Last edited: Apr 22, 2019
    khanhabib and mp9000 like this.
  9. mp9000

    mp9000

    Joined:
    May 1, 2019
    Posts:
    2
    Indeed, even I am confronting this equivalent issue. if you don't mind recommend some approach to sort. Gadget utilizing one + 6.
     
  10. Vector-Sprite

    Vector-Sprite

    Joined:
    Oct 26, 2012
    Posts:
    9
    akash437, thanks for this. It seems to have worked for me when using Android API 28.
     
  11. Alex_F

    Alex_F

    Joined:
    Mar 4, 2014
    Posts:
    10
    Thank you! It worked for me too.
    Changed manifest (used this video
    )
    It turned out Android 9 changed some request policies and it allows only https requests.
    https://stackoverflow.com/questions...nection-types-http-and-https-in-android-9-pie
     
  12. Ikaro88

    Ikaro88

    Joined:
    Jun 6, 2016
    Posts:
    296
    I have this problema and seems nothing work :S
    any help?
     
  13. Ankit_JeGames

    Ankit_JeGames

    Joined:
    May 28, 2019
    Posts:
    11
    Hey you all, I don't know if this is related or not but I got a bit different error, even if I'm using https url. please help if anyone can.
    Code (CSharp):
    1. 2020-01-21 19:17:25.287 2236-3753/? E/Conscrypt: ------------------Untrusted chain: ----------------------
    2. 2020-01-21 19:17:25.287 2236-3753/? E/Conscrypt: == Chain0 ==
    3.      Version:   3
    4. 2020-01-21 19:17:25.288 2236-3753/? E/Conscrypt:  Serial Number:   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    5. 2020-01-21 19:17:25.288 2236-3753/? E/Conscrypt:  SubjectDN:   CN=app.tarc.co.ke
    6. 2020-01-21 19:17:25.300 2236-3753/? E/Conscrypt:  IssuerDN:   CN=Sectigo RSA Domain Validation Secure Server CA, O=Sectigo Limited, L=Salford, ST=Greater Manchester, C=GB
    7. 2020-01-21 19:17:25.306 2236-3753/? E/Conscrypt:  Get not before:   Sat Jan 04 05:30:00 GMT+05:30 2020
    8. 2020-01-21 19:17:25.310 2236-3753/? E/Conscrypt:  Get not after:   Fri Nov 20 05:29:59 GMT+05:30 2020
    9. 2020-01-21 19:17:25.310 2236-3753/? E/Conscrypt:  Sig ALG name:   SHA256withRSA
    The thing is that if I open the same Url in my mobile browser it just works fine but when it comes to streaming the video in my unity app(this is using unity's own Video Player and from Url) it doesn't.
    And everything just works fine in Unity editor.
     
  14. ARConnex

    ARConnex

    Joined:
    Aug 19, 2012
    Posts:
    24
    Still having issues with this-
    Same issue -Unity 2018.4.16 video played from URL works fine on older devices S6, as well as iOS and editor. On newer Android 9 the begin, sometime playing thru, but other times the video freezes as if paused. I have added the Cleartext line to the manifest and confirmed it merges when building. No Change, Files are delivered via AWS bucket, MP4 baseline. Seems to freeze at similar spots, 10-12 second in, sometimes 20sec in, sometimes will play without issue occasionally. when freezing the app shows no error, audio stops and the frame sits still, app runs and triggers the VideoEnded(VideoPlayer) callback at the end. Clips are 2-12 meg in length and all use https://.
    Only item I get that stands out in the logcat around the time video freezes is...

    01-28 10:32:16.543 W Unknown NuMediaExtractor 13032 13173 read on track 0 failed with error -2147483646

    Tried with and without vsync, targeting android api 23 thru 28 - with no change, randomizing the url to eliminate cache. Nothing seems to change the behavior or resolve. (testing device is GalaxyTabS5 e) (all works fine on Samsung S6)

    Anyone else still experiencing this issue or have any other potential solution to try?

    Thanks Max
     
  15. Tactis

    Tactis

    Joined:
    Jun 7, 2020
    Posts:
    2
    i am using unity 2019.4.5, when i import normal mp4 video, unity giving me this error- UnityEditor.VideoClipImporterInspector:OnDisable() , and i am unable to attach video file ,
    i read that unity supports .ogv file, so i converted my video and then imported it, it attached successfully, but doesn't show up on built (i tried all, material override option, camera far/near , also trans coding as informed ), on trans coding .ogv file unity gives this error -
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)


    Now i am stuck in this loop, cannot find any solution, can anyone help?.
     
  16. DJgray3D

    DJgray3D

    Joined:
    Mar 6, 2013
    Posts:
    15
    I have a similar issue, Im working in Unity 2020.1.11f1, pushing to Samsung Tab S5e and Samsung S8.
    The video loads as a white plane without playing the video. However, if I reopen the scene, it plays perfectly fine the 2nd time.
    I originally built the App in iOS where the video played perfectly first time
     
    paulksi and Tamlou like this.
  17. SamwiseLA

    SamwiseLA

    Joined:
    Oct 6, 2020
    Posts:
    1
    Did you ever resolve this issue? I've tried to update the manifest like it says but it doesn't seem to work :(
     
  18. pedritorres

    pedritorres

    Joined:
    Jul 21, 2021
    Posts:
    1
    I am experiencing the same issue.
     
    Last edited: Aug 10, 2021
  19. lyha

    lyha

    Joined:
    Feb 28, 2016
    Posts:
    15
    Facing the same issue with video performance (lag in a few seconds for some time).
    Have 4 different resolutions videos, max is 1080 - it's really lagging. The only video which is running without lags is 360 (100Mb, 5:30 min, H.264).
    In my case lagging devices are:
    Samsung Galaxy S20+ Android 11
    Huawei MediaPad M5 Lite 10 Android 8.0.0
    Huawei P30 ELE-L29 Android 10
    Google Pixel 4a, Android 11

    Not lagging devices:
    Samsung Galaxy S8 Android 8.0.0
    Xiaomi Mi 10 Pro Android 10

    Currently have no resolution to the issue, but need it.
     
  20. ivoras

    ivoras

    Joined:
    May 21, 2020
    Posts:
    66
    Bump, same issue, Unity 2021.1.21f1, VideoPlayer shows a black rectangle instead of video on Android, everything's fine in Editor. Webm + VP8.
     
    anthonyfruit likes this.
  21. anthonyfruit

    anthonyfruit

    Joined:
    Jul 8, 2021
    Posts:
    1
    Same issue still 2020.3.11f1. Just a black screen... any fixes?
     
  22. leftisright

    leftisright

    Joined:
    Jan 3, 2014
    Posts:
    3
    The problem for me was resolved by changing 'Internet Access' to 'Require' in Player settings / other settings. I'm also using OpenGL as top choice in Graphics API as Vulkan seems really buggy for videos.

    Its still slower than iOS but just good enough.

    This was for video streaming from vimeo URLs in 2020.3.22f1
     
    zackyrza, StanSi and ejx61s like this.
  23. vaibhavTrigensoft

    vaibhavTrigensoft

    Joined:
    Nov 15, 2021
    Posts:
    10
    video player not working in android studio when project exported from unity to android studio
    unity version 2020.3.31f1 LTS
     
  24. mb-taqawifar

    mb-taqawifar

    Joined:
    Aug 20, 2015
    Posts:
    1
    This method works very well for me Android 5
     
  25. atruck11

    atruck11

    Joined:
    Jul 24, 2020
    Posts:
    2
    For me, I was manually setting the device date and time to test notifications. Setting the device to automatically set the date and time fixed things for me. I ran into the same issue with playing video ads. I think both share a makeHttpConnection call that requires the client and server to have matching timestamps.
     
  26. ssshiny

    ssshiny

    Joined:
    Jun 4, 2023
    Posts:
    1
    I have same issue as well. My app is to show the social video using url which is from backend. I can see the video in Unity Editor but after building an apk, I can't see the video and only can see the loading screen.
    I am using Unity 2021.3.2f1.
    I used Android Logcat to see the errors and found that following error occurs when the app try to stream a video from url. Please give me the way to fix.
    "Error" "NuCachedSource2" "source returned error -1, 10 retries left"
     
  27. Hardika_Doshi

    Hardika_Doshi

    Joined:
    Feb 4, 2020
    Posts:
    3
    were you able to solve this?
     
  28. zackyrza

    zackyrza

    Joined:
    Sep 2, 2023
    Posts:
    1
    For me, the issue are the video keep stop and looping on every frame, and solved by using the OpenGL instead of Vulkan on player settings before building the apks