Code Monkey home page Code Monkey logo

Comments (9)

squarefrog avatar squarefrog commented on September 17, 2024 1

Yep you should be able to do that with GCDWebServer no problem at all!

One thing you may need to do is request multicast entitlements from Apple in order to discovery devices on your network, but that’s easy enough. Look at some of the other issues here and you might find a guide.

from cocoaupnp.

squarefrog avatar squarefrog commented on September 17, 2024 1

Thats great news, well done! If you'd like to write a guide, feel free to on the Wiki, although theres no expectation for you to do so.

from cocoaupnp.

squarefrog avatar squarefrog commented on September 17, 2024

I’m out on vacation at the moment so I can’t give you code level advice, but I think I can give you some pointers.

It’s been a while since I implemented this but UPnP works as follows:

  • first you set the metadata on the transport service
  • Next you send the play command to the transport service

that should get you up and running. I think the example project should give you guidance on that, although I’m not sure it compiles these days.

from cocoaupnp.

fareast555 avatar fareast555 commented on September 17, 2024

Hi @squarefrog Thanks for the quick reply. Appreciated!

Yeah, I did exactly that, but that only seems to work if it's a file hosted where I can just pass a url. The Media object and AVTRansport objects don't have any properties to wrap or deal with any kind of streaming data. There doesn't seem to be anything in the project that demos how one might stream a file on the local iOS device.

from cocoaupnp.

squarefrog avatar squarefrog commented on September 17, 2024

Ahh yes, that’s how UPnP works. You point a URL to a file and send that URL to the transport service. The renderer then fetches the data and plays it.

If you’re wanting to send a file, that’s trickier. You can use something like GCDWebServer to host the file from your phone, and send out that URL to your raspberry pi.

from cocoaupnp.

squarefrog avatar squarefrog commented on September 17, 2024

If it’s audio hosted in the music library itself, this is significantly more complicated and requires heavy workarounds like streaming the file to the documents directory, then serving that file up.

At that point I’d probably recommend you find an AirPlay compatible raspberry pi OS and use that as it will be significantly easier.

from cocoaupnp.

fareast555 avatar fareast555 commented on September 17, 2024

Yeah, the basic thing we wanted to do was take an mp3 from the apps file directory and pass it to the renderer on the pi.

Will take a look into GCDWebServer. If I can get something working, I'll give you a shout here. Thanks for the intel so far!

from cocoaupnp.

fareast555 avatar fareast555 commented on September 17, 2024

Thanks for the tip, @squarefrog!

from cocoaupnp.

fareast555 avatar fareast555 commented on September 17, 2024

Hi @squarefrog. OK, the GCDWebserver was a good call. I can now stream to multiple devices simultaneously when connected to the same network.

If you guys would like a write up about how to get this working in Swift, just let me know and tell me how to go about it. And I owe you a beer, bud!

from cocoaupnp.

Related Issues (20)

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.