RedBoxCastEvent

Kind of class:public class
Package:com.smartfoxserver.v2.redbox.events
Inherits from:SFSEvent
Dispatched by:
Author:The gotoAndPlay() Team
http://www.smartfoxserver.com
Classpath:com.smartfoxserver.v2.redbox.events.RedBoxCastEvent
File last modified:Wednesday, 04 May 2011, 17:15:57
RedBoxCastEvent is the class representing all events dispatched by the RedBox's AVCastManager instance, except the connection events (see the RedBoxConnectionEvent class).
The RedBoxCastEvent extends the SFSEvent class, which provides a public property called params of type Object containing event-related parameters.
Usage:
  • Please refer to the specific events for usage examples and params object content.

Summary


Constants
  • LIVE_CAST_PUBLISHED : String
    • Dispatched when a user in the current room published his own live stream.
  • LIVE_CAST_UNPUBLISHED : String
    • Dispatched when a user in the current room stops his own live stream.

Constants

LIVE_CAST_PUBLISHED

public static const LIVE_CAST_PUBLISHED:String = "onLiveCastPublished"
(read)

Dispatched when a user in the current room published his own live stream.
This event is fired only if the AVCastManager.getAvailableCasts method has already been called.

The params object contains the following parameters.
Parameters:
liveCast:
(LiveCast) the LiveCast instance representing the live stream published.
Example:
  • The following example shows how to handle a live cast published event.
    avCastMan.addEventListener(RedBoxCastEvent.LIVE_CAST_PUBLISHED, onLiveCastPublished);
    
    // A user publishes his own live cast...
    
    function onLiveCastPublished(evt:RedBoxCastEvent):void
    {
        var liveCast:LiveCast = evt.params.liveCast;
    
        // Subscribe live cast
        var stream:NetStream = avCastMan.subscribeLiveCast(liveCast.id);
    
        // Display a/v stream on stage
        ...
    }

LIVE_CAST_UNPUBLISHED

public static const LIVE_CAST_UNPUBLISHED:String = "onLiveCastUnpublished"
(read)

Dispatched when a user in the current room stops his own live stream.
This event is fired only if the AVCastManager.getAvailableCasts method has already been called.

The params object contains the following parameters.
Parameters:
liveCast:
(LiveCast) the LiveCast instance representing the stopped live stream.
Example:
  • The following example shows how to handle a live cast stopped event.
    avCastMan.addEventListener(RedBoxCastEvent.LIVE_CAST_UNPUBLISHED, onLiveCastUnpublished);
    
    // A user stops streaming...
    
    function onLiveCastUnpublished(evt:RedBoxCastEvent):void
    {
        var liveCast:LiveCast = evt.params.liveCast;
    
        // Remove Video object from stage
        ...
    }