msPlayToSource property
Gets the source associated with the media element for use by the PlayToManager.
This property is read-only.
![]() |
Syntax
| JavaScript |
|---|
ptr = object.msPlayToSource |
Property values
Type: any
The source associated with the media element.
Remarks
The following sets the PlayTo source.
Examples
<video id="videoplayer" src="http://www.contoso.com/clip.mp4" controls autoplay /> <script type="text/javascript"> // Step 1: Obtain PlayToManager object for app’s current view. var ptm = Windows.Media.PlayTo.PlayToManager.getForCurrentView(); // Step 2: Register for the sourcerequested event (user swipes Devices charm). ptm.addEventListener("sourcerequested", function(e) { // Step 3: Specify the media to be streamed (to filter devices). e.sourceRequest.setSource(document.getElementById("videoplayer").msPlayToSource); // The media will then be streamed to the device chosen by the user in the UI. });
See also
Show:
