Issue with webm VP8 video transparency in Unity for Android

I’m using Unity to create an application that displays video from a URL. The video is in webm format with the VP8 codec. In the Unity editor, everything works as expected - the video is displayed with a transparent background. However, when building the project for Android, the transparency is lost, and the video is displayed with an opaque background. I don’t use shaders, but I tried it didn’t help either
Why is video not transparent on Android?

[SerializeField] private RawImage _rawImage;
[SerializeField] private UnityEngine.Video.VideoPlayer _videoPlayer;

private void Start()
{
    string pathToSaveVideo;

    if (Application.platform == RuntimePlatform.Android)
    {
        pathToSaveVideo = Path.Combine(Application.persistentDataPath, "12.webm");
    }
    else if (Application.platform == RuntimePlatform.IPhonePlayer)
    {
        pathToSaveVideo = Path.Combine(Application.persistentDataPath, "12.webm");
    }
    else
    {
        pathToSaveVideo = Path.Combine(Application.persistentDataPath, "12.webm");
    }
    _videoPlayer.url = pathToSaveVideo;
    _videoPlayer.Prepare();
    _videoPlayer.prepareCompleted += (videoPlayer) =>
    {
        _videoPlayer.Play();
    };
}

Video Unity editor

Video on an android (the black spot is the display is cracked)

9826995--1412811--7yqiO6eK.png

Unity offers a feature called “Transcoding.” This allows you to transcode your video files within Unity during the build process. By enabling transcoding for the VP8 codec, Unity will convert your videos to a format that is compatible with Android’s native decoder and supports transparency.
Here’s how to enable transcoding:

  • Go to Project Settings > Player > Video.
  • Under “Supported Video Codecs”, check the box next to “VP8”.
  • Make sure “Allow Transcoding” is enabled.

What version of Unity are you using, I can’t find similar settings? I have version 2021.3.1f1

In Unity 2023.2.14f1, the transcoding settings are available in the import settings per video file. If it’s the same in your version, you should find these settings by selecting the video file itself. Here, transcoding can be specified per platform.