Ask a Question related to Macromedia Flash Flashcom, Design and Development.
-
Tal_CS #1
NetStream problems
I'm having a problem making the Tutorial_Record work properly.
I tweaked the code a bit, and made it simple. Still, I have trouble with the
recorded stream playback.
To begin with, My stream is published ('live' stream is shown on the admin
console), but not saved on the application folder. Why?
Next, the Stream seems to trace no error, but doesn't play anything, even if I
put in the directory a .flv from the sample_guestbook tutorial (that does
work!).
Here is the tracing of the netstream .play:
Level: status Code: NetStream.Play.Reset
clientid: 105793768
details: my_recorded_stream
description: Playing and resetting my_recorded_stream.
code: NetStream.Play.Reset
level: status
Level: status Code: NetStream.Play.Stop
reason:
clientid: 105793768
details: my_recorded_stream
description: Stopped playing my_recorded_stream.
code: NetStream.Play.Stop
level: status
Level: status Code: NetStream.Buffer.Flush
level: status
code: NetStream.Buffer.Flush
Any help appreciated.
I've tried changing the security setting to Network/Local Only but there was
no change in the results.
Here's the client-code, put in keyframe 1, layer 1 (lowest):
var my_video:Video; //my_video is a Video object on the Stage
var her_video:Video; // "her" = example already recorded video object
var my_cam:Camera = Camera.get();
var my_mic:Microphone = Microphone.get();
my_video.attachVideo(my_cam);
record_btn.addEventListener("click",doRecord);
play_btn.addEventListener("click",doPlay);
function initStreams() {
// Make a connection to the application on the server
client_nc = new NetConnection();
// Note that this call includes the protocol, rtmp, the
// app name, tutorial_record, and the application instance name, room_01
client_nc.connect("rtmp://localhost/dev3video");
// Handle status message for the
client_nc.onStatus = function(info) {
trace("Level: " + info.level + " Code: " + info.code);
}
// Create output stream used to publish the video
out_ns = new NetStream(client_nc);
// Create an input stream to playback the video, and attach
// video on that stream to the Replay_video object
in_ns = new NetStream(client_nc);
in_ns.onStatus = function(info) {
trace("Level: " + info.level + " Code: " + info.code);
//trace("NetStream.onStatus called: ("+getTimer()+" ms)");
for (var prop in info) {
trace("\t"+prop+":\t"+info[prop]);
}
}
her_video.attachVideo(in_ns);
}
// Connect to server and set up streams
initStreams();
function doRecord() {
if (record_btn.label == "Record") {
//Record_btn.selected
//was: Record_btn.getLabel() == "Record"
trace ("You pressed Record");
// Attach data from the video and audio devices to the output stream
out_ns.attachVideo(client_cam);
out_ns.attachAudio(client_mic);
// Then publish the camera output as a recorded stream
out_ns.publish("my_recorded_stream", "record");
// Don't allow the user to play when recording
play_btn.enabled = false;
// Change the button label
record_btn.label = "Stop";
} else if (record_btn.label == "Stop") {
trace ("You pressed (STOP-)Record");
// Close output stream.
//? why doesn't it save the stream in the applications folder?
out_ns.close();
// Now that you're finished recording, allow the user to play
play_btn.enabled = true;
record_btn.label = "Record";
}
}
function doPlay () {
trace ("You pressed Play");
in_ns.play("my_recorded_stream");
}
Tal_CS Guest
-
NetStream in Flex SDK
HI I have a clinet and a server side WebCam applictions that is developted in Flex builder 3 and on top of Flash Media Server . in server side I... -
NetStream.Play.Stop/NetStream.Buffer.Flush calledprematurely
So I've created a custom video interface (based on the one http://movielibrary.lynda.com/html/modPage.asp?ID=182 ) that hinges on the... -
netStream information plz
the following code is a netStream on status if function however if i change createNetStream(this); to createNetStream(_root) or... -
Saving a NetStream to FLV
Hi Everyone, I am a relative Flash newbie and have been trying to accomplish the following: I want to know how to save video and audio content... -
NetStream not streaming
hey everybody! :) the first chapter of the oreilly fcs book has a helloVideo app that works. it's pretty much what i want to do with my app so... -



Reply With Quote


