PlayToSourceRequest class

Applies to Windows only

Represents a request to connect a media element with a Play To target.

Syntax


/* For information about creating or accessing this object, see Remarks. */

Attributes

[MarshalingBehavior(Agile)]
[Version(0x06020000)]

Members

The PlayToSourceRequest class has these types of members:

Methods

The PlayToSourceRequest class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
DisplayErrorString Displays an error message in the Play To UI.
GetDeferral Defers connecting a media source to a Play To target.
SetSource Sets the source element to connect to the Play To target.

 

Properties

The PlayToSourceRequest class has these properties.

PropertyAccess typeDescription

Deadline

Read-onlyGets the time limit to supply the Play To source element.

 

Remarks

The PlayToSourceRequest class represents a user request for source media to stream to a Play To target. You use the SourceRequest property of the PlayToSourceRequestedEventArgs class to pass media from your application to Play To during the SourceRequested event.

You can use the GetDeferral method to create a deferral for when you want to make an asynchronous call to retrieve the media element to stream. Play To will then wait for you to supply the media element until you mark the deferral as complete.

For an example of how to use Play To in an application, see Quickstart: Using Play To in applications (JavaScript) or Quickstart: Using Play To in applications (C#/VB).

Examples


// Play To Contract

var ptm = Windows.Media.PlayTo.PlayToManager.getForCurrentView();
ptm.addEventListener("sourcerequested", sourceRequestHandler, false);

function sourceRequestHandler(e) {
    try {
        e.sourceRequest.setSource(mediaElement.msPlayToSource);

    } catch (ex) {
        id("messageDiv").innerHTML += "Exception encountered: " + ex.message + "<br/>";
    }
}


Requirements

Minimum supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

None supported

Namespace

Windows.Media.PlayTo
Windows::Media::PlayTo [C++]

Metadata

Windows.winmd

See also

Samples
Play To sample
PlayToReceiver sample
Media Server sample

 

 

Show:
© 2014 Microsoft