Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Video Android Videoplayer errors playing from URL

Discussion in 'Audio & Video' started by dustin_red, Oct 19, 2018.

  1. dustin_red


    Feb 7, 2018
    I'm playing a video from a URL with the VideoPlayer on Android 4.4 and the video will not play and returns an error. It works fine on iOS.

    Code (CSharp):
    1. AndroidMediaJNI got error: Failed to instantiate extractor.
    2. AndroidVideoMedia: Error opening extractor: -10000
    This error appears to have been fixed in 2018.2.0a2:

    But I'm building using Unity 2018.2.13f1, Android 4.1 min API

    The device I'm testing on is a Samsung Galaxy S5 (SAMSUNG-SM-G900A) with Android 4.4.2. So maybe because its an older device, it needs an older encoder? I used baseline profile during the compression after reading the Android supported video format list:

    1280 x 720
    AAC, 48000 Hz, Stereo
    23.98 FPS, 2.6 Mbit/s
    Baseline profile 4.2
    H.264 mp4

    Do I need an AVI video for Android? I was hoping to have one MP4 video for both platforms.

    UPDATE: So its playing on newer Android devices from a URL. AND I have a 60 fps video playing from local on the Galaxy S5, but when playing from URL, it has errors.

    This post mentions that "...there are many bugs present in Android's implementation of the movie decoding in 4.1-4.3 (16-18)" But the device not working is 4.4.2.

    The VideoPlayer docs mention, in the Android section:
    But again, the device not working is 4.4.2 (Kit Kat).

    Also from 5.6 changelog:
    Last edited: Oct 22, 2018
  2. LarsWegmeister


    Feb 9, 2018
    I had the same problem with special characters. I was using (ß,ä,ö,ü) inside the URL. After I changed that it worked for me. Sadly not reliable. Sometimes it just doesn't play the video. Without any error in the console.
  3. matheusfantazm


    Oct 3, 2018
    Hey @dustin_red , any updates from this? I've been experiencing the same problem as you, running on an old Samsung Galaxt Tab 3, Android 4.4.2 (kit Kat).

    The curious part is that I can actually play the videos. As part of the app, I can switch between videos. On a fresh start, the selected video plays normally, but if I switch to another one, it doesn't play. I changes the settings to other videos would be the first to play and they play fine. I wonder what's causing this.

    Edit: Apparently this was fixed on 2018.3:
    Last edited: Feb 1, 2019
  4. fiachradunn


    Jan 12, 2019
    I was getting the exact same error on a Lenovo Phab 2 Pro running Android 8.0.
    @LarsWegmeister 's comment got me thinking about the URL itself (It was an Azure progressive download URL for reference). I found that if you visited the URL in a browser, it replaced the white-space characters with the string '%20'.
    I tried using the new URL as the video source instead and it solved the issue.