How to get the same search results from SDK as in mobile application? - google-assistant-sdk

I'm using Google Assistant SDK and I run this sample code. I'm able to interact with the Assistant and I get responses. For a query Play me hip hop on Spotify as a result I get a response with HTML with a link to a Hip Hop Hits playlist from Spotify. However, the result is completely different from what I get in the Google Assistant on the mobile application.
I would like to get the same playlist from SDK as I get on the mobile application.
In the documentation I found that exist DeviceLocation parameters. I tried to set coordinates for Warsaw, London, and LA as in the following code. This didn't affect the result and I always get the same playlist.
device_location=embedded_assistant_pb2.DeviceLocation(
coordinates=latlng_pb2.LatLng(
#latitude=52.196217,#Warsaw
#longitude=21.178225,#Warsaw
#latitude=51.509865,#London
#longitude=-0.118092,#London
latitude=34.052235,#LA
longitude=-118.243683,#LA
),
),
How can I get the same result from SDK as I get in the mobile application for query Play me hip hop on Spotify?

There is no way to just use the SDK to get capabilities like Spotify to play directly on the device. You would need to handle that in a custom way on your device using Spotify's service or some other music provider.

Related

Is it possible to integrate Google Assistant with my custom app?

I would like to integrate Google assistant inside my app. The idea is that I have a app which provides various press services, like giving latest news and such. I would like to integrate Google assistant for handling some particular requests. For example the user may ask, "what did the Lakers yesterday?" If i search this on Google or ask to the assistant, i will get a card with the score of yesterday's game. I would like, from inside my app, to replicate this interaction, that is sending the request to Google assistant and showing the answer that Google return to the user (or at least opening Google assistant with the answer)
Is such a thing possible?
I was looking at Google Assistant service sdk (https://developers.google.com/assistant/sdk/guides/service/python/) and it says:
The Google Assistant Service gives you full control over the integration with the Assistant by providing a streaming endpoint. Stream a user audio query to this endpoint to receive a Google Assistant audio response.
Is this possible only with audio interaction? I'm not quite certain this is the solution I should look into
The Google Assistant SDK Service allows you to send both audio or text to the Assistant and you'll get back responses including audio, display text, and rich HTML visual content.
For mobile apps, there's less support compared to Python, but it's still doable. For example, there's a version of the SDK for Android Things, which means for IoT devices like a Raspberry Pi. You can go through this project and remove all the IoT references, but it's something you'd need to do yourself.

Change the default music player in google assistant sdk

Is there a way to change the default music player in the google assistant sdk. Should I try using IFTTT or is there a better way? For refernce I am running it on a raspberry pi 3.
According to a teardown of the latest Google Home app apk, devices using the Google Home SDK will soon be able to be controled via the Google Home app.
Untill that's released however, and I know it's a mouthful, you can say
Cast song by artist from music provider to chromecast name
For example
Cast Creep by Radiohead from Google Play Music to The Living Room Chromecast

Is there an API for sending Youtube links to the Youtube applications on Tivo/Smart TVs?

I'm having trouble finding documentation on Youtube's developer website whether there is an API for "Youtube for Devices" to send videos to set top boxes like the newer Tivos and similar players.
There is a feature in the Android app that allows a Youtube video to be played via the Tivo when you hit a button, similar to Chromecast.
I thought it might share an API with Chromecast in some way, but I tried the Chromecast extension on Google Chrome for Windows and it failed to detect the Tivo.
Is there an API for this, or is it a proprietary feature of the Youtube app?

how to ensure that a youtube API response only contains videos that are suitable for playback on a mobile device

I am trying to add some youtube videos from my Admin page to database. So that mobile application can make use of them to play.
I want to filter the result from YouTube API link so that i can make sure that whatever videos i add to the database will be able to play on mobile devices like IOS and Android.
I tried
&format=5 and &format=1
but no use.
I also went through Youtube API v2.0 Docs but unable to find the correct way to assign fields parameter to my query string
can anyone guide me to fix this?
What you need is videoEmbeddable and videoSyndicated.
Here's my answer to original question: retrive only mobile-supported video from YouTube API

Google Play Web Video Player API

Is there an API for the Google Play online video playback of content? Would the YouTube API work?
I am wanting to embed Google Play content into a website I am building.
Thank you,
Joseph Irvine
Google Play movie purchases and rentals do also show up as YouTube videos (with a unique YouTube video ID), and so it is possible; obviously, you'd need to use oAuth2 authentication so when a user logs in, YouTube can verify that the user has the permission to see that film/TV show.
The real trick, however, is getting the right YouTube ID. They show up through search results via the search endpoint (so, for example, https://www.googleapis.com/youtube/v3/search?part=snippet&q=Monsters+University&key={YOUR_API_KEY} would be such a search), but that endpoint only gives you access to the "snippet" content type, which doesn't include the parameter "licensedContent" to let you know if it's a for-pay video (that parameter is found in the "contentDetails" type, which is only available from a video list call).

Resources