Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Why doesn't my video play in the android smartphone but plays in the Unity Editor

Discussion in 'Audio & Video' started by Chethan007, May 26, 2022.

  1. Chethan007

    Chethan007

    Joined:
    Dec 3, 2020
    Posts:
    51
    I want to play a vertical video or a portrait video in Unity. I followed this tutorial and was successfully able to implement .As per the video you create a raw image in the UI canvas. In the hierarcy you add an empty video player gameobject. Then in the project window you right click and create a render texture. You drag the render texture to the Target texture field in the Video player and the texture field in the raw image.

    But the problem is create a I am able to play in my game view of Unity Editor but when I build on smartphone , it is not playing.

    As per some suggestion I changed Codec of the video in the inspector from Auto to VP8 but there was no change at all.

    I saw this answer, but I have not written any code as such. What I have done is as per that video.
     
    ArunPrakasam likes this.
  2. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
  3. Chethan007

    Chethan007

    Joined:
    Dec 3, 2020
    Posts:
    51
    My Unity editor version is 2021.2.5f1 personal. Phone is Poco F1 ,Android version is 8.1 .

    I get this warning as such but no error

    Code (CSharp):
    1. WindowsVideoMedia error unhandled Color Standard: 0  falling back to default this may result in rendering issues
    You can see the Screenshot here
     

    Attached Files:

  4. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    You said your issue was only in the build. Can you check with Logcat on your phone if you get an error? WindowsVideoMedia error unhandled Color Standard only impacts the image color, but it doesn't work in your case.
     
  5. Chethan007

    Chethan007

    Joined:
    Dec 3, 2020
    Posts:
    51
    Oh, sorry. I am getting something like this in the Android Logcat

    Code (CSharp):
    1. 2022-05-27 23:07:19.049 8454 8487 Error Unity RenderTexture.Create failed: depth/stencil format unsupported - D32 SFloat S8 UInt (94). There is no compatible format on this platform or this fallback to a compatible format is disabled in the import inspector.
    Here is the screenshot

    upload_2022-5-27_23-9-37.png

    and If u scroll to the right horizontally

    upload_2022-5-27_23-10-8.png

    I am actually playing the video in the Home screen itself of my game
     
  6. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    lelaksi likes this.
  7. Chethan007

    Chethan007

    Joined:
    Dec 3, 2020
    Posts:
    51
    harpiagamesstudio likes this.
  8. kasym_

    kasym_

    Joined:
    Oct 18, 2022
    Posts:
    8
    Hi, I am using Unity 2022.3.4f1, Android and I have the same issue. I want to load video from storage and play it, however it works fine in editor but not in build.
    I do this to play the video

    videoPlayer.source = VideoSource.Url;
    videoPlayer.url = videoLocation;
    Debug.Log("Preparing videoPlayer");
    videoPlayer.Prepare();

    and I subscribe to event like so:

    videoPlayer.prepareCompleted += source =>
    {
    Debug.Log("Playing videoPlayer");
    source.Play();
    };

    However I see nothing, neither I have any message in logs.

    Interesting to note that if I use

    Handheld.PlayFullScreenMovie(videoLocation);

    to play my video, it works in build but not in editor

    Any ideas?
     
  9. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    You should probably check with Logcat your log. Your log will tell what is the issue.