EN
Este conteúdo não está disponível em seu idioma, mas aqui está a versão em inglês.

PlayToReceiver.StopAsync | stopAsync method

Applies to Windows only

Stop receiving Play To commands.

Syntax


playToReceiver.stopAsync().done( /* Your success and error handlers */ );

Parameters

This method has no parameters.

Return value

Type: IAsyncAction

An asynchronous handler that's called when the stop operation is complete.

Remarks

For an example of creating a software Play To receiver, see Quickstart: Creating a Play To Receiver (JavaScript) or Quickstart: Creating a Play To Receiver (C#/VB).


    if (receiver != null) {
        receiver.stopAsync().done(function() {
            if (display != null)
                display.requestRelease();

            // Remove Play To Receiver events
            receiver.removeEventListener("currenttimechangerequested", receiver_CurrentTimeChangeRequested);
            receiver.removeEventListener("mutechangerequested", receiver_MuteChangeRequested);
            receiver.removeEventListener("pauserequested", receiver_PauseRequested);
            receiver.removeEventListener("playbackratechangerequested", receiver_PlaybackRateChangeRequested);
            receiver.removeEventListener("playrequested", receiver_PlayRequested);
            receiver.removeEventListener("sourcechangerequested", receiver_SourceChangeRequested);
            receiver.removeEventListener("stoprequested", receiver_StopRequested);
            receiver.removeEventListener("timeupdaterequested", receiver_TimeUpdateRequested);
            receiver.removeEventListener("volumechangerequested", receiver_VolumeChangeRequested);

            //  Remove MediaElement events
            videoPlayer = document.getElementById("videoPlayer");
            if (videoPlayer.readyState != 0) {
                videoPlayer.pause();
                videoPlayer.currentTime = 0;
            }

            videoPlayer.removeEventListener("durationchange",videoPlayer_DurationChange); 
            videoPlayer.removeEventListener("ended", videoPlayer_Ended); 
            videoPlayer.removeEventListener("error", videoPlayer_Error);
            videoPlayer.removeEventListener("loadedmetadata", videoPlayer_LoadedMetadata); 
            videoPlayer.removeEventListener("pause", videoPlayer_Pause); 
            videoPlayer.removeEventListener("playing", videoPlayer_Playing); 
            videoPlayer.removeEventListener("ratechange", videoPlayer_RateChange); 
            videoPlayer.removeEventListener("seeked", videoPlayer_Seeked); 
            videoPlayer.removeEventListener("seeking", videoPlayer_Seeking); 
            videoPlayer.removeEventListener("volumechange", videoPlayer_VolumeChange); 

            statusDiv.innerHTML = "Stopped receiver.";
        });
    }


Requirements

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

 

 

Mostrar:
© 2014 Microsoft