看板 Flash 關於我們 聯絡資訊
※ 引述《skyracer ()》之銘言: : 大家好,我現在在開發一個camera相關的AS程式, : 程式執行時會啓動camera,程式如下: : this._webcam = Camera.getCamera(); : this._webcam.setMode(285, 285, 30); : this._video = new Video(this._width, this._height); : this._video.attachCamera(this._webcam); : this._capture = new Bitmap(new BitmapData(this._width, this._height, false, 0) : , PixelSnapping.AUTO, true); : 不知道為什麼當我用desktop AIR時程式可以開啓camera, : 但如果包在html裡頭,在網頁上就沒辦法開啓camera 連黑色畫面都沒有. : 好像完全沒有執行getCamera的程式. : (我是用flex) 我翻出以前測試的code,長這樣 我猜是少了確認security這一道手續 總之下面這個code是可以運作的,雖然有拼錯 lol var cam:Camera; var vid:Video = new Video(500,300) getCamara(); function getCamara():void{ cam = Camera.getCamera(); addChild(vid); //if(!cam)myTextField.text = "have no Camera"; if(cam){ cam.addEventListener(StatusEvent.STATUS, statusHandler); Security.showSettings(SecurityPanel.PRIVACY); } } function statusHandler(evt:StatusEvent):void{ //myTextField.text = "clicked"; if (evt.code == "Camera.Unmuted") { connectCamera(); cam.removeEventListener(StatusEvent.STATUS, statusHandler); //myTextField.text = "connecting"; }//else{ myTextField.text = "not permitted"} } function connectCamera():void { vid.attachCamera(cam); //do something } -- ※ 發信站 :批踢踢實業坊(ptt.cc) ◆ From: 140.112.251.158
et69523820:你網頁上的SWF寬高是多少 寬高太少會有安全性問題導致 10/15 13:49
et69523820:視訊會無法開起... 10/15 13:50
dsmwang:只要是使用webCam都需要使用者同意 10/16 19:14
et69523820:寬高太小就算按下同意 也不能開起 10/22 02:59