Search Issue Tracker

Fixed in 2020.1

Fixed in 2017.4, 2018.4, 2019.2, 2019.3

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. Response avatar

    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. Response avatar

    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 (13)

  1. 309719160b00c9ba08a14785261031e1?d=mm

    visionnaireMedia

    Jun 19, 2020 08:50

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

  2. 3fcf7ab80d2d51ad606efc1519d669b8?d=mm

    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.

  3. 89495dd2017a0cc22ebbaf219dac965f?d=mm

    xtravision

    Mar 04, 2020 06:56

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

  4. C7eb7fa8b84f7c78cfc6da315d5f4c71?d=mm

    Slawomir-Sokol

    Jan 16, 2020 12:43

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

  5. 1a4f165042daff2f79853b772b76d890?d=mm

    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

  6. E38201e055f7186b920654ba5f6baafe?d=mm

    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?

  7. 4a319782ca20ea89686501064e5dbb61?d=mm

    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?

  8. Ef1e8297ca7ad97a231f97f8f4d0dab1?d=mm

    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.

  9. 051beb5c0bf0134b2e9fa6e544dc2d29?d=mm

    JCereda

    Nov 12, 2019 17:26

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

  10. C9e38bc812cbf23b69bc1c76aa95d5a2?d=mm

    kidzooly

    Nov 12, 2019 13:26

    Add
    videoPlayer.source = VideoSource.Url;
    videoPplayer.url = path;

    should resolve the issue.<VideoSource> is Unity's Class

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.