Giter Site home page Giter Site logo

vbaicu / mmusiccast Goto Github PK

View Code? Open in Web Editor NEW
169.0 13.0 26.0 13.59 MB

Chromecast emulator that works on any platform. Stream videos from youtube to raspberry pi or any computer with the chromecast protocol.

License: Creative Commons Zero v1.0 Universal

JavaScript 96.08% CSS 1.07% HTML 2.85%
youtube chromecast cast emulator chromecastemulator electron streaming-video streaming-audio music mmusic

mmusiccast's Introduction

mMusicCast

This project is discontinued.

To run this project some changes might be required, due to the deprecation of used modules

Pull requests are welcomed if anybody whishes to maintain the project.

Simple chromecast emulator wriiten in javascript on top of electron.

Supported applications:

  • Youtube - all platforms
  • Spotify - Spotify connect using librespot (requires premium subscription and unix based os)

Currently Spotify playback doesn't give any feedback in the UI. For a future release I plan to display what is playing and add controls.

Platforms:

  • macOS
  • linux
  • Windows
  • raspberryPi

Install & run

  • npm install
  • npm start

Open Youtube or Spotify app on your phone and enjoy streaming ;)

mmusiccast's People

Contributors

vbaicu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mmusiccast's Issues

Still working on osx?

First of all thanks a lot for your great work :-) The emulator works perfectly on my Raspberry Pi 4. However, I cannot see the cast from within Spotify on my phone when running it on osx (macOS Sierra), which is perfectly possible on the Raspi 4. Any idea what could be the problem? There are no errors issued.

Load a custom receiver from localhost

Hi there,

I stumbled upon your Electron cast implementation while looking for ways to circumvent the need to an actual casting device. I was wondering if you could spare me some time by seeing if my use-case could be supported..

I have a custom receiver application can serve itself on localhost:3001. I have a web app which implements the sender framework, and which will be sending a cast application ID over to load in the correct connected receiver app.

If I run your code as-is, I do see an mMusicCast entry show up under the available devices, but it says "Source not supported".

Do you think I could get it to work? Any pointers on doing so?

Any help is greatly appreciated! Thank you for your time.

Is there any documentation as to how the code works?

Hi, I'm wondering if there is any explanation of how the code works and how to add new apps?

I am really interested by this project, and depending on how adding apps is done, I might fork it to add new features (Google Photos, stuff like that).

Is there an explanation somewhere as to how it works?

Won't start (open media vault)

So I think a lot of the problems I am having comes from the fact the OMV is a terrible build of Debian that is missing many packages that people assume you already have installed but now after spending a half hour trying to install mMusicCast it won't start and exists saying:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: electron .
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2018-06-13T20_58_31_035Z-debug.log
root@HP-Plex:~/mMusicCast# npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: electron .
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I assume I am missing some dependency required to start mMC but I don't know what

White window on raspberry pi (raspbian)

Hello.

Issue:
When I do the npm install and npm start on latest raspbian (nov 2018), I only get white window. The youtube app on android does detect "mMusicCast" TV.

Background:
I tested mMusicCast on my ubuntu 18.04 and it does work (after apt get install libcfong-2-4). I can play videos from my android via youtube app.

Today I installed latest raspbian on raspberry pi 2 B.
After installing npm (sudo apt install npm) I had to update npm via npm (sudo npm install -g npm) I was able to install mMusicCast (npm install mmusiccast).

After staring, the mMusicCast window appears but it only displays white content. The android youtube app does detect it, but it never connects.

pi@raspberrypi:~/git/mMusicCast $ npm start

> [email protected] start /home/pi/git/mMusicCast
> electron .

morgan deprecated undefined format: specify a format server.js:36:9
morgan deprecated default format: use combined format server.js:36:9
body-parser deprecated bodyParser: use individual json/urlencoded middlewares server.js:37:9
body-parser deprecated undefined extended: provide extended option node_modules/body-parser/index.js:105:29
164.8.19.75
Registered App: ChromeCast
Registered App: YouTube
Express server listening on port 8008
::ffff:164.8.19.65 - - [Fri, 08 Mar 2019 11:46:52 GMT] "GET /ssdp/device-desc.xml HTTP/1.1" 200 1079 "-" "com.google.android.youtube/13.48.51(Linux; U; Android 8.1.0; sl_SI; Nokia 6.1 Build/OPR1.170623.026) gzip"
::ffff:164.8.19.65 - - [Fri, 08 Mar 2019 11:46:52 GMT] "GET /apps/YouTube HTTP/1.1" 200 531 "-" "com.google.android.youtube/13.48.51(Linux; U; Android 8.1.0; sl_SI; Nokia 6.1 Build/OPR1.170623.026) gzip"
::ffff:164.8.19.65 - - [Fri, 08 Mar 2019 11:47:01 GMT] "GET /apps/YouTube HTTP/1.1" 200 531 "-" "com.google.android.youtube/13.48.51(Linux; U; Android 8.1.0; sl_SI; Nokia 6.1 Build/OPR1.170623.026) gzip"
express deprecated res.send(status, body): Use res.status(status).send(body) instead apps/app.js:159:7
::ffff:164.8.19.65 - - [Fri, 08 Mar 2019 11:47:01 GMT] "POST /apps/YouTube HTTP/1.1" 201 0 "-" "com.google.android.youtube/13.48.51(Linux; U; Android 8.1.0; sl_SI; Nokia 6.1 Build/OPR1.170623.026) gzip"

What I am missing?

Since project states raspberry is supported, can someone write gude?

Unable to Find While on Desktop

Hi, thank you for creating this great tool! I was having some issues getting my phone to find mMusicCast on my Windows Desktop. It doesn't show up on the YouTube app as a possible streaming device. I tested to see if it was just my phone, but it was able to find a Chromecast. I also got the following errors:

Thu, 24 May 2018 15:51:06 GMT morgan deprecated undefined format: specify a format at server.js:34:9
Thu, 24 May 2018 15:51:06 GMT morgan deprecated default format: use combined format at server.js:34:9
Thu, 24 May 2018 15:51:06 GMT body-parser deprecated bodyParser: use individual json/urlencoded middlewares at server.js:35:9
Thu, 24 May 2018 15:51:06 GMT body-parser deprecated undefined extended: provide extended option at node_modules\body-parser\index.js:105:29

Do you know what the issue is? Thank you so much!

mMusicCast still working?

Hi guys
I had a test for mMusicCast on my Ubuntu18.04 or window10 but it did not work anymore.
1, $ npm start and i can see a little console open up sign a logo named "mMusic cast"
2, though my mobile phone YouTube and i found cast button and select connect to mMusic Cast
3, mMusic Cast can see YouTube main page
4, When i want to play a video, mMusic Cast did not play anymore and just stay on what i can see is the YouTube show me "正在mMusic Cast 播放"(i am chinese...) and keep that all the time until broken out.

Cannot see the casting device

Hello,
I would like to say that I've almost got it run on
Linux orangepipc 3.4.113-sun8i #344 SMP PREEMPT Fri Jul 5 18:19:43 CEST 2019 armv7l armv7l armv7l GNU/Linux

I had the same problem as guy with Raspberry Pi and white screen. It's caused by the version of node and electron. So I manually installed latest electron and node and app started successfully.
BUT
I cannot cast into the device where this server is running. My Android phone's Youtube app doesn't show the cast device.

Any advice ?

Screenshot_2020-05-04_01-07-00

Thanks for reply

galaxy s9 does not see app but app sees galaxy

when run the app on my Ubuntu 18.04.2 computer I get the following output

[email protected] start /home/zany130/Downloads/mMusicCast-master
electron .

morgan deprecated undefined format: specify a format server.js:36:9
morgan deprecated default format: use combined format server.js:36:9
body-parser deprecated bodyParser: use individual json/urlencoded middlewares server.js:37:9
body-parser deprecated undefined extended: provide extended option node_modules/body-parser/index.js:105:29
192.168.10.197
Registered App: ChromeCast
Registered App: YouTube
Express server listening on port 8008
::ffff:192.168.10.183 - - [Thu, 11 Apr 2019 22:04:35 GMT] "GET /ssdp/device-desc.xml HTTP/1.1" 200 1082 "-" "com.google.android.youtube/14.14.51(Linux; U; Android 9; en_US; SM-G960U Build/PPR1.180610.011) gzip"
::ffff:192.168.10.183 - - [Thu, 11 Apr 2019 22:04:36 GMT] "GET /apps/YouTube HTTP/1.1" 200 531 "-" "com.google.android.youtube/14.14.51(Linux; U; Android 9; en_US; SM-G960U Build/PPR1.180610.011) gzip"
::ffff:192.168.10.183 - - [Thu, 11 Apr 2019 22:04:46 GMT] "GET /apps/YouTube HTTP/1.1" 200 531 "-" "com.google.android.youtube/14.14.51(Linux; U; Android 9; en_US; SM-G960U Build/PPR1.180610.011) gzip"
::ffff:192.168.10.183 - - [Thu, 11 Apr 2019 22:04:56 GMT] "GET /apps/YouTube HTTP/1.1" 200 531 "-" "com.google.android.youtube/14.14.51(Linux; U; Android 9; en_US; SM-G960U Build/PPR1.180610.011) gzip"
::ffff:192.168.10.183 - - [Thu, 11 Apr 2019 22:05:06 GMT] "GET /apps/YouTube HTTP/1.1" 200 531 "-" "com.google.android.youtube/14.14.51(Linux; U; Android 9; en_US; SM-G960U Build/PPR1.180610.011) gzip"
::ffff:192.168.10.183 - - [Thu, 11 Apr 2019 22:05:16 GMT] "GET /apps/YouTube HTTP/1.1" 200 531 "-" "com.google.android.youtube/14.14.51(Linux; U; Android 9; en_US; SM-G960U Build/PPR1.180610.011) gzip"
::ffff:192.168.10.183 - - [Thu, 11 Apr 2019 22:05:26 GMT] "GET /apps/YouTube HTTP/1.1" 200 531 "-" "com.google.android.youtube/14.14.51(Linux; U; Android 9; en_US; SM-G960U Build/PPR1.180610.011) gzip"
::ffff:192.168.10.183 - - [Thu, 11 Apr 2019 22:05:36 GMT] "GET /apps/YouTube HTTP/1.1" 200 531 "-" "com.google.android.youtube/14.14.51(Linux; U; Android 9; en_US; SM-G960U Build/PPR1.180610.011) gzip"

Can't install Debian x64 (open media vault

