• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 713
  • Last Modified:

How to use mp4 movie for a Flash site.

I created a movie in After Effects and I rendered the movie in Quicktime .mp4 format.  Now I want to make that a movie in Flash.  How can I use this for a Flash movie?  It is a 10 second movie about 32 megs large that I want to play as a flash file online.  Thanks!
0
VBBRett
Asked:
VBBRett
  • 15
  • 13
1 Solution
 
aibusinesssolutionsCommented:
You'll want to either use the Flash Video Converter to convert the file to an FLV, or create a video player in flash using action script 3.0, which allows playing multiple video formats.
0
 
aibusinesssolutionsCommented:
Here is some code for loading mp4 files programatically using Actionscript 3.0

http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9b90204-7d4e.html

But you can do it manually with the components in flash, just add a video viewer component from the AS 3.0 components.
0
 
VBBRettAuthor Commented:
aibusinesssolutions.  I appreciate your help but I am still unable to get the mp4 file to work.  It appears I have some kind of error.  Can you explain how I can get this to work?  I copied the exact code in the example and it still didn't work.  Thanks!
0
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
aibusinesssolutionsCommented:
Are you using Flash CS3 or higher with Actionscript 3.0 selected?  I think it defaults to AS 2.0, so that might be your problem.
0
 
VBBRettAuthor Commented:
Hey buddy, I am using Flash CS4 with ActionScript 3.0.
0
 
aibusinesssolutionsCommented:
Ok, instead of using the code in that example, since you are using Flash CS4, just go to the Window menu in Flash, and click Components.  Drop an FLVPlayback component, which is under Video, on to your form.  Select the FLVPlayback object on your form, and click on the Paramters tab at the bottom.  Look for "source", and put the URL to your MP4 there.  Then test the movie, it should play.
0
 
VBBRettAuthor Commented:
I found this code, I have no errors but it still doesn't run the video that I have in the same directory.

var video:Video;
var connect_nc:NetConnection = new NetConnection();
connect_nc.connect(null);
var stream_ns:NetStream = new NetStream(connect_nc);
stream_ns.client = this;

function netStatusHandler(p_evt:NetStatusEvent):void
{    
      if(p_evt.info.code == "NetStream.FileStructureInvalid")    
      {        
         trace("The MP4's file structure is invalid.");
        }    
      else if(p_evt.info.code ==
      "NetStream.NoSupportedTrackFound")    
          {        
            trace("The MP4 doesn't contain any supported tracks");    
          }
 }

  stream_ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

  video = new Video();
  addChild(video);
  video.attachNetStream(stream_ns);
  stream_ns.play("comingsoonslick.mp4");
0
 
aibusinesssolutionsCommented:
Actually, I've been meaning to try out the screencast software... so here you go.

http://screencast.com/t/8hKzH4bfQ
0
 
VBBRettAuthor Commented:
Hey, I got it to work using the following code, but I had to save the file as a h264 file as opposed to a typical mp4 format.  Now the thing is I want to play my mp4 h264 format video at the original size which is 720 x 480, only thing is it shows at a very small size.  How can I up the size of the video?  Here is the code that I have implemented:



var video:Video;
var connect_nc:NetConnection = new NetConnection();
connect_nc.connect(null);
var stream_ns:NetStream = new NetStream(connect_nc);
stream_ns.client = this;

function netStatusHandler(p_evt:NetStatusEvent):void
{
      if(p_evt.info.code == "NetStream.FileStructureInvalid")
      {
            trace("The MP4's file structure is invalid.");
      }
      else if(p_evt.info.code == "NetStream.NoSupportedTrackFound")
      {
            trace("The MP4 doesn't contain any supported tracks");
      }
}

stream_ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

video = new Video();
addChild(video);
video.attachNetStream(stream_ns);
stream_ns.play("comingsoonmcslick4.mp4");
0
 
aibusinesssolutionsCommented:
It's going to play at whatever your movie size is, resizing the movie to 720x480 should fix it.
0
 
VBBRettAuthor Commented:
OK, so how does this jing thing work.  It's very easy to implement but hard to put into my html or aspx code to get it to run.  What do I put into my code to get the jing object to work?
0
 
