2011-02-01 17 views

回答

0

也許我已經找到了答案here

視頻 只有索倫森視頻和On2 VP6視頻都在iPhone上的AIR應用程序中支持。 您可以使用navigateToURL()方法在應用程序外部打開H.264視頻。作爲請求 參數,傳遞一個URLRequest對象與指向視頻的URL。該視頻將在iPhone的 視頻播放器中發佈。

現在我已經發現如何使用的navigateToUrl()

1
import flash.net.NetConnection; 
import flash.events.NetStatusEvent; 
import flash.net.NetStream; 
import flash.media.Video; 

var nc:NetConnection = new NetConnection(); 
nc.connect(null); 

var ns_url:String = "http://617.gp.selfip.biz/mov/001.flv"; 

var ns:NetStream = new NetStream(nc); 
ns.client = this; 
function onMetaData(info:Object):void{ 
    trace(info.width, info.height, info.duration); 
} 
ns.play(ns_url); 

var vid:Video = new Video(); 
vid.width = 360; 
vid.height = 240; 
addChild(vid); 

vid.x = 0; 
vid.y = 0; 

vid.attachNetStream(ns); 
+0

上面的工作適合我,但是當我刪除視頻時,音頻會繼續播放。我發現我需要調用「SoundMixer.stopAll();」 removeChild(vid)之前和之後讓音頻一致停止。 – 2011-12-20 02:09:35

-1

視頻嵌入到我的IPA和它的URL來加載它在AIR應用程序FLV文件格式的支持。

  1. 首先,您必須將您的視頻與媒體解碼器轉換爲FLV 移動格式。
  2. 導入FLV格式的視頻文件作爲嵌入視頻與Flash播放 組件。
  3. 當你爲iPhone包裝你的應用程序時,包括FLV 文件作爲附件。
相關問題