iT邦幫忙

2019 iT 邦幫忙鐵人賽

DAY 22
0
AI & Data

Voice App 開發實務:使用Diagflow+firebase開發Google home App (google assistant action)系列 第 22

actions-on-google 建置 Google Home App #21 Media Object : 播放 audio..

播歌,應該是擺了智慧音箱之後,除了找我的手機以外的最常用功能了吧。

https://github.com/actions-on-google/dialogflow-conversation-components-nodejs

app.intent('media response', (conv) => {
  if (!conv.hasAudioPlayback) {
    conv.ask('Sorry, this device does not support audio playback.');
    return;
  }
  conv.ask('This is the first simple response for a media response');
  conv.ask(new MediaObject({
    name: 'Jazz in Paris',
    url: 'http://storage.googleapis.com/automotive-media/Jazz_In_Paris.mp3',
    description: 'A funky Jazz tune',
    icon: new Image({
      url: 'http://storage.googleapis.com/automotive-media/album_art.jpg',
      alt: 'Media icon',
    }),
  }));
});

像這樣去倒mediaObject就可以了。


上一篇
actions-on-google 建置 Google Home App #20 Permission: name ; locations
下一篇
actions-on-google 建置 Google Home App #22 notifications 主動推播
系列文
Voice App 開發實務:使用Diagflow+firebase開發Google home App (google assistant action)31
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言