Upcoming maintenance
Dear Customers and Partners.
This website will be undergoing scheduled maintenance on June 14, 2023. Please be aware there may be disruption to the developer portal website and associated services during the scheduled maintenance period.
This upgrade is essential to ensure the continued performance, reliability, and security of Developer World.
We apologize for any inconvenience.
Play content from a DLNA server
-
Hi all,
I'm trying to play a specific audio file from a DLNA server via the setPlayContent (v1.2) API. I'm sending the following:
{
"method":"setPlayContent",
"id":47,
"params":[
{
"output":"extOutput:zone?zone=1",
"uri":"dlna:music"
}
],
"version":"1.2"
}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..Thanks!
-
The path to a file on a DLNA server should look something like this:
http://192.168.100.254:9000/disk/DLNA-PNAAC_ISO_320-OP01-FLAGS01700000/O0$1$8I53259.m4a
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:<?php
// set post fields
$post = [
'method'=>'setPlayContent',
'id'=>47,
'params'=>[[
'uri'=>'dlna?path=http://A.B.C.D:8200/MediaItems/17564.mp3'
]],
'version'=>'1.2'
];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?Best Regards
Stefan -
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
https://developer.sony.com/develop/audio-control-api/get-started/browse-dlna-file
https://developer.sony.com/develop/audio-control-api/get-started/play-dlna-fileSource files here:
https://github.com/sonydevworld/audio_control_api_examples/tree/master/DLNA -
@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
-
This post is deleted!