Skip navigation
Currently Being Moderated

How to detect webcam streams without receiving ones

Nov 13, 2010 6:25 AM

Hi!
I am looking a way to know when user(any user in the room/group) started to publish his webcam and stopped.
I've tried to add listener to StreamManager

            protected function cameraview_initializeHandler(event:FlexEvent):void{
                this._connectionSession.streamManager.addEventListener(StreamEvent.STREAM_RECEIVE, this.streamReceivedHandler);
            }
            protected function streamReceivedHandler(event:StreamEvent):void{
               trace('stream received', event.name, event.streamDescriptor.groupName, event.streamDescriptor.streamPublisherID);
            }

 

And STREAM_RECEIVE called when another user started to publish, but event has groupName=null and streamPublisherID is NULL too.
I need this to give posibility to choose streams needed to play and lower bandwith.
I've tried to use WebcamSubsriber too, but it starts to display stream right when it is received.
What have i missed?

 
Replies
  • Currently Being Moderated
    Nov 13, 2010 12:03 PM   in reply to Oleg Galaburda

    Hi,

     

    Though I am not sure if I understood your question correctly, but If you want to know when user started his publish and stop camera, he should listen to WebcamPublisher for STREAM_RECEIVE (for publishing) and STREAM_DELETE ( for stopping).  And if you want to know for other user's , you should listen to similar event from WebcamSubscriber.

    By default, the group is null , unless you have assigned any particular groupname to your publisher/subscriber component.

     

    Hope this helps

    Thanks

    Hironmay Basu

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 13, 2010 12:16 PM   in reply to Oleg Galaburda

    Oh ok. If you do not by default want to see the other user's stream, you should set initially the publisherIDs property in the WebcamSubscriber to an empty array( not just leave it as by default, it shows every stream). Now, let's say when you get a stream from an user by listening to StreamManager's STREAM_RECEIVE , then you would have to assign publisherIDs array to have that publisherID of the stream that you want to see and it will start showing that user's stream. You need to listen to StreamManager ( and not subscriber) in this case because the subscriber won't know beforehand whether it has to show that stream and won't dispatch the STREAM_RECEIVE event.

     

    Thanks

    Regards

    Hironmay Basu

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 13, 2010 1:04 PM   in reply to Oleg Galaburda

    You may be doing something wrong. Can you send me a small test code and where you are getting null so that I can run on my side and point any mistake or debug into it.

     

    Thanks

    Hironmay Basu

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points