FluorineFx+Flex視訊交談室案例開發----用戶端

來源:互聯網
上載者:User

上一篇《FluorineFx + Flex視訊交談室案例開發----伺服器端》詳細的介紹了如何利用 FluorineFx開發一個及時通訊的視訊交談室伺服器處理常式,並通過Web網站來宿主這個服務 處理常式的運行。本篇將著重介紹視訊交談室的用戶端開發,包括串連RTMP伺服器、發布視 頻、接收視頻、線上使用者列表、發送簡訊以及全伺服器小喇叭功能點。

上述這些功能點在我以前寫的文章裡已經出現了N多次了,所以這裡我不想過多的在次對 他們進行解說,詳細請查閱《Flex與.NET互操作系列文章 》,這裡我將核心的幾個方法代碼 貼出來簡單說明。首先就是客戶實現使用者登入,通過FluorineFx提供的RemotingService的接 口方法進行資料驗證。

private function onLogin(event:MouseEvent):void{    remoteConn = new RemotingConnection("http://localhost:2020/ChatRoom.FluorineFxWeb/Gateway.aspx",ObjectEncoding.AMF3);    myInfo = new UserInfo();    myInfo.UserName=this.txtUserName.text;    myInfo.Password=this.txtPassword.text;    remoteConn.RemotingCall("ChatRoom.Services.DataService.Login",onLoginResult,onLoginFault,myInfo);}private function onLoginResult(result:UserInfo):void{    if(result != null)    {        this.myInfo = result;        this.viewStack.selectedChild = chatView;        rtmpnc = new RtmpConnection("rtmp://localhost:2777/VideoChat",ObjectEncoding.AMF3,onNetStatusHandler,myInfo);    }    else    {        this.lbState.text = "登陸失敗,使用者名稱或密碼錯誤!";    }}private function onLoginFault(event:Object):void{    this.lbState.text = "登陸失敗,請重試!";}private function onClear(event:MouseEvent):void{    this.txtUserName.text="";    this.txtPassword.text="";    this.lbState.text="";    this.txtUserName.setFocus();}

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.