This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

Youtube playback
#1
Hello, I'd like to ask if there's a possibility of amati.linea playing youtube videos as it's doing with soundcloud. I'm referring to this example tutorial:
http://openrb.com/stream-soundcloud-song...sh-button/

Thank you very much for any response.
Reply
#2
Hi
I'm using Chromecast and HDMI to optical converter. Works perfect.
BR
Reply
#3
We have Spotify Connect support coming soon, but it will require Spotify premium account
Reply
#4
(08.08.2017, 12:55)admin Wrote: We have Spotify Connect support coming soon, but it will require Spotify premium account

Any update concerning Spotify Connect ?
Reply
#5
Spotify Connect is already supported. We are doing some tests and will release the firmware soon on our website. Please note that you need Premium subscription in order to work. I'll send you a test firmware to email to try it out Wink
Reply
#6
(05.02.2018, 08:02)edgars Wrote: Spotify Connect is already supported. We are doing some tests and will release the firmware soon on our website. Please note that you need Premium subscription in order to work. I'll send you a test firmware to email to try it out Wink

Can you send me that firmware to email CEST189@gmail.com?
Thanks
Reply
#7
Try this image:
http://dl.openrb.com/audio/imx28-20180313.img
Reply
#8
[attachment=821 Wrote:admin pid='7741' dateline='1521125084']Try this image:
http://dl.openrb.com/audio/imx28-20180313.img


Thank you,
But i update to my device " ERROR" .
look pic.


Attached Files Image(s)
       
Reply
#9
Looks like you have older hardware which is not supported anymore.
Reply
#10
(16.03.2018, 08:18)admin Wrote: Looks like you have older hardware which is not supported anymore.

Help me, pls

thanks
Reply
#11
Hi!

Any new with spotify connect?

I´ll try to integrate with Spotify developer but I cant´t get new token. (token expire in 1 hour)

I´ve tried to get token with this but i can´t:

https://developer.spotify.com/documentat...tials-flow

Code:
local headers_token = {
    ['Authorization'] = "Basic "..Id_Psw_Encode64,   
  }
function Data_Pedir_Token ()
  url = "https://accounts.spotify.com/api/token"
  data = json.encode({
      ['grant_type'] = "client_credentials",
    }) 
  --log(data,url)
  return data, url
end

function Comando_token (data,url)

  headers = headers_token
  url = url
res, err = dorequestPostSpoty(url, headers,"POST", data)
  log(res,err)
  resjson = json.decode(res)
  if resjson[1] == nil then
    return nil
  end 
  return resjson

end

function PedirToken ()
  local data,url = Data_Pedir_Token ()
  Comando_token(data,url)
end



PedirToken ()

If I get token manualy it works perfectly
Reply
#12
Hi
What do you mean? Spotify was implemented years ago Smile
BR
Reply
#13
(04.02.2020, 15:56)Daniel. Wrote: Hi
What do you mean? Spotify was implemented years ago Smile
BR

I don´t understand. How is implemented?
Reply
#14
Which fw do you have?

You need Spotify Premium account to be able to stream music to SP.
Reply
#15
(04.02.2020, 16:05)Daniel. Wrote: Which fw do you have?

You need Spotify Premium account to be able to stream music to SP.
I have 20191015 fw and I have spotify premium.
How can I stream music in LM?
Reply
#16
In LM you cant as it doesn't have speakers Wink You can stream to amati players. When you play music in spotify app you can select device and one of them will be amati or what name you given to it.
Reply
#17
Sorry I haven´t explained well, 

I don´t want to stream in LM.

I want to send an order from LM to spotify acount and spotify speakers/devices (play specific playlist, pause, get status...) and I can do it with manual token but it expires.
When I try to get token by script with this script I can´t do it.

Code:
local headers_token = {
    ['Authorization'] = "Basic "..Id_Psw_Encode64,   
  }
function Data_Pedir_Token ()
  url = "https://accounts.spotify.com/api/token"
  data = json.encode({
      ['grant_type'] = "client_credentials",
    }) 
  --log(data,url)
  return data, url
end

function Comando_token (data,url)

  headers = headers_token
  url = url
res, err = dorequestPostSpoty(url, headers,"POST", data)
  log(res,err)
  resjson = json.decode(res)
  if resjson[1] == nil then
    return nil
  end 
  return resjson

end

function PedirToken ()
  local data,url = Data_Pedir_Token ()
  Comando_token(data,url)
end



PedirToken ()

It is posible?
Reply
#18
OK, I completely misunderstood you as you posted it under Streaming Player category. Admin should look at it.
PS. I still don't know what is the use for that.
Reply
#19
While this can be implemented with manual copying of tokens this solution might stop working at any point. The problem is that OAuth is means for end-user apps with UI not for server-to-server communication (Spotify server-to-server API does not provide player control). You will need a script to refresh the token periodically as it has a short expiration time.

This example might be helpful. It's for different OAuth service but quite similar. You need to put refresh token into storage variable and use access token from storage in scripts that send API requests.
Code:
url = require('socket.url')
http = require('ssl.https')
ltn12 = require('ltn12')
json = require('json')

refresh_token = storage.get('oauth_refresh_token')
if not refresh_token then
  log('missing refresh_token')
  return
end

local function buildqs(chunks)
  local qs = {}
  for k, v in pairs(chunks) do
    qs[ #qs + 1 ] = url.escape(tostring(k)) .. '=' .. url.escape(tostring(v))
  end
  return table.concat(qs, '&')
end

payload = buildqs({
  grant_type = 'refresh_token',
  client_id = 'CLIENT_ID',
  client_secret = 'CLIENT_SECRET',
  refresh_token = refresh_token,
})

source = ltn12.source.string(payload)

headers = {
  ['content-length'] = tostring(#payload),
  ['content-type'] = 'application/x-www-form-urlencoded; charset=UTF-8',
}

sink, output = ltn12.sink.table()

local one, code, hdrs, status = http.request({
  url = 'ENDPOINT_URL',
  sink = sink,
  source = source,
  method = 'POST',
  headers = headers,
})

res = table.concat(output)

if code == 200 then
  res, err = json.pdecode(res)

  if type(res) == 'table' then
    storage.set('oauth_access_token', res.access_token)
    storage.set('oauth_refresh_token', res.refresh_token)
  else
    log('json decode failed', res, err)
  end
else
  log('error', code, res)
end
Reply


Forum Jump: