Sony's Developer World forum

    • Home
    • Forum guidelines

    Play content from a DLNA server

    Audio Control API
    5
    10
    68104
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      Vincent Vanbroekhoven last edited by

      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!

      G 1 Reply Last reply Reply Quote
      • G
        grolschie @Vincent Vanbroekhoven last edited by

        @Vincent-Vanbroekhoven

        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.

        V 1 Reply Last reply Reply Quote
        • V
          Vincent Vanbroekhoven @grolschie last edited by

          @grolschie thanks a lot, I'll give it a try and let you know whether I succeeded 🙂

          1 Reply Last reply Reply Quote
          • S
            Sumada last edited by

            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

            1 Reply Last reply Reply Quote
            • D
              david DeveloperWorld last edited by david

              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-file

              Source files here:
              https://github.com/sonydevworld/audio_control_api_examples/tree/master/DLNA

              G 1 Reply Last reply Reply Quote
              • G
                grolschie @david last edited by

                @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?

                1 Reply Last reply Reply Quote
                • D
                  david DeveloperWorld last edited by

                  @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.

                  1 Reply Last reply Reply Quote
                  • G
                    grolschie last edited by

                    Thank you, @david.

                    1 Reply Last reply Reply Quote
                    • S
                      Sumada last edited by

                      Thank you @david

                      1 Reply Last reply Reply Quote
                      • dmelnik3289
                        dmelnik3289 Banned last edited by

                        This post is deleted!
                        1 Reply Last reply Reply Quote
                        • First post
                          Last post
                        Developer World
                        Copyright © 2021 Sony Group Corporation. All rights reserved.
                        • Contact us
                        • Legal