Я создаю навык для Алексы, и у меня есть намерение, которое должно воспроизводить определенного радиосигнала из музыки амазонки, если это возможно. Я пытался
handle(handlerInput) {
let card= {
title: 'Radio'
};
let url = 'https://music.amazon.de/stations/A1MIPILDQJQDR2?ref=dm_sh_33b1-9147-dmcp-5abf-7d941&musicTerritory=DE&marketplaceId=A1PA6795UKMFR9';
let play = AudioController.audio.play(url, 0, "Best Of Pop and rock", card);
return Promise.resolve(play);
}
это мой AudioController:
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
const ask_sdk_core_1 = require("ask-sdk-core");
class AudioController {
addScreenBackground(cardData, response) {
if (cardData) {
const directive = response.directives[0];
directive.audioItem['metadata'] = {
title: cardData.title,
subtitle: cardData.text,
art: {
contentDescription: cardData.title,
sources: [{
url: "https://alexademo.ninja/skills/logo-512.png"
}]
},
backgroundImage: {
contentDescription: cardData.title,
sources: [{
url: "https://alexademo.ninja/skills/logo-512.png"
}]
}
};
}
return response;
}
play(url, offset, text, cardData) {
const result = ask_sdk_core_1.ResponseFactory.init();
result
.addAudioPlayerPlayDirective('REPLACE_ALL', url, url, offset)
.withShouldEndSession(true);
if (text) {
result.speak(text);
}
const response = this.addScreenBackground(cardData, result.getResponse());
return response;
}
playLater(url, cardData) {
/*
https://developer.amazon.com/docs/custom-skills/audioplayer-interface-reference.html#play
REPLACE_ENQUEUED: Replace all streams in the queue. This does not impact the currently playing stream.
*/
const result = ask_sdk_core_1.ResponseFactory.init();
result
.addAudioPlayerPlayDirective('REPLACE_ENQUEUED', url, url, 0)
.withShouldEndSession(true);
const response = this.addScreenBackground(cardData, result.getResponse());
return response;
}
stop(text) {
const result = ask_sdk_core_1.ResponseFactory.init();
result.addAudioPlayerStopDirective();
if (text) {
result.speak(text);
}
return result.getResponse();
}
clear() {
/*
* Clear the queue and stop the player
*/
const result = ask_sdk_core_1.ResponseFactory.init();
result.addAudioPlayerClearQueueDirective('CLEAR_ENQUEUED');
return result.getResponse();
}
}
exports.audio = new AudioController();
Алекса произносит сообщение, но не запускает музыку. Он работает с URL, которые не из Амазонки. Это возможно? Как я могу это сделать?