I want to play the local mp4 file in adobe flash player, the source code show following:
package
{
import flash.display.Sprite;
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.text.TextField;
import flash.media.Video;
public class Exploit extends Sprite
{
public function Exploit()
{
greeting = new TextField();
super();
greeting.text = "Loading...";
greeting.x = 100;
greeting.y = 100;
addChild(greeting);
MyVideo = new Video();
addChild(MyVideo);
MyNC = new NetConnection();
MyNC.connect(null);
MyNS = new NetStream(MyNC);
MyVideo.attachNetStream(MyNS);
MyNS.play("http://techslides.com/demos/sample-videos/small.mp4");
}
public var MyNC:NetConnection;
public var MyNS:NetStream;
private var greeting:TextField;
public var MyVideo:Video;
}
}
then I use mxmlc.exe to generate .swf file. Open the swf file, it works. But when I modify MyNS.play("http://techslides.com/demos/sample-videos/small.mp4") to MyNs.play("small.mp4"), and then use mxmlc.exe to generate .swf file. Open it, it cannot play the small.mp4 file.(Note: small.mp4 locates the same directory with swf file).
Anyone give me suggestion?