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. kidzooly

    Nov 12, 2019 13:26

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

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

  2. cyliax

    Nov 05, 2019 08:17

    Just realized this bug on a new Pixel 3a with Android 10. We urgently need a fix for Unity 2018.4 LTS for all our apps. This is major issue.

  3. shrvnn1993

    Nov 04, 2019 05:47

    I downloaded Unity 2019.2.11f1, where it says that the issue is resolved for Android 10. But this doesn't seem to be solved in this version as well. The video is not playing on Android10 devices.

    Are there any extra steps that are to be taken to make it work? Like use another function/code snippet.

  4. patildevendra761

    Oct 26, 2019 08:13

    setDataSourceFd seems to be a function of MediaPlayer in Android. How can we implement in Unity in order to play video from the local storage?

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.