473,699 Members | 2,258 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Checking if video is attached to netstream

1 New Member
I'm working on a video chat application and I'm building a feature where someone who starts a call can switch the call to an audio call. Now the receiver gets a link for the call and when they join the call the application gets their camera and microphone and attach it to the netstream. What I want is if the initiator if the call turns his camera off when starting the call when the receiver who joins the call, the application shouldn't get the Camera because their is no video attached to the netstream.
Now I have used netstream.info. Videobytesperse cond but since the opposing video and audio doesn't start immediately when the receiver joins the call (There is like a 3-4 second delay) the function keeps returning 0 at the start of the call whether or not the netstream has a video attached to it or not.

This is what I did

Expand|Select|Wrap|Line Numbers
  1. public function checkVideo():Number        {
  2.  
  3.             hey=_incomingStream.info.videoByteCount;
  4.             return hey;
  5.         }
  6.  
  7. if(_outgoingStream && _incomingStream!=null ){
  8.                     if(checkVideo()>0)
  9.                     _outgoingStream.attachCamera(camera);
  10.                     else
  11.                         _outgoingStream.attachCamera(null);    
  12.  
It didn't work.

Next I read about the netstream.send( ) function and so my idea was that when a user initiates a call he/she will send at message in the netstream which will basically flag true if the user initiated a video call or false if the user initiated an audio call. Then when the receiver joins if the flag is false their camera won't be initiated but if the flag is true the camera would be initiated.

When I implemented it, it didn't work. I don't know if there is something I did wrong while implementing.

Expand|Select|Wrap|Line Numbers
  1. if(camera && !muteCam )
Expand|Select|Wrap|Line Numbers
  1.             {//Initate call
  2.                 camera = setCameraQuality(camera);
  3.                 yourVidHolder.attachCamera(camera);
  4.  
  5.                 if(_outgoingStream && _incomingStream==null){
  6.                     _outgoingStream.attachCamera(camera);
  7.    _outgoingStream.send("flagVideo", true);
  8.  
  9. ----------------------------------------------------------------------------------
  10. public function flagV():Boolean
  11.         {
  12.  
  13.             _incomingStream.client.flagVideo=function(flag:Boolean):void{
  14.                 check=flag;
  15.             }
  16.  
  17.  
  18.  
  19.                 return check;
  20.         }
  21.  
  22.  
  23. if(_outgoingStream && _incomingStream!=null ){
  24.                     if(checkVideo()>0)
  25.                     _outgoingStream.attachCamera(camera);
  26.                     else
  27.                         _outgoingStream.attachCamera(null);    
  28.                 }
  29.  
  30.  
  31.  
But I can't get it to work. Can anyone help me out please?
Also maybe there is a better way I could check if the netstream has a video attached to it? Thanks!
May 19 '13 #1
0 1658

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1724
by: Help | last post by:
What are the parameters in the constructor if you are going to send a file over a tcp/ip network using netstream and filestream? I have learned that you are supposed to do something like this: NetStream nstream = new netStream(client); FileStream fstream = new File ("c:\\test.txt", FileMode.open);
7
3041
by: fairyvoice | last post by:
i am writing a very simple c/s socket program, i just wanted the client to first write to the server, after server get the message it, write to the client, the the client write again. here's the codes: Server: --------------------------------------------- NetworkStream ns = this.client.GetStream(); StreamReader reader = new StreamReader(ns); StreamWriter sw = new StreamWriter(ns);
2
2141
by: wizardRahl | last post by:
Hello, I've just recently built a system for my family. I want to add an older video card that I've just had lying around. At the moment, it just has on-board 16mb video. I want to add the ATI Rage 128 that I have spare. When I plug it in, the system won't boot. I know the video card works b/c it works in other computers. It also won't allow me to plug the monitor in to the on-board when I have the vid card plugged in. Back to the not...
1
14749
by: michael | last post by:
Hello all, I have a Linksys WVC54GC network camera that I am trying to integrate into a website and to enable browsers other than IE to use. Linksys, in their ever-short-sighted ways, decided to make this device only compatible with IE. It requires IE and ActiveX. However, you can access the video stream directly with the following URL http://1.2.3.4/img/video.asf
6
2739
by: Daniel Padron | last post by:
Ok. Maybe I shouldnt post such basic questions here in such an advanced group but my high school programming teacher wont answer any questions outside of his curriculum :( My goal is create a program that will get feeded a url that links direcly to a file http://www.example.com/video.avi] the program will then determine if the file is there or not. There are probably more efficient ways of doing what I want to do but this is the way I...
1
7814
by: Stwange | last post by:
I'm currently loading flv videos in swf using the NetStream, NetConnect(null) and Video objects, but how do I set the video to autorepeat? I can't find a method for it in any of the APIs for the above, and I don't really want to write code to wait the length of the video before replaying. Any suggestions will be greatly appreciated, thank-you.
0
3876
by: eliana | last post by:
Hi i'm writing a simple player to stream a flv file; video streams fine but the netstream onstatus and the nestream onmetadata are not invoked. Any help? Here is my code: var nc:NetConnection = new NetConnection; var ns:NetStream; var bufferLength:Number = 3; var fileToPlay:String; initCon();
2
2121
by: =?Utf-8?B?anAybXNmdA==?= | last post by:
You're going to need to start with the driver for the camera - otherwise, your application might run into problems finding where the video is. Next, search (i.e. Google) into Twain Aquire sources. "Elliot" wrote:
2
5131
by: Andycb | last post by:
Hi i'm realtively new to HTML, let alone HTML CSS but basicly, as the title suggests I want to know how to position a flash video in a particular part of the web page. I have attached a picture showing where the video is currently, and where I actually want it to be. 2243 I've also included a text document showing all of my code. I've highlighted the code at the bottom of the document because its the code to do with the flash video. 2244
0
2253
by: Meera Haridas | last post by:
I want to record audio and video from IP camera.i have attached my application here.By using that i can stream video and can save images continously,but iam not able to save video.anybody can help me for finish my task. Thanks in advance Regards Meera
0
9184
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8930
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8892
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7761
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4634
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3061
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2013
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.