I am building a module to save webcam/audio comments using flex to design the interface and write to a Red5 server.
I am deconstructing the Riffly module to write a module to have the flex interface appear with comments and write to the Drupal database.
At the moment I have a Flex interface that uses the services module and the amfphp server to write a unique content type I've created to Drupal through a Flex interface. It displays the postings that have been made through a view I created. This was based on the screencast for Flex and Drupal and also code I've found around the net on Flex.
onBWDone
I am getting some problems capturing the webcam data and sending it to the Red5 server.
Audio works fine, it's just the webcam stuff.
Here is the snippet of code that's trying to save the webcam data.
private function netStatusHandler(event:NetStatusEvent):void {
trace(event.info.code);
switch (event.info.code)
{
case "NetConnection.Connect.Success":
//Alert.show("Connection to server a success");
connectStatus = true;
if (connectStatus = true)
{
mic = Microphone.getMicrophone();
cam = Camera.getCamera();
//var vid:Video = new Video;
cam.setMode( 640, 480, 15 );
cam.setQuality( 0, 65 );
cam.setMotionLevel(0, 2000);
stopRecord.enabled = true;
makeRecord.enabled = false;
if (mic != null)
{
mic.setLoopBack(true);
//Security.showSettings(SecurityPanel.MICROPHONE);
mic.setUseEchoSuppression(true);
publishStream = new NetStream(connection);
publishStream.attachAudio(mic);
//publishStream.attachCamera(cam);
if (cam == null)
{
Alert.show("User has no camera installed");
}
else if (cam != null)
{
var vid:Video = new Video;
vid.attachCamera(cam);
addChild(vid);
vid.attachNetStream(publishStream);
}
//publishStream.attachVideo(cam);
var storeNumber:Number = now.valueOf();
//timestamp = storeNumber.toString();
publishStream.publish("message_" + yourName.text, "record");
filename = "message_" + yourName.text + ".flv";
}
else
Alert.show("Microphone not attached or not functioning");
}
break;
default:
Alert.show("Media server connection error.");
connectStatus = false;
}
}
private function stopRecording():void
{
publishStream.close();
mic.setLoopBack(false);
makeRecord.enabled = true;
playRecord.enabled = true;
saveRecord.enabled = true;
deleteRecord.enabled = true;
}
private function playBackRecording():void
{
//Alert.show("playBackRecording function called");
var videoStream:NetStream = new NetStream(connection);
var video:Video = new Video();
video.attachNetStream(publishStream);
videoStream.play(filename);
addChild(video);
//videoPlayer.enabled = true;
//publishStream.play();
//videoPlayer.source = connection + filename;
}The error I'm getting is:
Error #2044: Unhandled AsyncErrorEvent:. text=Error #2095: flash.net.NetConnection was unable to invoke callback onBWDone. error=ReferenceError: Error #1069: Property onBWDone not found on flash.net.NetConnection and there is no default value.
at main/connectToServer()[/Applications/MAMP/Flex Drupal Audio Recorder/main.as:111]
at main/__makeRecord_click()[/Applications/MAMP/Flex Drupal Audio Recorder/main.mxml:11]I tried creating a function:
public function onBWDone():void
{
}But this didn't seem to do anything.
Anyone?
Please help :(
Sarah
Comments
Assuming connection is your
Assuming connection is your NetConnection, maybe you just need to do something like this:
connection.client = this;
I am about to build a module
I am about to build a module which allows audio and video posts as well as comments, using red5. I hope I am able to release the module soon.
What's your background to create a module like that? Any ideas for applications?
Cheers
depends on what you want to use
I have developed one using flex, services, amfphp and Red5 with the FloPlayer.
You could build one in Java too.
:)
didn't realise this had been
didn't realise this had been fixed...
riflly module
hi,
i'm really interested in this module.. 'cause i need to save comments in my server..so i can't use riffly..
have you solved the problem?have you the rifflly javascript code?
someone could help me?