i want play local mp4 file in adobe flash player, 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 use mxmlc.exe generate .swf file. open swf file, works. when modify myns.play("http://techslides.com/demos/sample-videos/small.mp4") myns.play("small.mp4"), , use mxmlc.exe generate .swf file. open it, cannot play small.mp4 file.(note: small.mp4 locates same directory swf file).
anyone give me suggestion?
i don't think flash supports mp4 natively. suggest looking @ codec
here list of natively supported codecs flash player:
http://kb2.adobe.com/cps/402/kb402866.html
if need play not natively supported, there external api's allow so, chose flash sound api: