Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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 dalekandjedi · Apr 14, 2012 at 04:54 PM · videoplay

How do you play video in unity?

Hello

I have Unity pro and you can inport video files for the game but I have no idea how to make the video play when the game is activated I thought it would be just a simple drag and drop but nothing is that easy so how would i make a video play?

Thanks

Comment
Add comment · Show 1
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 bodec · Apr 14, 2012 at 05:54 PM 0
Share

please make sure to check mark answers when they have been answered.

5 Replies

· Add your reply
  • Sort: 
avatar image
4

Answer by yezzer · Apr 14, 2012 at 05:29 PM

See this: http://unity3d.com/support/documentation/ScriptReference/MovieTexture.Play.html

Comment
Add comment · Show 3 · 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
avatar image yezzer · Apr 14, 2012 at 05:57 PM 0
Share

Note It's different for iOS :)

avatar image dalekandjedi · Apr 14, 2012 at 06:24 PM 0
Share

hehe thanks ^^

avatar image johnnyblack007 · Jun 09, 2014 at 02:17 PM 0
Share

So what's the easiest way to do it in iOS?

avatar image
3

Answer by rawatenator · Apr 14, 2012 at 06:25 PM

Is this what you are looking for? (from http://unity3d.com/support/documentation/Manual/Video%20Files.html)

 function Update () {
 if (Input.GetButtonDown ("Jump")) {
     if (renderer.material.mainTexture.isPlaying) {
         renderer.material.mainTexture.Pause();
     }
     else {
         renderer.material.mainTexture.Play();
     }
 }

}

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
avatar image
1

Answer by Aqibsadiq · Dec 03, 2015 at 09:41 AM

i think the best answer for that is Handheld.PlayFullScreenMovie(VideoPath);

Make a Folder Named StreamingAssets inside of Assets Folder and Place your video in that folder. eg. That Video's name is Test.mp4

now all you have to do is to Write this Code

Handheld.PlayFullScreenMovie("Test.mp4");

@dalekandjedi

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
avatar image
1

Answer by luzanb · Mar 15, 2017 at 09:07 PM

After Unity 5.6 MovieTexture will no longer be used. With new Unity 5.6, VideoPlayer and VideoClip API should be used to play videos. Here's a very nice tutorial for that.

http://justcode.me/unity2d/how-to-play-videos-on-unity-using-new-videoplayer/

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
avatar image
0

Answer by psykojello2 · Nov 13, 2015 at 12:11 PM

I know this was asked in 2012, but for anyone searching in 2015, you can use : Handheld.PlayFullScreenMovie() to play a video file on mobile.

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.

Follow this Question

Answers Answers and Comments

11 People are following this question.

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

Related Questions

what are accepted video extensions ? 1 Answer

How do I Play/Pause video which is a child of vuforia image target? 0 Answers

i havent pro that means i cannot play videos? 3 Answers

How to paly Video in the Scene 1 Answer

How to play a .mp4 video file in android game 7 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