udah hampir berbulan – bulan ga di apdet lagi nih blog, lagi keranjingan nyari-nyari piti di dunia asli ![]()
to the point aja lah, udah 3 bulan ini gw lagi improvisasi sama yang nama nya webcam di gabung pake php, udah nanya sana sini tapi semua jawaban programmer sama, yaitu TIDAK BISA…
![]()
![]()
setelah searching hasil nya qetemu, ternyata memang tidak bisa, harus lah menggunakan FLASH yang di gabung sama action scripts berikut code asal caplok yang bakalan di implementasiin..
var camera:Camera = Camera.getCamera(); var video:Video = new Video(); video.attachCamera(camera); addChild(video);
Pertama, mari kita atur resolusi kamera dan video untuk contoh. Kode ini akan setup kamera default dan contoh default video. defaultnya adalah 320 × 240 px
var bandwidth:int = 0; // Specifies the maximum amount of bandwidth that the current outgoing video feed can use, in bytes per second. To specify that Flash Player video can use as much bandwidth as needed to maintain the value of quality , pass 0 for bandwidth . The default value is 16384. var quality:int = 50; // this value is 0-100 with 1 being the lowest quality. Pass 0 if you want the quality to vary to keep better framerates var camera:Camera = Camera.getCamera(); camera.setQuality(bandwidth, quality); camera.setMode(320,240,15,true); // setMode(videoWidth, videoHeight, video fps, favor area) // Now attach the webcam stream to a video object. var video:Video = new Video(); video.attachCamera(camera); addChild(video);
var bandwidth:int = 0; // Specifies the maximum amount of bandwidth that the current outgoing video feed can use, in bytes per second. To specify that Flash Player video can use as much bandwidth as needed to maintain the value of quality , pass 0 for bandwidth . The default value is 16384. var quality:int = 100; // this value is 0-100 with 1 being the lowest quality. Pass 0 if you want the quality to vary to keep better framerates var camera:Camera = Camera.getCamera(); camera.setQuality(bandwidth, quality); camera.setMode(320,240,30,false); // setMode(videoWidth, videoHeight, video fps, favor area) var video:Video = new Video(); video.attachCamera(camera); addChild(video);
kalao scritps di atas agak sedikit ribet, kalau mau yang simple nih
//Create a video instance video = new Video(640, 480); //Get the camera reference. camara = Camera.getCamera(); //setMode need 3 params, width, height and frame rate. //Optianally you can set a boolean value at the end for the favorArea. camara.setMode(640, 480, 30); //put the camera in the video instance video.attachCamera(camara); addChild(video);
kalau mau di rekam webcam nya pake scrips kaya gini
//functions for recording
function doRecord() {
if (Record_btn.getLabel() == "Record" && archiveName_tx.text != "") {
archiveName_tx.type = "dynamic"
// show live video feed.
Live_video.attachVideo(client_cam);
Live_video.attachAudio(client_mic);
// Start publishing the camera output as a recorded stream
record_ns.attachVideo(client_cam);
record_ns.attachAudio(client_mic);
record_ns.publish(archiveName_tx.text, "record");// record stream
// Change the button label
Record_btn.setLabel("Stop");
nTimer = setInterval(stopRecording, 30000);//does it WORK???
} else if (Record_btn.getLabel() == "Stop") {
// Close output stream
record_ns.close();
//
record_ns.attachVideo(null);
record_ns.attachAudio(null)
//
Live_video.attachVideo(null)
Live_video.attachAudio(null)
//
liveStreamInfo_so.data.broadcastStatus = null
liveStreamInfo_so.data.currentBroadcast = ""
// Change the button label
Record_btn.setLabel("Record");
editList(archiveName_tx.text, "newOne")
archiveName_tx.text = ""
archiveName_tx.type = "input"
}
}
function playArchive(){
if(Record_btn.getLabel() != "Record"){return;}
Live_video.clear()
Live_video.attachVideo(live_ns)
live_ns.play(archiveView_tx.text)
}
// deletes archive flv and shared object reference
function deleteArchive(){
editList(archiveView_tx.text, "removeOne")
// calls the function on the ASC called delStream, send over the name of the flv
client_nc.call("delStream", null, archiveView_tx.text)
archiveView_tx.text = ""
}
function stopRecording():Void{ //may own code
// Close output stream
record_ns.close();
//
record_ns.attachVideo(null);
record_ns.attachAudio(null)
//
Live_video.attachVideo(null)
Live_video.attachAudio(null)
//
liveStreamInfo_so.data.broadcastStatus = null
liveStreamInfo_so.data.currentBroadcast = ""
// Change the button label
Record_btn.setLabel("Record");
editList(archiveName_tx.text, "newOne")
archiveName_tx.text = ""
archiveName_tx.type = "input"
clearInterval(nTimer);
kalau mau yang lbih ribet lagi.. nih buka aja

update dong gan infonya…ane dukung blog ini…thank’s