npm WARN package.json [email protected] No repository field.
npm WARN deprecated [email protected]: Use uuid module instead
npm WARN engine [email protected]: wanted: {"node":">= 4.0"} (current: {"node":"0 .10.29","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=0.10.32"} (current: {"node":"0.1 0.29","npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">=4"} (current: {"node":"0.10.29"," npm":"1.4.21"})
npm WARN engine [email protected]: wanted: {"node":">= 0.12"} (current: {"node":"0 .10.29","npm":"1.4.21"})

[email protected] install /root/mMusicCast/node_modules/websocket
(node-gyp rebuild 2> builderror.log) || (exit 0)

npm ERR! Error: Method Not Allowed
npm ERR! at errorResponse (/usr/share/npm/lib/cache/add-named.js:260:10)
npm ERR! at /usr/share/npm/lib/cache/add-named.js:203:12
npm ERR! at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.j s:167:7)
npm ERR! at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this entire log,
npm ERR! including the npm and node versions, at:
npm ERR! http://github.com/npm/npm/issues

npm ERR! System Linux 4.9.0-0.bpo.5-amd64
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /root/mMusicCast
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code E405
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /root/mMusicCast/npm-debug.log
npm ERR! not ok code 0

Video quality limited to 480p

Hi, thanks for making this app ... I find it really useful. But the video on YT is limited to 480p no matter what video I play.

Is this a chromecast v1 limitiation or is there some tweaks I can make to make it work 1080p?

Here's the video quality options I have:

image

Please make a headless option

I'm getting an error when I try to install, I think it is because I run headless, not sure though.
Here is the error:
npm start

> [email protected] start /home/pi/mMusicCast
> electron .

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `electron .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pi/.npm/_logs/2020-08-09T18_02_55_393Z-debug.log

and /home/pi/.npm/_logs/2020-08-09T18_02_55_393Z-debug.log:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/home/pi/.nvm/versions/node/v14.7.0/bin/node',
1 verbose cli   '/home/pi/.nvm/versions/node/v14.7.0/bin/npm',
1 verbose cli   'start'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: /home/pi/.nvm/versions/node/v14.7.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/pi/mMusicCast/node_modules/.bin:/home/pi/.nvm/versions/node/v14.7.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
9 verbose lifecycle [email protected]~start: CWD: /home/pi/mMusicCast
10 silly lifecycle [email protected]~start: Args: [ '-c', 'electron .' ]
11 silly lifecycle [email protected]~start: Returned: code: 1  signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `electron .`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/home/pi/.nvm/versions/node/v14.7.0/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:314:20)
13 verbose stack     at ChildProcess.<anonymous> (/home/pi/.nvm/versions/node/v14.7.0/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:314:20)
13 verbose stack     at maybeClose (internal/child_process.js:1051:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)
14 verbose pkgid [email protected]
15 verbose cwd /home/pi/mMusicCast
16 verbose Linux 4.19.75-v7+
17 verbose argv "/home/pi/.nvm/versions/node/v14.7.0/bin/node" "/home/pi/.nvm/versions/node/v14.7.0/bin/npm" "start"
18 verbose node v14.7.0
19 verbose npm  v6.14.7
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: `electron .`
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

Spotify support?

Hi there,

any news on the integration of Spotify into this project?
Would be an awesome feature - please tell me if I can assist :)

Is this still working?

I ran the server but the cast button did not appear on my Android phone.

Also, the server seems to be serving on port 8008 not 8080. Is this a typo?

Getting an error on MacOs 15

Uncaught Exception:
Error: Unexpected server response: 404
at ClientRequest._req.on (/Users/peter/Desktop/scrpy-with-audio/mMusicCast-master/node_modules/ws/lib/websocket.js:641:21)
at emitOne (events.js:115:13)
at ClientRequest.emit (events.js:210:7)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:565:21)
at HTTPParser.parserOnHeadersComplete (_http_common.js:116:23)
at Socket.socketOnData (_http_client.js:454:20)
at emitOne (events.js:115:13)
at Socket.emit (events.js:210:7)
at addChunk (_stream_readable.js:252:12)
at readableAddChunk (_stream_readable.js:239:11)

How do I install it on pi4?

How do I install it on pi4?
I am a new user of linux and would love for someone to write a guide ..
Thanks.

Is this a hack?

I've been waiting very long for something like this to happen, but I always thought it was not possible to create a custom chromecast receiver and that Google locked down the API to prevent people from creating competing products.

I also thought that's why PiCAST does not act like a real chromecast, or why cheapcast had to stop.

But you did it, which leads me to the question: Is this a hack? Or was the API never locked down as I assumed?

Another question that comes to mind is: Why does it not automatically support all apps that chromecast supports, or, why do you have to support each app on its own? Isn't chromecast just a platform where apps can run their "receiver app" on? Or does google have to update their chromecast devices for every new app it supports?

I'd really like to find out more about how all of this works and what's the current situation. Do you mind to give me a short enlightenment on this?

If not, big big thanks to you anyway, as this is a huge step towards an open chromecast platform :)

failed to install on raspberry pi raspbian stretch 4.4

(edited version):

after installing the latest npm version i was able to "npm install" it.
but when i "npm start" i get this error (see further below).

so i assume i need raspbian DESKTOP / x11 to make this work ? is there no other option (without DESKTOP/x11) ?

pi@retropie:~/mmusiccast $ npm start

[email protected] start /home/pi/mmusiccast
electron .

/home/pi/mmusiccast/node_modules/electron/dist/electron: error while loading shared libraries: libgtk-x11-2.0.so.0: cannot open shared object file: No such file or directory
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] start: electron .
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2019-01-18T10_00_38_713Z-debug.log
pi@retropie:~/mmusiccast $

Cast icon does not appear in YT app

When I launch npm start and then run the YouTube app on my phone, I see the HTTP request being served, but the Cast icon does not appear in the YouTube app. Have Google moved the goalposts again?

::ffff:10.0.0.129 - - [Mon, 16 Dec 2019 15:45:17 GMT] "GET /apps/YouTube HTTP/1.1" 200 531 "-" "com.google.android.youtube/14.49.51(Linux; U; Android 9; en_GB; ONEPLUS A5010 Build/PKQ1.180716.001) gzip"

I'm using Ubuntu 18.04 so NodeJS is v8.10.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.