- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我在理解如何在 audioPlayer“正在播放”屏幕内的 Echo Show 上显示图像时遇到问题。
我目前正在播放音频文件,并希望在“正在播放”屏幕上显示图像。我能得到的最接近的是以下代码,它在音频开始之前显示图像和标题,但随后立即消失,Echo Show 进入“正在播放”屏幕,没有背景图像和元数据。我觉得我已经接近了,但只是不明白如何更新“正在播放”屏幕,而不是紧接在它之前的屏幕。
这是代码的一部分(按上述方式工作):
var handlers = {
'LaunchRequest': function() {
this.emit('PlayStream');
},
'PlayStream': function() {
let builder = new Alexa.templateBuilders.BodyTemplate1Builder();
let template = builder.setTitle('Test Title')
.setBackgroundImage(makeImage('https://link_to_my_image.png'))
.setTextContent(makePlainText('Test Text'))
.build();
this.response.speak('OK.').
audioPlayerPlay(
'REPLACE_ALL',
stream.url,
stream.url,
null,
0)
.renderTemplate(template);
this.emit(':responseReady');
}
{
"type": "AudioPlayer.Play",
"playBehavior": "valid playBehavior value such as ENQUEUE",
"audioItem": {
"stream": {
"url": "https://url-of-the-stream-to-play",
"token": "opaque token representing this stream",
"expectedPreviousToken": "opaque token representing the previous stream",
"offsetInMilliseconds": 0
},
"metadata": {
"title": "title of the track to display",
"subtitle": "subtitle of the track to display",
"art": {
"sources": [
{
"url": "https://url-of-the-album-art-image.png"
}
]
},
"backgroundImage": {
"sources": [
{
"url": "https://url-of-the-background-image.png"
}
]
}
}
}
}
"metadata": {
"title": "title of the track to display",
"subtitle": "subtitle of the track to display",
"art": {
"sources": [
{
"url": "https://url-of-the-album-art-image.png"
}
]
},
audioPlayerPlay(
'REPLACE_ALL',
streamInfo.url,
streamInfo.url,
null,
0)
.renderTemplate(template);
.renderTemplate(template);
部分,因为它只会在“正在播放”屏幕加载之前短暂闪烁。
var metadata = {
title: "title of the track to display",
subtitle: "subtitle of the track to display",
art: {
sources: {
url: "https://url-of-the-album-art-image.png"
}
}
};
audioPlayerPlay(
'REPLACE_ALL',
stream.url,
stream.url,
null,
0,
metadata)
.renderTemplate(template);
audioPlayerPlay(behavior, url, token, expectedPreviousToken, offsetInMilliseconds, metadata) {
const audioPlayerDirective = {
type : DIRECTIVE_TYPES.AUDIOPLAYER.PLAY,
playBehavior: behavior,
audioItem: {
stream: {
url: url,
token: token,
expectedPreviousToken: expectedPreviousToken,
offsetInMilliseconds: offsetInMilliseconds,
metadata : metadata
}
}
};
this._addDirective(audioPlayerDirective);
return this;
}
最佳答案
由于某种原因,Echo Show 没有实时更新,需要重新启动才能显示元数据变量中传递的任何内容,这就是我没有看到任何结果的原因。
简单地传递一个变量就可以了。我只需要找出为什么内容会卡在“正在播放”屏幕上并需要重新启动才能工作。
var "metadata": {
"title": "title of the track to display",
"subtitle": "subtitle of the track to display",
"art": {
"sources": [
{
"url": "https://url-of-the-album-art-image.png"
}
]
},
关于alexa-skills-kit - alexa - audioPlayer.Play 问题在 Echo Show Now Playing 屏幕上显示内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50622919/
遇到 now() 在 Postgres 中的函数中使用时的行为与“now”不同的问题。 drop table if exists test_date_bug; CREATE TABLE test_da
Google 刚刚发布了一项名为 Now on Tap 的 Google Now 新功能。它使用户能够从不同的应用程序 (The Verge video example) 获得上下文帮助。 是否只是截
performance.now() 和 Date.now() 有什么区别? 我是否应该将 performance.now() 视为 Date.now() 的替代品,因为 performace.now(
需要了解为什么我会得到时差。 这是我的 VBA 代码: Public OHLCArray(1 To 481, 0 To 28, 0 To 3) As Single 'debug stm
假设: rAF now时间是在所有回调集被触发时计算的。因此,在调用该帧的第一个回调之前发生的任何阻塞都不会影响 rAF now它是准确的——至少对于第一次回调来说是这样。 在触发 rAF 集之前进行
在我的程序中,每个表都有一列 last_modified: last_modified int8 DEFAULT (date_part('epoch'::text, now()::timestamp)
这是 Form1 中的代码: private DateTime dt; [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLa
什么时候应该使用 django 的 timezone.now() 以及什么时候应该使用 python 的 datetime.datetime.now()。 例如,在下面的 INSERT 中哪个更有意义
我正在将我的项目从 Django 1.8.2 升级到 1.9.7,我收到了这个警告: WARNINGS: my_app.my_model.date_available: (fields.W161) F
我应该在我的 Rails 应用程序中使用两者中的哪一个: DateTime.now or Time.now 在应用程序中同时使用两者有什么坏处吗? 在上述 (now) 示例中,两者之间是否存在任何差异
这个问题已经有答案了: Date vs new Date in JavaScript (8 个回答) 已关闭 6 年前。 我更多地谈论添加“new”如何影响变量,为什么/何时使用它,以及为什么我在打印
// Data-Bind is Here // Data-Bind is Here Show
我想做一个查询来检查今天是否有值,如果没有,则显示今天之前最近的条目。 这是我使用的查询: $variable = 'var1'; SELECT * FROM `table` WHERE `somet
我有一个表,其中有一列 event_time。如何选择 NOW() 之前的两行和 NOW() 之后的下一行,按 event_time 排序? 单个查询是否可行? 最佳答案 怎么样 SELECT * F
我如何向 Google Now 提供我的信息或我的应用程序数据卡片?有没有我可以使用的 API? 最佳答案 Google Now API 仅提供给在 Google 注册其应用程序的用户,它一直是私有(
...当我尝试执行如下所示的查询时: Session().query(MyMappedClass).update({MyMappedClass.time:func.now()}) 我得到: Inval
我试图了解 time.Now() 和 time.Now().Local() 之间的区别。我首先在我的笔记本电脑上打印它们(运行 Ubuntu 18.04): fmt.Println(time.Now(
假设我有一个包含三个字段的数据库表:id、内容和时间戳。 全天都会收到参赛作品,因此会有大量参赛作品,并且仍会定期收到参赛作品。 当访问者查看将显示条目的网页时,该页面将显示最近的 10 个条目以及访
我对夏令时处理有点困惑 设置.py: TIME_ZONE = 'Europe/London' USE_TZ = True 在 django shell 中: >>> from django.utils
我正在使用 node.js 和 now.js。一切正常。但我想制作一个可以从命令行运行的简单客户端(因此无需浏览器)。 http://nowjs.com/doc/example 在示例中,提供了一个
我是一名优秀的程序员,十分优秀!