Search Issue Tracker

Fixed in 2020.1.X

Fixed in 2017.4.X, 2018.4.X, 2019.2.X, 2019.3.X

Votes

0

Found in

2017.4

2018.4

2018.4.1f1

2019.2

2019.3

2020.1

Issue ID

1168329

Regression

No

[Android] Video Player cannot play files located in the Persistent Data directory on Android 10

Mobile

-

Repro steps:
1. Open QA attached project ” repro_1168329"
2. Build and Run on Android

Actual: An error is displayed on the screen stating that the file cannot be read

Reproducible with: 2017.4.32f1, 2018.4.8f1, 2019.2.5f1, 2019.3.0b3, 2020.0a4

Tested and reproduced on this device:
VLNQA00123, Google Pixel 2 XL (Pixel 2 XL), Android 10, CPU: Snapdragon 835 MSM8998, GPU: Adreno (TM) 540
VLNQA00153, Google Pixel XL (Pixel XL), Android 10, CPU: Snapdragon 821 MSM8996 Pro, GPU: Adreno (TM) 530

Didn’t reproduce on these devices:
VLNQA00262, Sony Xperia XZ Premium (G8141), Android 9, CPU: Snapdragon 835 MSM8998, GPU: Adreno (TM) 540
VLNQA00138, Huawei P20 Pro (CLT-L29), Android 8.1.0, CPU: HiSilicon Kirin 970, GPU: Mali-G72
VLNQA00012, Samsung Galaxy S6 (SM-G920F), Android 7.0, CPU: Exynos 7 Octa 7420, GPU: Mali-T760
VLNQA00002, Samsung Galaxy S5 Neo (SM-G903F), Android 6.0.1, CPU: Exynos 7 Octa 7580, GPU: Mali-T720

  1. Resolution Note (fix version 2020.1):

    Fixed an Android 10 video player bug when playing local, external files. Th code change works around what appears to be a bug in Android MediaExtractor's setDataSource function in Android 10. It no longer seems to handle permissions correctly and fails when trying to load local, external files. Assets in the project work, but when trying to access a file local to the device, and the necessary permissions have been granted, it will still fail. Luckily, there is another setDataSourceFd function where we can open the file ourselves and pass in the file descriptor and that works reliably.

  2. Resolution Note (fix version 2019.2):

    Fixed an Android 10 video player bug when playing local, external files. Th code change works around what appears to be a bug in Android MediaExtractor's setDataSource function in Android 10. It no longer seems to handle permissions correctly and fails when trying to load local, external files. Assets in the project work, but when trying to access a file local to the device, and the necessary permissions have been granted, it will still fail. Luckily, there is another setDataSourceFd function where we can open the file ourselves and pass in the file descriptor and that works reliably.

Comments (14)

  1. DPRH

    Aug 09, 2021 14:14

    Remove "file://" prefix works on small (1Gb video file for me) but not large (10Gb+) files for some reason.

  2. visionnaireMedia

    Jun 19, 2020 08:50

    On unity 2019.3.15f removing "file://" makes the video work.

  3. Boccione

    May 07, 2020 14:17

    Hi,
    I'm using Unity 2019.2.6f1 and Andoid 10, and this problem is still not fixed for me.

  4. xtravision

    Mar 04, 2020 06:56

    This issue still not fix at all, the videoplayer still not able to play on android 10.

  5. Slawomir-Sokol

    Jan 16, 2020 12:43

    I can confirm that removing the "file://" prefix solved the problem on Unity 2019.2.17f1

  6. charlie-peter

    Dec 24, 2019 21:13

    I'm experiencing this issue with a Pixel 2 and Pixel 3a

    Unity 2018.4.10f1
    Unity 2018.4.14f1

  7. Babybus_Study

    Dec 11, 2019 02:31

    It seems that the latest version of 2017 still fails to solve this problem. When do you plan to fix it?

  8. michaelsorgrr

    Dec 09, 2019 02:49

    Using 2018.4 LTS on a Pixel 1, I still get the same error "NdkMediaExtractor: can't create http service" when attempting to use a local filesystem url to play a video using a video player component.

    I tried removing "file://' prefix and adding "videoPlayer.source = VideoSource.Url", but to no avail.

    Is anyone else experiencing the same issue? If not am I missing how can it be resolved?

  9. victorluishongchautest

    Dec 05, 2019 05:44

    For those that found the fix is not working even after the patch, try to use a local file path without the "file://" prefix. Without the "file://' prefix we handle things better.

  10. JCereda

    Nov 12, 2019 17:26

    Still broken in Unity 2018.4 LTS. We need a fix right now.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.