MACROMEDIA FLASH COMMUNICATION SERVER MX-SERVER-SIDE COMMUNICATION ACTIONSCRIPT DICTIONARY Especificações Página 292

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 369
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 291
Client-Side Communication ActionScript 101
Video.attachVideo
Availability
Flash Player 6.
Flash Communication Server MX (not required).
Usage
myVideoObject.attachVideo(source | null)
Parameters
source A NetStream or Camera object that is playing or capturing video data, respectively. To
drop the connection to the Video object, pass
null for source.
Returns
Nothing.
Description
Method; specifies a video stream (source) to be displayed within the boundaries of the Video
object on the Stage. The video stream is either a NetStream object being displayed by means of
the
NetStream.play command (requires Flash Communication Server), a Camera object, or
null. If source is null, video is no longer played within the Video object.
Example
The following example plays live video locally, without the need for Flash Communication
Server.
myCam = Camera.get();
myVid.attachVideo(myCam); // myVid is a Video object on the Stage
The following example shows how to publish and record a video, and then play it back.
// This script publishes and records video
// The recorded file will be named "allAboutMe.flv"
connection = new NetConnection();
connection.connect("rtmp://localhost/allAboutMe/mySpeech");
publishStream = new NetStream(connection);
publishStream.publish("allAboutMe", "record");
publishStream.attachVideo(Camera.get());
// This script plays the recorded file.
// Note that no publishing stream is required to play a recorded file.
connection = new NetConnection();
connection.connect("rtmp://localhost/allAboutMe/mySpeech");
subscribeStream = new NetStream(connection);
subscribeStream.play("allAboutMe");
myVid.attachVideo(subscribeStream);// myVid is a Video object on the Stage
See also
Camera (object), NetStream.play, NetStream.publish
Vista de página 291
1 2 ... 287 288 289 290 291 292 293 294 295 296 297 ... 368 369

Comentários a estes Manuais

Sem comentários