• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by kmccmk9 · Jun 20, 2012 at 05:59 AM · texturefullscreenmovie

Play movie in full screen

Hello,

I have a video I exported into HD format .mp4. I am trying to call it using this code, however, it never shows in the game. The portion of this code that does work is the sound pausing part.

 using UnityEngine;
 using System.Collections;
 
 public class IntroVideo : MonoBehaviour {
     //Variables
     public MovieTexture Video;
     
     // Use this for initialization
     void Start () {
 
     }
     
     // Update is called once per frame
     void OnGUI () {
         Video.Play();
         GUI.DrawTexture(new Rect(0,0,Screen.width,Screen.height),Video,ScaleMode.StretchToFill, false, 0.0f);
         if (Video.isPlaying)
         {
             audio.Stop();
         }
     }
 }
Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image hijinxbassist · Jun 20, 2012 at 09:30 AM 0
Share

Does it not show in the editor or the final build? What is the target platform? Dont call PLAY from OnGUI(), this gets called 2 or more times per frame, that will result in a black(null looking) image....call it once in Start() ins$$anonymous$$d. Also you tell the audio to stop playing if the video isPlaying...it seems like you would want the audio to stop once !Video.isPlaying

avatar image benjimazza · Jun 20, 2012 at 12:38 PM 0
Share

to play a video in unity you need unity pro

avatar image kmccmk9 · Jun 20, 2012 at 06:24 PM 0
Share

Yes I do have unity pro. It also does not play the video in teh inspector window. It does however play the sound. I called audio.stop because I have other audio background music playing that I would like to stop. I know to stop the audio of the actual movie it is Video.audio.stop. Or something like that.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by WesleyDonk · Jan 18, 2013 at 10:39 AM

I also had this problem a week ago.. My problem was the movie itself.. A .mov movie works well. So I am now avoiding .MP4

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Unity Movie Texture First Few Seconds Black 1 Answer

Opening a movie file if door is opened 0 Answers

GUI movie texture - sound delay 1 Answer

Use a movie with alpha in Self-Ilumn Material 0 Answers

Make a movie texture rewind (play again) 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges