smart-mirror icon indicating copy to clipboard operation
smart-mirror copied to clipboard

Integrating a streaming service

Open SenadM opened this issue 10 years ago • 17 comments

Could be Spotify, Apple music etc,

"Play the top ten list" "Play this song"

Etc. It could be great.

SenadM avatar Feb 04 '16 23:02 SenadM

I'd rather have the mirror integrate with some kind of speaker thing thank have it play music itself. Something like Sonos or Chromecast maybe?

evancohen avatar Feb 05 '16 02:02 evancohen

I thought the same thing. If the board could connect wirelessly through bluetooth to a bluetooth enabled speaker, it could be phenomenal. "Play insert song name here" and bam... thoughts? "Now playing *insert song/playlist/album name here" could be displayed somewhere on the mirror.

StevenTLBF avatar Feb 05 '16 20:02 StevenTLBF

@StevenTLBF totally agreed (although dealing with Bluetooth would be a bit of a pain). If you want to take a stab at it let me know. With a slight modification I could modify the YouTube functionality to also play music and just use the 3.5mm aux out on the pi, but I think some kind of streaming solution would be better.

evancohen avatar Feb 05 '16 20:02 evancohen

@evancohen the youtube idea is also good, but I think you would have a problem playing playlists? I don't want to search a new song every time the last one finishes, so playlists are the way to go, I think.

SenadM avatar Feb 05 '16 23:02 SenadM

@SenadM not necessarily... The YouTube API does let you search for playlists and the iFrame in which the YouTube video is embedded fires a onPlayerStateChange event so you could queue up the next video once one is finished. This is all in theory of course... But if that works you could have "play next track" and/or "skip track" commands.

There is also message posting to the iFrame that you could use to play/pause the video...

iframe.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');

I haven't tried it yet, but it should work :shipit:

evancohen avatar Feb 06 '16 02:02 evancohen

Well if it is possible to search for playlists also, then Youtube would be a great start as you already did implement it. And later, maybe other developers could add other alternatives. But I think, as many others, that youtube isn't the most optimal choice for listening to music, as f.x. spotify.

Here's a start

https://developer.spotify.com/web-api/

SenadM avatar Feb 06 '16 13:02 SenadM

:+1: for sonos integration :)

chr1s1 avatar Mar 24 '16 12:03 chr1s1

spotify isn't optimal to work with atm... the api isn't 'good' enough to work with (play songs etc.)... it mostly supports data fetching, not 'controlling' spotify. Maybe someone has a hacky way to get it to work but it is definitely not normally supported right now

jaaplallie avatar Mar 24 '16 16:03 jaaplallie

Yeah, there really isn't a good way to do Spotify. SoundCloud works pretty well thoigh. Both YouTube and SoundCloud are on the search branch (which is now horribly out of date). It's probubly worth the time to rewrite. Maybe I can look at doing that tonight.

evancohen avatar Mar 24 '16 17:03 evancohen

@SenadM is the soundcloud and youtube integration enough for you? Or do you see another possible integration point?

kurtdb avatar May 31 '16 09:05 kurtdb

@chr1s1 It seems that you can get Sonos (and Chromecast!) integration with PulseAudio, which is already a dependency of the mirror: https://github.com/masmu/pulseaudio-dlna/issues/32

I'm going to add https://github.com/masmu/pulseaudio-dlna to the smart-mirror documentation because that is totally awesome.

evancohen avatar May 31 '16 12:05 evancohen

Awesome! Thanks a lot! @evancohen

chr1s1 avatar May 31 '16 12:05 chr1s1

pandora.... would be awesome!!

justbill2020 avatar Nov 08 '16 16:11 justbill2020

@evancohen should this be labeled as outdated? this would require pulseaudio which we've found causes issues with smart-mirror...

justbill2020 avatar Nov 22 '16 07:11 justbill2020

Yeah, this is a bit out of date. It would be nice to support this functionality at some point, but it won't be via PulseAudio. There may be some Node libs that we can look at for DLNA streaming.

evancohen avatar Nov 23 '16 22:11 evancohen

i'm going to leave it... i don't think anyone will install pulseaudio based on this issue...

justbill2020 avatar Nov 23 '16 22:11 justbill2020

Migrated to http://feathub.com/evancohen/smart-mirror/+13

Issue will be closed and tracked on feathub moving forward. Please refer to feathub for all future comments on this suggestion.

justbill2020 avatar Nov 27 '16 04:11 justbill2020