How open a NetStream using video in iOS package?
I am using Flash Pro CS5.5 to create a video player 开发者_JAVA技巧for the iPad. I can get it to work locally, but when I test it on the iPad, it cannot open the video file. The video file is included in the package file. Is there a trick to referencing a video in the package? Here's what I am trying:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.play("myvideo.mp4");
As far as I know, AIR 2.6 for iOS can't play MP4, only FLV (not even F4V, just VP6 encoded FLV files). Maybe next version will have better video support in iOS. For now, try with FLV video. Also, make sure "myvideo.flv" is embedded in the IPA. Alternatively, you can also try using a remote URL ("http://domain/myvideo.flv").
for iOS you should using StageVideo
v
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
var video:StageVideo = stage.stageVideos[0];
video.attachNetStream (ns);
ns.play("myvideo.mp4");
精彩评论