Next | next - Eigenschaft
Inhaltsverzeichnis reduzieren
Inhaltsverzeichnis erweitern

PlayToSource.Next | next Property

Ruft das nächste "Wiedergeben auf"-Quellelement ab, oder legt dieses fest.

Syntax


var next = playToSource.next;
playToSource.next = next;

Eigenschaftswert

Typ: PlayToSource

Das nächste "Wiedergeben auf"-Quellelement.

Hinweise

Ein Beispiel für die Verwendung der Eigenschaft Next finden Sie unter Streamen einer Bildschirmpräsentation mit Play To (JavaScript) oder Streamen einer Bildschirmpräsentation mit Play To (C#/VB).

Beispiele


// Set up the Play To contract.

// Used to pass an image to Play To that will not be removed/destroyed
// by the slide show logic. For example, if the user opens the Devices
// charm and the sourcerequested event fires, but the image display timeout
// completes before the user selects a target device, then the image that
// was being displayed is removed and destroyed. intialImage is never 
// destroyed so Play To will always have a valid source to stream.
var initialImage = null;

var ptm = Windows.Media.PlayTo.PlayToManager.getForCurrentView();

ptm.addEventListener("sourcerequested", function (e) {
    initialImage = document.createElement("img");

    // Use the statechanged event of the image passed to Play To to determine when
    // the image is finally connected to the Play To Receiver.
    initialImage.msPlayToSource.connection.addEventListener("statechanged", function (e) {

        if (e.currentState === states.connected) {

            // Clear any existing timeout.
            if (cancel) {
                clearTimeout(cancel);
                cancel = 0;
            }

            // Clear the slide show div.
            while (id("slideshowDiv").firstChild) {
                id("slideshowDiv").removeChild(id("slideshowDiv").firstChild);
            }

            // Set the slide show objects and values to show that we are streaming.
            streaming = true;
            id("disconnectButton").style.display = "block";
            id("instructionsDiv").style.display = "none";

            // Queue and display the next image.
            var image = queueImage(currentImage, true);
            initialImage.msPlayToSource.next = image.msPlayToSource;
            initialImage.msPlayToSource.playNext();
        }
    }, false);

    // Provide Play To with the first image to stream.
    e.sourceRequest.setSource(initialImage.msPlayToSource);

}, false);

// Update the once the user has selected a device to stream to.
ptm.addEventListener("sourceselected", function (e) {
    disconnectButton.addEventListener("click", disconnectButtonClick, false);
    id("messageDiv").innerHTML = "Streaming to " + e.friendlyName + "...";
    id("deviceSpan").innerHTML = e.friendlyName + ".<br/>Click here to disconnect.";
    id("iconImage").src = URL.createObjectURL(e.icon, { oneTimeOnly: true });
}, false);


Anforderungen

Mindestens unterstützter Client

Windows 8

Mindestens unterstützter Server

Windows Server 2012

Namespace

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

Metadaten

Windows.winmd

Siehe auch

PlayToSource
Beispiele
Beispiel für „Wiedergeben auf“
PlayToReceiver-Beispiel
Beispiel für Medienserver

 

 

Anzeigen:
© 2017 Microsoft