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 WhiteMaegi · Nov 20, 2013 at 09:57 PM · wwwvideoflash

Playing Videos in a Flash build 4.2.2

I've been hunting around this past week for a good method to do this, and haven't been able to come up with a working solution (please keep in mind I'm a bit of a Unity-novice). We're using Unity 4.2.2 and exporting to Flash Player 11.4

It is my understanding that movie textures (or anything similar) will not be supported for flash builds anytime soon. My current workaround was to rip the frames from the videos and swap out the texture on a rectangle to simulate the video playing. (I realize how ugly this solution is, and would much appreciate any pointers toward a cleaner one.)

This 'player' works very nicely in the editor, the videos load and play perfectly. However, when exported to a .swf nothing shows up. There are no build errors, and the app works perfectly normally until it's time to show a video. Then I just get a blank rectangle where the video should be. I'm pretty much at a loss for anything that could be going wrong.

Here's a bit of the code I'm using to swap out the textures:

private ArrayList frames = new ArrayList();

for(int i = 1; i < TotalFrames; i ++) {

 WWW url = new WWW(ImagePath+i+".jpg");
 yield return url;
         
 frames.Add(url.texture);

}

void OnGUI() {

     GUI.Box(videoRect, (Texture2D)frames[curFrame]);

}

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by WhiteMaegi · Nov 21, 2013 at 07:04 PM

Resolved:

I was trying to use relative paths to access the textures via WWW when instead I should have been using Resources.Load() The compiled swf simply couldn't find the images.

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 meat5000 · Nov 20, 2013 at 09:58 PM

Rip the frames and try this

http://wiki.unity3d.com/index.php?title=Texture_swap_animator

It's quite versatile.

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 WhiteMaegi · Nov 21, 2013 at 01:24 PM 0
Share

The animator does exactly what I'm doing already. I switched $$anonymous$$e from using a gui box to a regular cube, just to be sure, but it still doesn't show when exported to a swf.

avatar image meat5000 ♦ · Nov 21, 2013 at 01:33 PM 0
Share

So try Erics TSA ;) just to be sure

avatar image WhiteMaegi · Nov 21, 2013 at 02:10 PM 0
Share

Plugged it in to my update method. It works fine in the editor, still nothing on export.

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

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

Related Questions

Its possible download a youtube video from Unity 0 Answers

WWW Flash player with Unity 3.5 1 Answer

MovieTexture .ogg file size limit? 0 Answers

Is it possible to download a youtube video from unity 3 Answers

How to add exported flash video to unity project? 1 Answer


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