Packagecom.adobe.rtc.collaboration
Classpublic class AudioSubscriber
InheritanceAudioSubscriber Inheritance mx.core.UIComponent
ImplementsISessionSubscriber

AudioSubscriber is the foundation class for receiving and playing VOIP audio in a AFCS room. By default, AudioSubscriber simply subscribes to StreamManager notifications and plays all audio streams present in the room. It can also accept an array of userIDs, used for restricting the list of publishers that this subscriber should play audio for.

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

Starting and stopping VOIP audio 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>
     <collaboration:AudioPublisher id="audioPub"/>
     <collaboration:AudioSubscriber/>
      <mx:Button label="Audio" toggle="true" id="audioButt" 
     click="(audioButt.selected) ? audioPub.publish() : audioPub.stop()"/>
     </mx:VBox>
   </session:ConnectSessionContainer>
  

See also

com.adobe.rtc.collaboration.AudioPublisher
com.adobe.rtc.sharedManagers.StreamManager
com.adobe.rtc.sharedManagers.descriptors.StreamDescriptor


Public Properties
 PropertyDefined by
  accessModel : int
The role value required for accessing audio streams for this component's group.
AudioSubscriber
  connectSession : IConnectSession
The IConnectSession with which this component is associated; defaults to the first IConnectSession created in the application.
AudioSubscriber
  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).
AudioSubscriber
  isSynchronized : Boolean
[read-only] Returns whether or not the component is synchronized.
AudioSubscriber
  publisherIDs : Array
An array of userIDs, used for restricting the list of publishers that this subscriber should play audio for.
AudioSubscriber
  publishModel : int
The role required for this component to publish to the group specified by groupName.
AudioSubscriber
  sharedID : String
Defines the logical location of the component on the service; typically this assigns the sharedID of the collectionNode used by the component.
AudioSubscriber
  streamCount : int = 0
[read-only] returns the number of streams currently displayed by the subscriber.
AudioSubscriber
Public Methods
 MethodDefined by
  
Constructor
AudioSubscriber
  
close():void
Disposes of all listeners to the network and framework classes and is therefore recommended for proper garbage collection of the component.
AudioSubscriber
  
Gets the NodeConfiguration on a specific audio stream group.
AudioSubscriber
  
getUserRole(p_userID:String):int
Returns the role of a given user for audio streams within this component's group.
AudioSubscriber
  
playStream(p_streamPublisherID:String):void
Plays the audio stream with the given stream publisherID
AudioSubscriber
  
setLocalVolume(p_volume:Number, p_streamPublisherID:String = null):void
Sets the volume level of the Stream published by the specific publisher.
AudioSubscriber
  
setNodeConfiguration(p_nodeConfiguration:NodeConfiguration):void
Sets the NodeConfiguration.
AudioSubscriber
  
setUserRole(p_userID:String, p_userRole:int):void
Sets the role of a given user for subscribing to the component's group specified by groupName.
AudioSubscriber
  
subscribe():void
Subscribes to a particular stream.
AudioSubscriber
Events
 EventSummaryDefined by
   Dispatched when an audio stream is stopped and will cease playing from the subscriber.AudioSubscriber
   Dispatched when an audio stream being played by this component is muted.AudioSubscriber
   Dispatched when a new audio stream is accepted by the subscriber and is about to play.AudioSubscriber
   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.AudioSubscriber
   Dispatched when the current user's role with respect to this component changes.AudioSubscriber
Property detail
accessModelproperty
accessModel:int  [read-write]

The role value required for accessing audio streams for this component's group.

Implementation
    public function get accessModel():int
    public function set accessModel(value:int):void
connectSessionproperty 
connectSession:IConnectSession  [read-write]

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

Implementation
    public function get connectSession():IConnectSession
    public function set connectSession(value:IConnectSession):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
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
publisherIDsproperty 
publisherIDs:Array  [read-write]

An array of userIDs, used for restricting the list of publishers that this subscriber should play audio for. If 0-length, all publishers' streams are played.

Implementation
    public function get publisherIDs():Array
    public function set publisherIDs(value:Array):void
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
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
streamCountproperty 
public var streamCount:int = 0

[read-only] returns the number of streams currently displayed by the subscriber.

Constructor detail
AudioSubscriber()constructor
public function AudioSubscriber()

Constructor

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

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

getNodeConfiguration()method 
public function getNodeConfiguration():NodeConfiguration

Gets the NodeConfiguration on a specific audio stream group.

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

Returns the role of a given user for audio streams within this component's group.

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

Returns
int
playStream()method 
public function playStream(p_streamPublisherID:String):void

Plays the audio stream with the given stream publisherID

Parameters
p_streamPublisherID:String — The publisher of the stream.
setLocalVolume()method 
public function setLocalVolume(p_volume:Number, p_streamPublisherID:String = null):void

Sets the volume level of the Stream published by the specific publisher.

Parameters
p_volume:Number — The user ID of the publisher whose stream's volume is set.
 
p_streamPublisherID:String (default = null) — The volume, between 0 and 1: 0 for silent 1 for full volume.
setNodeConfiguration()method 
public function setNodeConfiguration(p_nodeConfiguration:NodeConfiguration):void

Sets the NodeConfiguration.

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

Sets the role of a given user for subscribing 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.
subscribe()method 
public function subscribe():void

Subscribes to a particular stream.

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

Dispatched when an audio stream is stopped and will cease playing from the subscriber.

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

Dispatched when an audio stream being played by this component is muted.

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

Dispatched when a new audio stream is accepted by the subscriber and is about to play.

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 current user's role with respect to this 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/AudioSubscriber.html