Exporter (0) Imprimer
Développer tout
Ce contenu n’est pas disponible dans votre langue. Voici la version anglaise.

How to implement video streaming for VoIP calls for Windows Phone 8

Applies to: Windows Phone 8 and Windows Phone Silverlight 8.1 only

This topic shows you how to implement video streaming for VoIP calls. Windows Phone 8 provides the MediaStreamer class to enable video streaming. The VoipForegroundLifetimeAgent is launched and its OnLaunched() method is called when your foreground application calls Launch(). In OnLaunched(), create a new instance of the MediaStreamer class specifying an string identifying the stream in the constructor. In the XAML for your foreground application, add a MediaElement in which the video will be displayed. Set the Source property using the following Uri scheme to hook it up to your MediaStreamer: “ms-media-stream-id:MediaStreamer-[streamer ID]”.

Use MediaStreamer to stream video

  1. Create a MediaStreamer object in the OnLaunched() method of your VoipForegroundLifetimeAgent.

    protected override void OnLaunched()
      MediaStreamer ms = MediaStreamerFactory.CreateMediaStreamer("123");
      string sourceRGBA = @"http://fabrikam.com/Frame_RGBA_320_240.bin";
      RAWMediaStreamSource mss = new RAWMediaStreamSource();
      mss.SetVideoStream(sourceRGBA, 320, 240, "RGBA", 30 * TimeSpan.TicksPerSecond, false);
  2. In your foreground app’s XAML, create a MediaElement and set the Source property using the ID you specified when creating the MediaStreamer.

    <MediaElement Source="ms-media-stream-id:MediaStreamer-123"/>

Microsoft réalise une enquête en ligne pour recueillir votre opinion sur le site Web de MSDN. Si vous choisissez d’y participer, cette enquête en ligne vous sera présentée lorsque vous quitterez le site Web de MSDN.

Si vous souhaitez y participer,
© 2014 Microsoft