Created
February 27, 2016 00:15
-
-
Save seksenov/510c6fd87b803cfb9ecb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (typeof Windows !== 'undefined') { | |
// Subscribe to the Windows Activation Event | |
Windows.UI.WebUI.WebUIApplication.addEventListener("activated", function (args) { | |
var activation = Windows.ApplicationModel.Activation; | |
// Check to see if the app was activated by a voice command | |
if (args.kind === activation.ActivationKind.voiceCommand) { | |
var speechRecognitionResult = args.result; | |
var textSpoken = speechRecognitionResult.text; | |
// Determine the command type {play} defined in vcd | |
if (speechRecognitionResult.rulePath[0] === "play") { | |
// Determine the stream name specified | |
if (textSpoken.includes('elephants') || textSpoken.includes('Elephants')) { | |
setupVideo("http://amssamples.streaming.mediaservices.windows.net/b6822ec8-5c2b-4ae0-a851-fd46a78294e9/ElephantsDream.ism/manifest(filtername=FirstFilter)"); | |
} | |
else if (textSpoken.includes('Steel') || textSpoken.includes('steel')) { | |
setupVideo("http://amssamples.streaming.mediaservices.windows.net/bc57e088-27ec-44e0-ac20-a85ccbcd50da/TearsOfSteel.ism/manifest"); | |
} | |
} | |
}; | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment