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
   <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
  bandwidth : Number
Bandwidth is the maxmimum bandwidth the video feed can take given other factors like quality.
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
Deprecated Use resolutionFactor.
WebcamPublisher
  connectSession : IConnectSession
The IConnectSession with which this component is associated; it defaults to the first IConnectSession created in the application.
WebcamPublisher
  deblocking : int
Indicates the type of filter applied to decoded video as part of post-processing.
WebcamPublisher
  fps : uint
Fps is the maximum rate at which the camera can capture data, in frames per second.
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
keyFrameInterval is the number of video frames transmitted in full (called keyframes) instead of being interpolated by the video compression algorithm.
WebcamPublisher
  multicastWindowDuration : int
Sets the silence timeout of the publisher's microphone.
WebcamPublisher
  netStreamInfo : NetStreamInfo
[read-only] Returns the NetStreamInfo for the camera stream published by the publisher
WebcamPublisher
  publishModel : int
The role required for this component to publish to the group specified by groupName.
WebcamPublisher
  quality : uint
Quality is the required level of picture quality, as determined by the amount of compression being applied to each video frame.
WebcamPublisher
  recipientIDs : Array
Array of Recipient UserIDs for camera streams published by this user.
WebcamPublisher
  resolutionFactor : uint
Specifies the resolution factor of captured data; ResolutionFactor values range from 1 (lowest resolution) to 10 (highest resolution).
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 assures proper garbage collection of the component.
WebcamPublisher
  
Gets the NodeConfiguration that defines message permissions and storage policies for the current stream group.
WebcamPublisher
  
getUserRole(p_userID:String):int
Returns the given stream publisher or subscriber's user role within the stream's group.
WebcamPublisher
  
pause(p_pause:Boolean, p_publisherID:String = null):void
Pauses or unpauses the stream specified by p_publisherID; defaults to the current user's stream.
WebcamPublisher
  
publish(p_publisherID:String = null):void
Begins publishing the stream for the user identified by p_publisherID after prompting the user.
WebcamPublisher
  
setNodeConfiguration(p_nodeConfiguration:NodeConfiguration):void
Sets the NodeConfiguration that defines message permissions and storage policies for the current stream group.
WebcamPublisher
  
setUserRole(p_userID:String, p_userRole:int):void
Sets the user role that enables publishing to the component's group specified by the groupName.
WebcamPublisher
  
stop(p_publisherID:String = null):void
Stops publishing the stream published by the user identified by p_publisherID; if the ID is null, it 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 user's 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
bandwidthproperty 
bandwidth:Number  [read-write]

Bandwidth is the maxmimum bandwidth the video feed can take given other factors like quality. Default is RoomManager's current Bandwidth. For more, see bandwidth property in flash.media.Camera The value is in kilobit/sec

Implementation
    public function get bandwidth():Number
    public function set bandwidth(value:Number):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]

Deprecated Use resolutionFactor. Specifies the captureHeightWidthFactor settings for the webcamera.

Implementation
    public function get captureWidthHeightFactor():uint
    public function set captureWidthHeightFactor(value:uint):void
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
deblockingproperty 
deblocking:int  [read-write]

Indicates the type of filter applied to decoded video as part of post-processing. The default value is 0, which lets the video compressor apply a deblocking filter as needed. visit http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/media/Video.html#deblocking for more info.

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

Fps is the maximum rate at which the camera can capture data, in frames per second. The maximum rate possible depends on the capabilities of the camera; this frame rate may not be achieved.

The default value is 6.

Implementation
    public function get fps():uint
    public function set fps(value:uint):void
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]

keyFrameInterval is the number of video frames transmitted in full (called keyframes) instead of being interpolated by the video compression algorithm. A value of 1 means that every frame is a keyframe. The allowed values are 1 through 48.

The default value is 18..

Implementation
    public function get keyframeInterval():uint
    public function set keyframeInterval(value:uint):void
multicastWindowDurationproperty 
multicastWindowDuration:int  [read-write]

Sets the silence timeout of the publisher's microphone.

Implementation
    public function get multicastWindowDuration():int
    public function set multicastWindowDuration(value:int):void
netStreamInfoproperty 
netStreamInfo:NetStreamInfo  [read-only]

Returns the NetStreamInfo for the camera stream published by the publisher

Implementation
    public function get netStreamInfo():NetStreamInfo
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]

Quality is the required level of picture quality, as determined by the amount of compression being applied to each video frame. Acceptable quality values range from 1 (lowest quality, maximum compression) to 100 (highest quality, no compression).

The default value is 70.

Implementation
    public function get quality():uint
    public function set quality(value:uint):void
recipientIDsproperty 
recipientIDs:Array  [read-write]

Array of Recipient UserIDs for camera streams published by this user. Throws an error while setting this property if Private Streaming is not allowed i.e. allowPrivateStreams property is false in StreamManager. Throws an error while setting this property if the Camera Stream for this user is currently published. Stop the stream and then set this property. Set this property to null if you want to broadcast your camera stream to everyone. This is also the default case.

The default value is null.

Implementation
    public function get recipientIDs():Array
    public function set recipientIDs(value:Array):void
resolutionFactorproperty 
resolutionFactor:uint  [read-write]

Specifies the resolution factor of captured data; ResolutionFactor values range from 1 (lowest resolution) to 10 (highest resolution). Resolution factor gets multiplied by the native width and height of captured camera. We provide three native width and height values based on aspect ratios. That width and height when multiplied with this factor, gives the resolution. For higher resolution, use a value like 5.

Implementation
    public function get resolutionFactor():uint
    public function set resolutionFactor(value:uint):void
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 assures proper garbage collection of the component.

getNodeConfiguration()method 
public function getNodeConfiguration():NodeConfiguration

Gets the NodeConfiguration that defines message permissions and storage policies for the current stream group.

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

Returns the given stream publisher or subscriber's user role within the stream's group.

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 or unpauses the stream specified by p_publisherID; defaults to the current user's stream. Dispatches a notification event that can be used to notify room members that the streams state has changed.

Parameters
p_pause:Boolean — True to pause; false to play.
 
p_publisherID:String (default = null) — An optional user ID of the user whose stream pause state should change; otherwise, if null, the current user's stream.
publish()method 
public function publish(p_publisherID:String = null):void

Begins publishing the stream for the user identified by p_publisherID after prompting the user. If the user declines to publish on the first prompt, subsequent attempts to publish invoke a dialog that allows the user to change their publish settings. If the user accepts, it notifies other users through the StreamManager of the new audio stream and begins streaming to the room for consumption by participating subscribers. It may also be optionally used for requesting a remote user of a particular 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 that defines message permissions and storage policies for the current stream group.

Parameters
p_nodeConfiguration:NodeConfiguration — The current stream groups node configuration.
setUserRole()method 
public function setUserRole(p_userID:String, p_userRole:int):void

Sets the user role that enables publishing to the component's group specified by the 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 publishing the stream published by the user identified by p_publisherID; if the ID is null, it defaults to the current user's stream.

Parameters
p_publisherID:String (default = null) — The user ID of the user whose stream should be stopped. Defaults to the current user. Only a room owner can stop a remote user's stream.
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 user's 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