Search Unity

Video Rotate video

Discussion in 'Audio & Video' started by Deleted User, Oct 26, 2018.

  1. Deleted User

    Deleted User

    Guest

    Hello there.
    I have a mobile game in vertical orientation. At certain moments, you need to play a certain video, which is in horizontal orientation. How can I flip a video 90 degrees? What can be added to this code?

    Code (CSharp):
    1. public VideoClip clip1, clip2, clip3;
    2.    
    3.     void Start()
    4.     {
    5.         var videoPlayer = gameObject.AddComponent<VideoPlayer>();
    6.         var audioSource = gameObject.AddComponent<AudioSource>();
    7.         videoPlayer.playOnAwake = false;
    8.         videoPlayer.clip = clip1;
    9.         videoPlayer.Play();
    10.         }
    11.     }
    And another question, how to play the audio track from the video. My audio is not imported. Thank you.
     
    makaka-org and m8 like this.
  2. makaka-org

    makaka-org

    Joined:
    Dec 1, 2013
    Posts:
    1,023
    For VideoClip itself there are properties in Editor: Flip Horizontal & Flip Vertical. You can prepare it before the build.

    If anyone knows how to rotate it in runtime both for VideoClip and for URL modes of VideoPlayer, please share solution. Thx.