VBBRettAuthor Commented:
Actually, if you could put code for both the swf flash video player pointing to .mp4 format and also if you could give me code to point to the jing object that would be great.  Thanks!
0
 
VBBRettAuthor Commented:
aibusinesssolutions..would you happen to have any clue on how to implement the code into an asp.net html page?  I need to include the Jing object that you sent me into an asp.net html page and would like for it to load and play automatically.  Thank you!

0
 
aibusinesssolutionsCommented:
Oh that Jing page was just a screen capture of me showing you how to add an FLV Player to a flash project, and set the source as an MP4.  I didn't make that or anything, I just wanted you to look at the video so you could see how to use the FLV player.
0
 
VBBRettAuthor Commented:
Here is what I have as my code for the asp.net page.  I was wondering if you knew how to play the file.

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="MCSlick._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
<body style="background-color:Black;">
    <form id="form1" runat="server">
    <div style="height:720px; width:480px; margin-left:350px; margin-top:125px;">
        <embed src="http://localhost:2532/mcslickvideoplayer2.swf" width="720" height="480"/>                                          
            </div>
           
    </div>
    </form>
</body>
</html>
0
 
aibusinesssolutionsCommented:
I would just use the SWF Object.

You can download it, and read about it here:
http://code.google.com/p/swfobject/
<html>
<head>
<script type="text/javascript" src="swfobject.js"></script>
</head>
<body>
<div id="myContent">
<p>Alternative content</p>
</div>
<script type="text/javascript">
var flashvars = {};
var params = {};
var attributes = {};
swfobject.embedSWF("myContent.swf", "myContent", "300", "120", "9.0.0","expressInstall.swf", flashvars, params, attributes);</script>
</body>
</html>

Open in new window

0
 
VBBRettAuthor Commented:
But that doesn't stop the "activex" object popup block thing in the page.  I was wondering if you knew of a way to get this to work with a jing swf file and a mp4 source video object.
0
 
aibusinesssolutionsCommented:
Yes that stops the activeX pop up.
0
 
VBBRettAuthor Commented:
OK, so the Jing file works but when I try to implement it into a asp.net page, I just get a blank white screen.  Still a bit confused as to how to get this going.  How do I get the Jing file to work with an mp4 file without having to click at the top of my screen for the Flash plugin to work?  Is there a solution to that?  Do I have to program things differently with the Jing file as opposed to a typical swf file?  I have done this before and it should work but it's not, I'm confused as to why it doesn't work.  Thanks.
0
 
aibusinesssolutionsCommented:
The JING File is not needed, that was just a SCREEN CAPTURE that I made to show you a video.  Did you watch the video?
0
 
VBBRettAuthor Commented:
Yes, I used the jing plugin in order to get that video to work which is encapsulated into an .SWF file with and .mp4 source.  
0
 
aibusinesssolutionsCommented:
Ok, forget about the Jing file for a minute. Did you try adding an FLV Playback Object to your FLA, and put the path to the video file in the source field?  If you put the mp4 in the same directory as the .FLA file, you don't need to put a full URL, just videoname.mp4

0
 
VBBRettAuthor Commented:
No, I did not add a FLV playback object to the fla file.  How would I do that and why would it be needed if Jing takes care of the video playback itself.  I set the source of the video and it seemed to work on it's own.  
0
 
aibusinesssolutionsCommented:
The link I gave you was a video of how to do that, not so you could get Jing, that is what I am trying to explain to you.  Watch this video: http://screencast.com/t/8hKzH4bfQ
0
 
VBBRettAuthor Commented:
Cool, I got that part to work just fine but the part I am having trouble with is in the html/asp.net code.  That part is not working for me.  Apparently it just shows a white box.  I added that swfobject_source.js file, now I am trying to figure out how to get it to work with the rest of my html code and how to embed any objects to get it to work so that when loaded I don't have any problems.
0
 
aibusinesssolutionsCommented:
Ok, that is the other question, if you figured out how to load the mp4 in to flash you can close this question and I will help you on the other one.
0
 
VBBRettAuthor Commented:
Great!  Thank you aibusinesssolutions!!  You are the best.
0
 
VBBRettAuthor Commented:
The Flash Object you told me about worked great!  Thanks!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 15
  • 13
Tackle projects and never again get stuck behind a technical roadblock.
Join Now