使用Media Player
使MediaResponse
变得简单。
Google自动处理:play
,pause
,stop
,resume
。
由于Google还不支持next
函数,因此我创建了custom Next Intent
来处理next
函数。
在talk to Dr. Media
然后go
之后,我有2个案例使我感到困惑:
MediaResponse
正确显示,尚未播放(尚未点击“播放”按钮)。
案例1 -然后我说next
(或next song
),它与我的自定义意图与我定义的短语匹配。并且Next function
可以。
案例2 -我点击“播放”按钮以播放音频,然后我说next
(或next song
),它与我定义的词组不匹配(通常会说Okay
却什么也没有发生),因此Next function
不合适。 (如下图所示)
在第2种情况下,播放Media Player时如何捕捉我的短语next
,next song
,play next
...? (换句话说,这些短语无法触发我的自定义意图)
请帮助我,谢谢
p / s:发生在手机上
actions_intent_NEXT.json
{
"id": "01055a59-26a0-4f39-a770-6bc5404482d9",
"name": "actions_intent_NEXT",
"auto": true,
"contexts": [
"actions_capability_screen_output",
"actions_capability_media_response_audio"
],
"responses": [
{
"resetContexts": false,
"affectedContexts": [
{
"name": "actions_capability_screen_output",
"parameters": {},
"lifespan": 5
},
{
"name": "actions_capability_media_response_audio",
"parameters": {},
"lifespan": 5
}
],
"parameters": [
{
"id": "2ce8514c-a346-4251-9a35-cab32d2c9d7c",
"required": false,
"dataType": "@nextPlay",
"name": "nextPlay",
"value": "$nextPlay",
"isList": false
}
],
"messages": [
{
"type": 0,
"speech": []
}
],
"defaultResponsePlatforms": {},
"speech": []
}
],
"priority": 500000,
"cortanaCommand": {
"navigateOrService": "NAVIGATE",
"target": ""
},
"webhookUsed": true,
"webhookForSlotFilling": false,
"lastUpdate": 1542252675,
"fallbackIntent": false,
"events": [
{
"name": "actions_intent_NEXT"
}
],
"userSays": [
{
"id": "e28a4087-2bf9-494d-9790-c7347f870ee4",
"data": [
{
"text": "next song",
"alias": "nextPlay",
"meta": "@nextPlay",
"userDefined": true
}
],
"isTemplate": false,
"count": 0,
"updated": 1542249008,
"isAuto": false
},
{
"id": "7a8cf2a2-d131-490d-977d-1212f4642f52",
"data": [
{
"text": "next",
"alias": "nextPlay",
"meta": "@nextPlay",
"userDefined": true
}
],
"isTemplate": false,
"count": 0,
"updated": 1542248700,
"isAuto": false
}
],
"followUpIntents": [],
"liveAgentHandoff": false,
"endInteraction": false,
"templates": []
}