Play content from a DLNA server
I'm trying to play a specific audio file from a DLNA server via the setPlayContent (v1.2) API. I'm sending the following:
However, I'm wondering now how to set which DLNA server it should fetch the audio file from and also the exact path location of this audio file. e.g. by setting uri to dlna:music?path=/music/audiofile.mp3
Unfortunately I cannot get it working..
The path to a file on a DLNA server should look something like this:
In your example, the path is local to the device running the application.
@grolschie thanks a lot, I'll give it a try and let you know whether I succeeded
Hello @grolschie and Others
I have the same Project as @Vincent-Vanbroekhoven and did not get it running. Did you already?
I have a minidlna server on a raspberry pi. Over a dlna-server, i get the path to a song like: http://A.B.C.D/MediaItems/17564.mp3, which i use in my php-script like this:
// set post fields
$post = [
var_dump(json_encode($post)); $ch = curl_init('http://A.B.C.X:54480/sony/avContent'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($post)); // execute! $response = curl_exec($ch); // close the connection, release resources used curl_close($ch); // do anything you want with your response var_dump($response);
Other commands do work. also I tried with dlna:music?path=...
How can I adress the file?
For me not using the setPlayContent method and using the DNLA comands directly have worked better, the uri path is hard to debug and to get right. Have a look at the examples here for how I have done it
Source files here:
@david do you know if the engineers have any plans to update the API to fix some of the quirks/bugs? And if so, would currently sold devices be updated?
@grolschie I know engineers that want to, but I don't know if they will be given the time to do it. For minor fixes/bugs currently sold devices will probably be updated if posible, but if there is a major update/rework of the API then probably only for new devices. But I don't know, I'm guessing here.
Thank you, @david.
Thank you @david
dmelnik3289 Banned last edited by
This post is deleted!