Unity-Technologies / uaal-example

Other
736 stars 234 forks source link

Videos on Android are black using UaaL, works fine in pure Unity build. #49

Open adavies25 opened 3 years ago

adavies25 commented 3 years ago

Hi, I'm using UaaL with Unity 2020.3.14f1 and AR Foundation 4.1.7 and the video I'm trying to play is just a VideoClip using the Unity VideoPlayer component and it shows a black screen where the video should be. the video plays fine in an Android build built directly from Unity. In the logcat, it's spewing this message:

W/Unity: AndroidVideoMedia::OpenExtractor could not translate sharedassets0.resource to local file. Make sure file exists, is on disk (not in memory) and not compressed. AndroidVideoMedia: Error opening extractor: -10004

I found it's similar to this issue playing video in compressed asset bundles, they have to be uncompressed. https://issuetracker.unity3d.com/issues/android-loading-videos-from-assetbundles-fails-unless-its-uncompressed-and-loaded-from-file

So I'm wondering if it needs to be extracted and/or uncompressed first from sharedassets0? I did confirm there a workaround of putting the video in StreamingAssets and playing it from a URL. Not ideal but it works. Thanks, Alan

julien-tamade commented 2 years ago

Hey @adavies25 did you ever solve this? Also running into video issues on android in my project.

adavies25 commented 2 years ago

No. I don't know what was wrong. I haven't tried it lately either. Are you getting the same error message? Did you see the unity issue I linked?

On Mon, 5 Sept 2022 at 11:58, julien-tamade @.***> wrote:

Hey @adavies25 https://github.com/adavies25 did you ever solve this? Also running into video issues on android in my project.

— Reply to this email directly, view it on GitHub https://github.com/Unity-Technologies/uaal-example/issues/49#issuecomment-1237247765, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADRQCUMILO5WHE4HOMRKNVLV4YKDNANCNFSM5BKR5M5Q . You are receiving this because you were mentioned.Message ID: @.***>

timbotimbo commented 1 year ago

Another workaround is to stop gradle from compressing the video file. Add noCompress to app/build.gradle:

android {

    lintOptions {...}
    defaultConfig {...}

    aaptOptions {
        noCompress = ['.resource']
    }
}