[flexcoders] Re: Changing video sources in the middle of the... er.. stream
Is there an example of a way to have a video display without using the VideoDisplay component? Maybe that would work here. sr --- In flexcoders@yahoogroups.com, Simon Bailey <[EMAIL PROTECTED]> wrote: > > Oh sorry didnt realise you were using VideoDisplay, sorry never use or > used that component.. > > :S > > On 2 Sep 2008, at 22:21, stephendricketts wrote: > > Actually, I thought about that but found that the VideoDisplay didn't > have that as a method so I found an example that used: > > import mx.core.mx_internal; > > In the program I wrote... > > pubVideo.mx_internal::videoPlayer.clear(); > pubVideo.attachCamera(cam); > > But that didn't have any effect on the VideoDisplay display. Don't > know if I did that right but nothing yelled at me. ;-) > > sr > > --- In flexcoders@yahoogroups.com, Simon Bailey wrote: > > > > At a very quick glance, have you tried: > > > > videoObj.clear(); > > > > before assigning and attaching you NetStream to the video Object? > > > > Cheers, > > > > Simon > > > > newtriks.com > > > > On 2 Sep 2008, at 21:43, stephendricketts wrote: > > > > I have a FB3 application that streams live video to a number of > users > > and periodically needs to change whose sending video. The > > application pretty much has to work this way. > > > > Let's call the person that's sending the video the "host". > > Periodically they will switch hosts and let another user become the > > host and send their video. This works except when the video > > is "taken" the users see the new video source, but the video that's > > displayed on the new host's videoDisplay is a still picture of the > > first host. > > > > Can anyone point me to how this switching should be done?... or be > > willing to plow through my code and see where I've screwed up? It's > > been simplified as much as I can so it makes (some) sense. > > > > Any direction greatly appreciated! > > > > Steve > > > > Here's a condensed version of the code. I should also add, this is > > the same program for all users. The host is only a host because they > > were on first: > > > > 1. Initial Host connection: > > > > if(nc.connected){ > > nsPublish = new NetStream(nc); > > nsPublish.attachAudio(Microphone.getMicrophone()); > > nsPublish.publish("LS","live"); > > cam = Camera.getCamera(); > > if (cam != null) { > > nsPublish.attachCamera(cam); > > pubVideo.attachCamera(cam); > > addChild(pubVideo); > > } > > } > > > > 2. Initial User Connection: > > > > if (nc.connected){ > > pubVideo.source = rtmpPath + "/" + rtmpSession + "/LS"; > > } > > > > // At this point everyone is seeing what they should. > > --- > > 3. User Takes Control: > > > This is the same routine as was used when the host initially > connected > > --!> > > > > if(nc.connected){ > > nsPublish = new NetStream(nc); //Initializing NetStream > > nsPublish.attachAudio(Microphone.getMicrophone()); > > nsPublish.publish("LS","live"); > > cam = Camera.getCamera(); > > if (cam != null) { > > nsPublish.attachCamera(cam); // THIS SEEN ON ALL OTHER CONNECTIONS > > pubVideo.attachCamera(cam); // THIS NOT WORKING, STILL PICTURE!? > > addChild(pubVideo); > > } > > } > > > > live="true"/> > > > > So, the stream is really being published as everyone can see and > hear > > the new host. It's just on the new host's display they are seeing a > > still picture of the first host. Seems simple, but... > > >
Re: [flexcoders] Re: Changing video sources in the middle of the... er.. stream
Oh sorry didnt realise you were using VideoDisplay, sorry never use or used that component.. :S On 2 Sep 2008, at 22:21, stephendricketts wrote: Actually, I thought about that but found that the VideoDisplay didn't have that as a method so I found an example that used: import mx.core.mx_internal; In the program I wrote... pubVideo.mx_internal::videoPlayer.clear(); pubVideo.attachCamera(cam); But that didn't have any effect on the VideoDisplay display. Don't know if I did that right but nothing yelled at me. ;-) sr --- In flexcoders@yahoogroups.com, Simon Bailey <[EMAIL PROTECTED]> wrote: > > At a very quick glance, have you tried: > > videoObj.clear(); > > before assigning and attaching you NetStream to the video Object? > > Cheers, > > Simon > > newtriks.com > > On 2 Sep 2008, at 21:43, stephendricketts wrote: > > I have a FB3 application that streams live video to a number of users > and periodically needs to change whose sending video. The > application pretty much has to work this way. > > Let's call the person that's sending the video the "host". > Periodically they will switch hosts and let another user become the > host and send their video. This works except when the video > is "taken" the users see the new video source, but the video that's > displayed on the new host's videoDisplay is a still picture of the > first host. > > Can anyone point me to how this switching should be done?... or be > willing to plow through my code and see where I've screwed up? It's > been simplified as much as I can so it makes (some) sense. > > Any direction greatly appreciated! > > Steve > > Here's a condensed version of the code. I should also add, this is > the same program for all users. The host is only a host because they > were on first: > > 1. Initial Host connection: > > if(nc.connected){ > nsPublish = new NetStream(nc); > nsPublish.attachAudio(Microphone.getMicrophone()); > nsPublish.publish("LS","live"); > cam = Camera.getCamera(); > if (cam != null) { > nsPublish.attachCamera(cam); > pubVideo.attachCamera(cam); > addChild(pubVideo); > } > } > > 2. Initial User Connection: > > if (nc.connected){ > pubVideo.source = rtmpPath + "/" + rtmpSession + "/LS"; > } > > // At this point everyone is seeing what they should. > --- > 3. User Takes Control: > This is the same routine as was used when the host initially connected > --!> > > if(nc.connected){ > nsPublish = new NetStream(nc); //Initializing NetStream > nsPublish.attachAudio(Microphone.getMicrophone()); > nsPublish.publish("LS","live"); > cam = Camera.getCamera(); > if (cam != null) { > nsPublish.attachCamera(cam); // THIS SEEN ON ALL OTHER CONNECTIONS > pubVideo.attachCamera(cam); // THIS NOT WORKING, STILL PICTURE!? > addChild(pubVideo); > } > } > > > > So, the stream is really being published as everyone can see and hear > the new host. It's just on the new host's display they are seeing a > still picture of the first host. Seems simple, but... >
[flexcoders] Re: Changing video sources in the middle of the... er.. stream
Actually, I thought about that but found that the VideoDisplay didn't have that as a method so I found an example that used: import mx.core.mx_internal; In the program I wrote... pubVideo.mx_internal::videoPlayer.clear(); pubVideo.attachCamera(cam); But that didn't have any effect on the VideoDisplay display. Don't know if I did that right but nothing yelled at me. ;-) sr --- In flexcoders@yahoogroups.com, Simon Bailey <[EMAIL PROTECTED]> wrote: > > At a very quick glance, have you tried: > > videoObj.clear(); > > before assigning and attaching you NetStream to the video Object? > > Cheers, > > Simon > > newtriks.com > > On 2 Sep 2008, at 21:43, stephendricketts wrote: > > I have a FB3 application that streams live video to a number of users > and periodically needs to change whose sending video. The > application pretty much has to work this way. > > Let's call the person that's sending the video the "host". > Periodically they will switch hosts and let another user become the > host and send their video. This works except when the video > is "taken" the users see the new video source, but the video that's > displayed on the new host's videoDisplay is a still picture of the > first host. > > Can anyone point me to how this switching should be done?... or be > willing to plow through my code and see where I've screwed up? It's > been simplified as much as I can so it makes (some) sense. > > Any direction greatly appreciated! > > Steve > > Here's a condensed version of the code. I should also add, this is > the same program for all users. The host is only a host because they > were on first: > > 1. Initial Host connection: > > if(nc.connected){ > nsPublish = new NetStream(nc); > nsPublish.attachAudio(Microphone.getMicrophone()); > nsPublish.publish("LS","live"); > cam = Camera.getCamera(); > if (cam != null) { > nsPublish.attachCamera(cam); > pubVideo.attachCamera(cam); > addChild(pubVideo); > } > } > > 2. Initial User Connection: > > if (nc.connected){ > pubVideo.source = rtmpPath + "/" + rtmpSession + "/LS"; > } > > // At this point everyone is seeing what they should. > --- > 3. User Takes Control: > This is the same routine as was used when the host initially connected > --!> > > if(nc.connected){ > nsPublish = new NetStream(nc); //Initializing NetStream > nsPublish.attachAudio(Microphone.getMicrophone()); > nsPublish.publish("LS","live"); > cam = Camera.getCamera(); > if (cam != null) { > nsPublish.attachCamera(cam); // THIS SEEN ON ALL OTHER CONNECTIONS > pubVideo.attachCamera(cam); // THIS NOT WORKING, STILL PICTURE!? > addChild(pubVideo); > } > } > > > > So, the stream is really being published as everyone can see and hear > the new host. It's just on the new host's display they are seeing a > still picture of the first host. Seems simple, but... >