Comments (9)
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.
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.
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.
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.
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.
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.
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.
Thanks for the tip, @squarefrog!
from cocoaupnp.
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)
- How to create and fetch the items in queue HOT 3
- Media item title with or without extension HOT 2
- The README.md doesn't say anything about the functionality
- Playlist issue HOT 1
- How to trap LastChange event? HOT 2
- Streaming a video
- How to Broadcasting iPhone's media as the service side HOT 1
- LG Tvs : 714 - Illegal MIME-type HOT 2
- Please add an option to ignore the `NOTIFY` messages on delegate 'discovery:didFindDevice:' HOT 7
- Please add the supported UPnP version(s) to the docu (readme) HOT 1
- Request: please add property "presentationURL" from the Device description to Class UPPBasicDevice
- The value for "USER-AGENT" in the M-SEARCH message does not comply to the UPnP standard. It also contains version issues.
- Does this library support DMR functionality ? HOT 3
- Devices search failed on iOS 14 and deployment target iOS 12 or newer HOT 10
- Is there a way to save urn/url of device and restore it later without rediscovering it? HOT 2
- GCDAsyncUdpSocket sendto error = EINPROGRESS HOT 2
- The bitrate of the song queried through CocoaUPnP is incorrect HOT 1
- UPPMediaRendererDevice HOT 1
- Fetch all songs & metadata from server at once ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cocoaupnp.