SourceChangeRequested | sourcechangerequested event

PlayToReceiver.SourceChangeRequested | sourcechangerequested event

Occurs when the source media for the Play To receiver have changed.

Syntax


function onSourceChangeRequested(eventArgs) { /* Your code */ }
 
// addEventListener syntax
playToReceiver.addEventListener("sourcechangerequested", onSourceChangeRequested);
playToReceiver.removeEventListener("sourcechangerequested", onSourceChangeRequested);
 
- or -

playToReceiver.onsourcechangerequested = onSourceChangeRequested;


Event information

Delegate TypedEventHandler<PlayToReceiver, SourceChangeRequestedEventArgs>

Remarks

For an example of creating a software Play To receiver, see Media casting or Media casting.


function receiver_SourceChangeRequested(args) {
    if (args.stream != null) {
        var mediaStream = MSApp.createBlobFromRandomAccessStream(args.stream.contentType, args.stream);
        videoPlayer.src = URL.createObjectURL(mediaStream, false);
    }
}


Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

None supported

Namespace

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

Metadata

Windows.winmd

See also

PlayToReceiver
Samples
Play To sample
PlayToReceiver sample
Media Server sample

 

 

Show:
© 2016 Microsoft