Packagecom.adobe.rtc.collaboration
Classpublic class WebcamPublisher
InheritanceWebcamPublisher Inheritance mx.core.UIComponent
ImplementsISessionSubscriber

WebcamPublisher is the component responsible for publishing webcam video to other room members. It acts as an intermediary between the Camera/NetStream and StreamManager and publishes webcam StreamDescriptors to the StreamManager so that WebcamSubscribers in the room are aware a new stream has been initiated.

It also provides an API for the following:

Like all stream components, WebcamPublisher has an API for setting and getting a groupName. This property can be used to create multiple video groups, each being separate and having different access/publish models, allowing for multiple private conversations. For a subscriber to listen to a particular video stream from a publisher, both should have the same assigned groupName. If no groupName is assigned, the publisher defaults to publishing into the public group.

The WebcamPublisher has no user interface of its own, but provides a basic API through which any commands concerning publishing webcam video should be routed. For a higher-level component with user interface and a publisher and subscriber, see com.adobe.rtc.pods.WebCamera.

By default, only users with role UserRoles.PUBLISHER or greater may publish webcams, and all users with role of greater than UserRoles.VIEWER are able to subsribe to these streams.

Starting and stopping webcam video in a room
  <rtc:AdobeHSAuthenticator 
     // Deployed applications DO NOT hard code username and password here.
     userName="AdobeIDusername@example.com" 
     password="AdobeIDpassword" 
     id="auth"/> 
   <session:ConnectSessionContainer 
     roomURL="http://connect.acrobat.com/exampleAccount/exampleRoom" 
     authenticator="{auth}">
     <mx:VBox width="100%" height="100%">
        <collaboration:WebcamPublisher id="camPub"/>
        <collaboration:WebcamSubscriber webcamPublisher="{camPub}"/>
         <mx:Button label="Video" toggle="true" id="camButt" 
       click="(camButt.selected) ? camPub.publish() : camPub.stop()"/>
     </mx:VBox>
   </session:ConnectSessionContainer>
  

See also

com.adobe.rtc.collaboration.WebcamSubscriber
com.adobe.rtc.pods.WebCamera
com.adobe.rtc.sharedManagers.StreamManager
com.adobe.rtc.sharedManagers.descriptors.StreamDescriptor


Public Properties
 PropertyDefined by
  accessModel : int
The role value required for accessing video streams, for the group this component is assigned to
WebcamPublisher
  camera : Camera
[read-only] Returns the camera object associated with this publisher.
WebcamPublisher
  cameraNameIndex : String
Specifies the index of the current camera within the list of cameras.
WebcamPublisher
  captureWidthHeightFactor : uint
Specifies the captureHeightWidthFactor settings for ON2 video for the webcamera.
WebcamPublisher
  connectSession : IConnectSession
The IConnectSession with which this component is associated; it defaults to the first IConnectSession created in the application.
WebcamPublisher
  fps : uint
Specifies the fps settings for ON2 video for the webcamera.
WebcamPublisher
  groupName : String
Components (pods) are assigned to a group via groupName; if not specified, the component is assigned to the default, public group (the room at large).
WebcamPublisher
  isPaused : Boolean
[read-only] Returns true if the camera is paused; false if not or if there is no stream.
WebcamPublisher
  isPublishing : Boolean
[read-only] Returns true if the camera is publishing; false if not.
WebcamPublisher
  isSynchronized : Boolean
[read-only] Returns whether or not the component is synchronized.
WebcamPublisher
  keyframeInterval : uint
Specifies the keyFrameInterval settings for ON2 video for the webcamera.
WebcamPublisher
  publishModel : int
The role required for this component to publish to the group specified by groupName.
WebcamPublisher
  quality : uint
Specifies the quality settings for ON2 video for the webcamera.
WebcamPublisher
  sharedID : String
Defines the logical location of the component on the service; typically this assigns the sharedID of the collectionNode used by the component.
WebcamPublisher
Public Methods
 MethodDefined by
  
Constructor
WebcamPublisher
  
close():void
Disposes all listeners to the network and framework classes and is recommended for proper garbage collection of the component.
WebcamPublisher
  
Gets the NodeConfiguration on a specific camera stream group.
WebcamPublisher
  
getUserRole(p_userID:String):int
Returns the role of a given user for video streams, within the group this component is assigned to.
WebcamPublisher
  
pause(p_pause:Boolean, p_publisherID:String = null):void
Pauses the stream with the given streamDescriptor.
WebcamPublisher
  
publish(p_publisherID:String = null):void
Begins publishing the webcamera stream after prompting the user.
WebcamPublisher
  
setNodeConfiguration(p_nodeConfiguration:NodeConfiguration):void
Sets the NodeConfiguration.
WebcamPublisher
  
setUserRole(p_userID:String, p_userRole:int):void
Sets the role of a given user for publishing to the component's group specified by groupName.
WebcamPublisher
  
stop(p_publisherID:String = null):void
Stops the webcam stream specified by p_publisherID (defaults to the current user's stream).
WebcamPublisher
  
subscribe():void
Tells the component to begin synchronizing with the service.
WebcamPublisher
Events
 EventSummaryDefined by
   Dispatched when the width and height capturing factor of camera changes.WebcamPublisher
   Dispatched when the camera is accessed for publishing or is stopped.WebcamPublisher
   Dispatched when the fps of the camera has changed.WebcamPublisher
   Dispatched when the users' camera publishing state changes.WebcamPublisher
   Dispatched when the jey frame interval of camera changes.WebcamPublisher
   Dispatched when the quality of the camera has changed.WebcamPublisher
   Dispatched when the current user's webcam stream stops publishing.WebcamPublisher
   Dispatched when the current user's webcam stream is paused.WebcamPublisher
   Dispatched when the current user's webcam stream is published by the component.WebcamPublisher
   Dispatched when the component either loses its connection to the session or regains it and has finished re-synchronizing itself to the rest of the room.WebcamPublisher
   Dispatched when the user's role with respect to the component changes.WebcamPublisher
Property detail
accessModelproperty
accessModel:int  [read-write]

The role value required for accessing video streams, for the group this component is assigned to

Implementation
    public function get accessModel():int
    public function set accessModel(value:int):void
cameraproperty 
camera:Camera  [read-only]

Returns the camera object associated with this publisher.

Implementation
    public function get camera():Camera
cameraNameIndexproperty 
cameraNameIndex:String  [read-write]

Specifies the index of the current camera within the list of cameras.

Implementation
    public function get cameraNameIndex():String
    public function set cameraNameIndex(value:String):void
captureWidthHeightFactorproperty 
captureWidthHeightFactor:uint  [read-write]

Specifies the captureHeightWidthFactor settings for ON2 video for the webcamera.

Implementation
    public function get captureWidthHeightFactor():uint
    public function set captureWidthHeightFactor(value:uint):void

See also

connectSessionproperty 
connectSession:IConnectSession  [read-write]

The IConnectSession with which this component is associated; it defaults to the first IConnectSession created in the application. Note that this may only be set once before subscribe() is called, and re-sessioning of components is not supported.

Implementation
    public function get connectSession():IConnectSession
    public function set connectSession(value:IConnectSession):void
fpsproperty 
fps:uint  [read-write]

Specifies the fps settings for ON2 video for the webcamera.

Implementation
    public function get fps():uint
    public function set fps(value:uint):void

See also

groupNameproperty 
groupName:String  [read-write]

Components (pods) are assigned to a group via groupName; if not specified, the component is assigned to the default, public group (the room at large). Groups are like separate conversations within the room, but each conversation could employ one or more pods; for example, one "conversation" may use a web camera, chat, and whiteboard pod, with each pod using different access and publish models. Users are members of and can only see components within the group they are assigned. Room hosts can see all the groups and all the members in those groups.

Implementation
    public function get groupName():String
    public function set groupName(value:String):void
isPausedproperty 
isPaused:Boolean  [read-only]

Returns true if the camera is paused; false if not or if there is no stream.

This property can be used as the source for data binding.

Implementation
    public function get isPaused():Boolean
isPublishingproperty 
isPublishing:Boolean  [read-only]

Returns true if the camera is publishing; false if not.

This property can be used as the source for data binding.

Implementation
    public function get isPublishing():Boolean
isSynchronizedproperty 
isSynchronized:Boolean  [read-only]

Returns whether or not the component is synchronized.

This property can be used as the source for data binding.

Implementation
    public function get isSynchronized():Boolean
keyframeIntervalproperty 
keyframeInterval:uint  [read-write]

Specifies the keyFrameInterval settings for ON2 video for the webcamera.

Implementation
    public function get keyframeInterval():uint
    public function set keyframeInterval(value:uint):void

See also

publishModelproperty 
publishModel:int  [read-write]

The role required for this component to publish to the group specified by groupName.

Implementation
    public function get publishModel():int
    public function set publishModel(value:int):void
qualityproperty 
quality:uint  [read-write]

Specifies the quality settings for ON2 video for the webcamera.

Implementation
    public function get quality():uint
    public function set quality(value:uint):void

See also

sharedIDproperty 
sharedID:String  [read-write]

Defines the logical location of the component on the service; typically this assigns the sharedID of the collectionNode used by the component. sharedIDs should be unique within a room if they're expressing two unique locations. Note that this can only be assigned once before subscribe() is called. For components with an id property, sharedID defaults to that value.

Implementation
    public function get sharedID():String
    public function set sharedID(value:String):void
Constructor detail
WebcamPublisher()constructor
public function WebcamPublisher()

Constructor

Method detail
close()method
public function close():void

Disposes all listeners to the network and framework classes and is recommended for proper garbage collection of the component.

getNodeConfiguration()method 
public function getNodeConfiguration():NodeConfiguration

Gets the NodeConfiguration on a specific camera stream group.

Returns
NodeConfiguration
getUserRole()method 
public function getUserRole(p_userID:String):int

Returns the role of a given user for video streams, within the group this component is assigned to.

Parameters
p_userID:String — The user ID of the user whose role we should get.

Returns
int
pause()method 
public function pause(p_pause:Boolean, p_publisherID:String = null):void

Pauses the stream with the given streamDescriptor.

Parameters
p_pause:Boolean
 
p_publisherID:String (default = null)
publish()method 
public function publish(p_publisherID:String = null):void

Begins publishing the webcamera stream after prompting the user. It may also be optionally used for requesting a remote user to begin publishing (specified by p_publisherID).

Parameters
p_publisherID:String (default = null) — - if null (default), publishes the current user, otherwise prompts the specified remote user.
setNodeConfiguration()method 
public function setNodeConfiguration(p_nodeConfiguration:NodeConfiguration):void

Sets the NodeConfiguration.

Parameters
p_nodeConfiguration:NodeConfiguration — The node Configuration of the group of Camera Stream.
setUserRole()method 
public function setUserRole(p_userID:String, p_userRole:int):void

Sets the role of a given user for publishing to the component's group specified by groupName.

Parameters
p_userID:String — The user ID of the user whose role should be set.
 
p_userRole:int — The role value to assign to the user with this user ID.
stop()method 
public function stop(p_publisherID:String = null):void

Stops the webcam stream specified by p_publisherID (defaults to the current user's stream).

Parameters
p_publisherID:String (default = null) — Optionally, the userID of the user whose stream should be stopped. Defaults to the current user.
subscribe()method 
public function subscribe():void

Tells the component to begin synchronizing with the service. For UIComponent-based components such as this one, this is called automatically upon being added to the displayList. For "headless" components, this method must be called explicitly.

Event detail
captureWidthHeightFactorChangedevent 
Event object type: com.adobe.rtc.events.CameraConfigurationEvent

Dispatched when the width and height capturing factor of camera changes.

changeevent  
Event object type: flash.events.Event

Dispatched when the camera is accessed for publishing or is stopped.

fpsChangedevent  
Event object type: com.adobe.rtc.events.CameraConfigurationEvent

Dispatched when the fps of the camera has changed.

isCameraPublishingevent  
Event object type: flash.events.Event

Dispatched when the users' camera publishing state changes.

keyFrameIntervalChangedevent  
Event object type: com.adobe.rtc.events.CameraConfigurationEvent

Dispatched when the jey frame interval of camera changes.

qualityChangedevent  
Event object type: com.adobe.rtc.events.CameraConfigurationEvent

Dispatched when the quality of the camera has changed.

streamDeleteevent  
Event object type: com.adobe.rtc.events.StreamEvent

Dispatched when the current user's webcam stream stops publishing.

streamPauseevent  
Event object type: com.adobe.rtc.events.StreamEvent

Dispatched when the current user's webcam stream is paused.

streamReceiveevent  
Event object type: com.adobe.rtc.events.StreamEvent

Dispatched when the current user's webcam stream is published by the component.

synchronizationChangeevent  
Event object type: com.adobe.rtc.events.CollectionNodeEvent

Dispatched when the component either loses its connection to the session or regains it and has finished re-synchronizing itself to the rest of the room.

userRoleChangeevent  
Event object type: com.adobe.rtc.events.CollectionNodeEvent

Dispatched when the user's role with respect to the component changes.





 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/labs/acrobatcom/com/adobe/rtc/collaboration/WebcamPublisher.html