SlideShare a Scribd company logo



                                     UPnP AV MediaServer
                                            and




digitalStrom Developer Day, January 15, 2010               Sergey 'Jin' Bostandzhyan
                                                                    jin@mediatomb.cc

                         




                              Overview


●   very brief introduction on UPnP
●   introduction on MediaTomb and feature overview
●   closer look at the “active items” feature
●   interaction with digitalSTROM

                     




                Universal Plug and Play

The UPnP forum, an industry initiative of more than 800
companies.

“The Forum's goals are to allow devices to connect seamlessly
and to simplify network implementation in the home and corporate
environments. Toward this end, UPnP Forum members work
together to define and publish UPnP device control protocols built
upon open, Internet-based communication standards.”

http://www.upnp.org/about/default.asp

                        




                  Universal Plug and Play

●   allows peer-to-peer networking of CE devices, PC's, etc.
●   protocol based on IP, TCP, UDP, HTTP, XML among others
●   supports zero-configuration networking
●   devices announce their presence
●   devices can query and learn capability of other devices
●   defines various standardized specifications

                     




                Universal Plug and Play

MediaServer

 ●   provides information about media format
 ●   reads meta data from media files
 ●   offers means to organize media collections
 ●   presents a browseable hierarchy to the MediaRenderer via
     the Content Directory Service
 ●   allows to stream/download media

                      




                 Universal Plug and Play

MediaRenderer


  ●   allows the user to browse content of media servers
  ●   shows information about the media
  ●   allows the user to play/watch media

                                



  WAN
                             Universal Plug and Play




LAN                             Iomega StorCenter
                                    running
                                   MediaTomb




                                    Philips SPF508 Digital Picture Frame

Notebook running MediaTomb                                                 D-Link DSM-510

                     




       MediaTomb – UPnP AV MediaServer
                      http://mediatomb.cc

●   open source, GPLv2
●   meta data extraction from media files (ID3, EXIF, etc.)
●   user configurable media layout / browse hierarchy via JS
●   provides means for custom playlist parsing via JS
●   highly flexible media format transcoding via plugins / scripts
●   web UI with a tree view of the database and the file system
●   runs on x86, Alpha, ARM, MIPS, Sparc, ...
●   available in major Linux distributions like Debian, Fedora, etc.

        




MediaTomb – UPnP AV MediaServer
         http://mediatomb.cc

                       




         MediaTomb – UPnP AV MediaServer
                        http://mediatomb.cc

Active Item Feature

  ●   allows to run a script on the server when media was
      requested for download
  ●   allows the script to modify properties of the virtual UPnP
      object that corresponds to the requested media

                         




     MediaTomb – UPnP AV MediaServer
                          http://mediatomb.cc

“Browse”
                                         User navigates into a container:
   S                                     browse request (SOAP, XML)
                                                                                 P
   E   Server lists container contents:
       browse response (SOAP, XML)
                                                                                 L
   R   <DIDL­Lite>
           <item id="1888" parentID="1752" restricted="1">
             <dc:title>УАЗик, реставрация</dc:title>                             A
   V         <upnp:class>object.item.imageItem</upnp:class>
             <dc:date>2009­10­29</dc:date>
             <res protocolInfo="http­get:*:image/jpeg:*" size="1526998" 
                                                                                 Y
   E   resolution="2848x2136">http://192.168.5.5:50500/content/media/object_id
       /1888/res_id/0/ext/file.jpg</res>
             <res protocolInfo="http­get:*:image/jpeg:*" 
                                                                                 E
   R   resolution="160x120">http://192.168.5.5:50500/content/media/object_id/
       1888/res_id/1/rct/EX_TH/ext/file.jpg</res>
           </item>
                                                                                 R
       </DIDL­Lite>

                              




         MediaTomb – UPnP AV MediaServer
                               http://mediatomb.cc

“Play”
   S                                            User presses “Play”: HTTP GET
              http://192.168.5.5:50500/content/media/object_id/1888/res_id/0/ext/file.jpg
                                                                                            P
   E      ● server looks up object id 1888 in the database
          ● looks up the location of the media on disk                                      L
   R      ● sends data

                                                                                            A
   V
          HTTP/1.1 200 OK
          CONTENT­LENGTH: 1526998
          CONTENT­TYPE: image/jpeg
                                                                                            Y
   E      DATE: Fri, 01 Jan 2010 21:39:18 GMT
          LAST­MODIFIED: Thu, 19 Nov 2009 09:22:57 GMT
          SERVER: Linux/2.6.31.9­174.fc12.x86_64, UPnP/1.0, MediaTomb/0.12.0
                                                                                            E
   R      CONNECTION: close
          Content­Disposition: attachment; filename="DSCF7914.JPG"
          Accept­Ranges: bytes
                                                                                            R

                            




      MediaTomb – UPnP AV MediaServer
                             http://mediatomb.cc

“Play”: Active Item
    S                                         User presses “Play”: HTTP GET
            http://192.168.5.5:50500/content/media/object_id/1889/res_id/0/ext/file.jpg
                                                                                          P
    E                                                                                     L
          server looks up object id 1889 in the database
    R
        ●



                                                                                          A
        ● recognizes, that the requested object is an “Active Item”

        ● ...

    V                                                                                     Y
    E                                                                                     E
    R                                                                                     R

                          




      MediaTomb – UPnP AV MediaServer
                           http://mediatomb.cc

“Play”: Active Item
    S   ●


        ●
            ...
            recognizes, that the requested object is an “Active Item”
    E   ●   renders the requested UPnP object as XML
    R   ●   launches a user defined script, feeding it a the rendered XML on stdin

    V   ●


        ●
            expects the script to spit out same or modified XML to stdout
            updates the object in the database using the XML received from the script
    E   ●   looks up the location of the updated object on disk
    R   ●   sends the data to the player

                           




          MediaTomb – UPnP AV MediaServer
                            http://mediatomb.cc

Active Item: script input
<item id="2292" parentID="1752" restricted="1" 
                xmlns:dc="http://purl.org/dc/elements/1.1/" 
                xmlns:upnp="urn:schemas­upnp­org:metadata­1­/upnp/">


  <dc:title>DSCF7919.JPG</dc:title>
  <upnp:class>object.item.imageItem</upnp:class>
  <dc:date>2009­10­29</dc:date>
  <action>/usr/local/bin/myscript.py</action>
  <state>0</state>
  <location>/opt/Photos/УАЗ/25­11­09/DSCF7919.JPG</location>
  <mime­type>image/jpeg</mime­type>
</item>

                            




           MediaTomb – UPnP AV MediaServer
                             http://mediatomb.cc

Active Item: script logic

●   read XML from standard input
●   parse XML and if needed evaluate the <status> tag
●   perform any desired operation on the server machine
●   update the XML if you want to pass along information to the user
●   print updated XML to standard output

                           




          MediaTomb – UPnP AV MediaServer
                            http://mediatomb.cc

Active Item: script output
<item id="2292" parentID="1752" restricted="1" 
                xmlns:dc="http://purl.org/dc/elements/1.1/" 
                xmlns:upnp="urn:schemas­upnp­org:metadata­1­/upnp/">


  <dc:title>I ran a script!</dc:title>
  <upnp:class>object.item.imageItem</upnp:class>
  <dc:date>2009­10­29</dc:date>
  <action>/usr/local/bin/myscript.py</action>
  <state>1</state>
  <location>/opt/Photos/УАЗ/25­11­09/DSCF7919.JPG</location>
  <mime­type>image/jpeg</mime­type>
</item>

                         




How to control digitalSTROM via MediaTomb?

 We need to...

   ●   think of an easy way to generate a browseable hierarchy of
       active items which would represent the dS controls
   ●   create a script that will be triggered by the active items, that
       will identify them as particular dS controls and perform
       appropriate calls to the digitalSTROM server

                         




How to control digitalSTROM via MediaTomb?

Generating the hierarchy can be done using MediaTomb's
playlist import feature which allows to write custom playlist
parsers using JavaScript.

We have to...
   ●   come up with a meaningful playlist format that we could use
   ●   tell MediaTomb to treat our file as a playlist
   ●   customize the default playlist parser so that it handles our
       playlist

                           




How to control digitalSTROM via MediaTomb?

Simply use JSON apartment structure dump from the
digitalSTROM server!
http://<dsshost>:8080/json/apartment/getStructure
{"ok":true,
 "result":{"apartment":{
    "zones":[{"id":313,"name":"Wohnzimmer","isPresent":true,"firstZoneOnDSMeter":0,
  "devices":[{"id":"3504175fe000000000001b78","isSwitch":false,
              "name":"Taster Eingang","fid":4098, "circuitID":0,"busID":897,
              "isPresent":true,"lastDiscovered":"2010­01­12 14:49:19",
              "firstSeen":"2009­11­09 10:44:16","on":false},
             {"id":"3504175fe000000000001b9f","isSwitch":false,
              "name":"Gehen Taster","fid":28770,"circuitID":0,"busID":898,
              "isPresent":true,"lastDiscovered":"2010­01­12 14:49:19",
              "firstSeen":"2009­11­09 10:44:16","on":false},
               ........

                           




How to control digitalSTROM via MediaTomb?

In the playlist parser script of MediaTomb, convert the JSON
data to a JS object and loop through the data:
    do 
    {
        json_content = json_content + line;
        line = readln(); // readln function is provided by MediaTomb
    } 
    while (line);

    // evaluate content of json file
    apartment = eval('(' + json_content + ')').result.apartment;

    while(apartment.zones.length > 0) 
    {
        zone = apartment.zones.shift();
        addScenes(zone.id, zone.name); // helper function
    };

                             




How to control digitalSTROM via MediaTomb?

Define desired scenes depending on the zone id:
function Scene(id, name) {
    this.id = id;
    this.name = name;
}

function addScenes(zoneid, zonename) {
    var item = new Object();

    // scene id ­> scene name mapping
    if(zoneid == 313) // Wohnen
    {
        scenes = new Array(new Scene(5, "Essen"), new Scene(17, "Fernsehen"),
                           new Scene(18, "Lesen"), new Scene(19, "Putzen"),
                           new Scene(13, "Alles aus"));
    } ...

        

                           




How to control digitalSTROM via MediaTomb?

Create new active item objects and add them to MediaTomb:
function addScenes(zoneid, zonename) {
    .....
    while(scenes.length > 0) {
        scene = scenes.shift();
        item.objectType = OBJECT_TYPE_ACTIVE_ITEM;
        item.action = "/home/demo/Desktop/call_item_by_state.py";
        item.state = "class=scene;zone=" + zoneid + ";scene=" + scene.id;
        item.title = scene.name;
        item.location = "/home/demo/Desktop/selected.mp3";
        item.mimetype = 'audio/mpeg';
        item.upnpclass = UPNP_CLASS_ITEM_MUSIC_TRACK;
        chain = new Array("Wohnung – Musik", zonename, scene.name);
        addCdsObject(item, createContainerChain(chain),
                     UPNP_CLASS_PLAYLIST_CONTAINER);
    }
}
        

              




How to control digitalSTROM via MediaTomb?

                        




How to control digitalSTROM via MediaTomb?
When the “Essen” item gets played, the action
/home/demo/Desktop/call_item_by_state.py is executed,
receving this XML on stdin:

<item id="49921" parentID="49920" restricted="1"
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      xmlns:upnp="urn:schemas­upnp­org:metadata­1­0/upnp/">

  <dc:title>Essen</dc:title>
  <upnp:class>object.item.audioItem.musicTrack</upnp:class>
  <action>/home/demo/Desktop/call_item_by_state.py</action>
  <state>class=scene;zone=313;scene=5</state>
  <location>/home/demo/Desktop/send.mp3</location>
  <mime­type>audio/mpeg</mime­type>
</item>

                        




How to control digitalSTROM via MediaTomb?
call_item_by_state.py:

●   parses the item XML and get the <state> value
●   parses the state and gets zone and scene id's
●   runs a helper script which calls the scene on the dSS
●   returns unmodified XML back to MediaTomb (no item update)

                        




How to control digitalSTROM via MediaTomb?
call_scene.sh helper script:
#!/bin/bash
DSS_SERVER=localhost:8080

BASE_URL="http://$DSS_SERVER/json/zone/callScene"

if [ ­z "$2" ]; then
    echo "Usage: $(basename $0) <zone id> <scene id>"
    exit 1
fi

wget ­O ­ "${BASE_URL}?id=$1&sceneNr=$2&groupID=1" &> /dev/null

                         




                              Summary
In order to perform calls on the dSS from any UPnP player

   ●   download the JSON dump from dSS and use it as a playlist
       in MediaTomb
   ●   use the playlist parser from this presentation or customize
       your own
   ●   install the active item action script and the dSS helper script
   ●   setup MediaTomb to use your parser and import the playlist
   ●   on the player, navigate to the desired item and press play to
       trigger a call to the dSS

Scripts used in this presentation are available here:
http://developer.digitalstrom.org/files/contrib/

            




               Questions?


         http://www.digitalstrom.org/


            http://mediatomb.cc/
             jin@mediatomb.cc


       Scripts used in this presentation:
http://developer.digitalstrom.org/files/contrib/

More Related Content

Similar to UPnP and digitalSTROM

Deploy your own P2P network
Deploy your own P2P networkDeploy your own P2P network
Deploy your own P2P network
Dobrica Pavlinušić
 
Kurento: a media server architecture and API for WebRTC
Kurento: a media server architecture and API for WebRTCKurento: a media server architecture and API for WebRTC
Kurento: a media server architecture and API for WebRTC
Luis Lopez
 
Developing rich multimedia applications with FI-WARE.
Developing rich multimedia applications with FI-WARE.Developing rich multimedia applications with FI-WARE.
Developing rich multimedia applications with FI-WARE.
Luis Lopez
 
Developing rich multimedia applications with Kurento: a tutorial for JavaScri...
Developing rich multimedia applications with Kurento: a tutorial for JavaScri...Developing rich multimedia applications with Kurento: a tutorial for JavaScri...
Developing rich multimedia applications with Kurento: a tutorial for JavaScri...
Luis Lopez
 
Android development - the basics, FI MUNI, 2012
Android development - the basics, FI MUNI, 2012Android development - the basics, FI MUNI, 2012
Android development - the basics, FI MUNI, 2012Tomáš Kypta
 
Monkey Server
Monkey ServerMonkey Server
Monkey Server
Eduardo Silva Pereira
 
Adobe MAX 2006 - Creating Flash Content for Consumer Electronics
Adobe MAX 2006 - Creating Flash Content for Consumer ElectronicsAdobe MAX 2006 - Creating Flash Content for Consumer Electronics
Adobe MAX 2006 - Creating Flash Content for Consumer Electronicsguestd82c1e
 
Chapter_2_v8.3.pptx
Chapter_2_v8.3.pptxChapter_2_v8.3.pptx
Chapter_2_v8.3.pptx
InventiveMinecraft
 
Monitoraggio del Traffico di Rete Usando Python ed ntop
Monitoraggio del Traffico di Rete Usando Python ed ntopMonitoraggio del Traffico di Rete Usando Python ed ntop
Monitoraggio del Traffico di Rete Usando Python ed ntop
PyCon Italia
 
Chapter_2_v8.1.pptx
Chapter_2_v8.1.pptxChapter_2_v8.1.pptx
Chapter_2_v8.1.pptx
WentworthMiller3
 
Computer network network edge and network
Computer network network edge and networkComputer network network edge and network
Computer network network edge and network
rjnavallasca
 
OpenStack Neutron new developers on boarding
OpenStack Neutron new developers on boardingOpenStack Neutron new developers on boarding
OpenStack Neutron new developers on boarding
Miguel Lavalle
 
Developing rich multimedia applications with Kurento: a tutorial for Java Dev...
Developing rich multimedia applications with Kurento: a tutorial for Java Dev...Developing rich multimedia applications with Kurento: a tutorial for Java Dev...
Developing rich multimedia applications with Kurento: a tutorial for Java Dev...
Luis Lopez
 
Tutorial: Writing Sencha Touch Mobile Apps using ]project-open[
Tutorial: Writing Sencha Touch Mobile Apps using ]project-open[Tutorial: Writing Sencha Touch Mobile Apps using ]project-open[
Tutorial: Writing Sencha Touch Mobile Apps using ]project-open[
Klaus Hofeditz
 
Hack Like It's 2013 (The Workshop)
Hack Like It's 2013 (The Workshop)Hack Like It's 2013 (The Workshop)
Hack Like It's 2013 (The Workshop)
Itzik Kotler
 
Generating Unified APIs with Protocol Buffers and gRPC
Generating Unified APIs with Protocol Buffers and gRPCGenerating Unified APIs with Protocol Buffers and gRPC
Generating Unified APIs with Protocol Buffers and gRPC
C4Media
 
IoTivity: From Devices to the Cloud
IoTivity: From Devices to the CloudIoTivity: From Devices to the Cloud
IoTivity: From Devices to the Cloud
Samsung Open Source Group
 
FIWARE Global Summit - Real-time Media Stream Processing Using Kurento
FIWARE Global Summit - Real-time Media Stream Processing Using KurentoFIWARE Global Summit - Real-time Media Stream Processing Using Kurento
FIWARE Global Summit - Real-time Media Stream Processing Using Kurento
FIWARE
 
Docker for Development
Docker for DevelopmentDocker for Development
Docker for Development
allingeek
 

Similar to UPnP and digitalSTROM (20)

Deploy your own P2P network
Deploy your own P2P networkDeploy your own P2P network
Deploy your own P2P network
 
Kurento: a media server architecture and API for WebRTC
Kurento: a media server architecture and API for WebRTCKurento: a media server architecture and API for WebRTC
Kurento: a media server architecture and API for WebRTC
 
Developing rich multimedia applications with FI-WARE.
Developing rich multimedia applications with FI-WARE.Developing rich multimedia applications with FI-WARE.
Developing rich multimedia applications with FI-WARE.
 
Developing rich multimedia applications with Kurento: a tutorial for JavaScri...
Developing rich multimedia applications with Kurento: a tutorial for JavaScri...Developing rich multimedia applications with Kurento: a tutorial for JavaScri...
Developing rich multimedia applications with Kurento: a tutorial for JavaScri...
 
Android development - the basics, FI MUNI, 2012
Android development - the basics, FI MUNI, 2012Android development - the basics, FI MUNI, 2012
Android development - the basics, FI MUNI, 2012
 
Monkey Server
Monkey ServerMonkey Server
Monkey Server
 
Adobe MAX 2006 - Creating Flash Content for Consumer Electronics
Adobe MAX 2006 - Creating Flash Content for Consumer ElectronicsAdobe MAX 2006 - Creating Flash Content for Consumer Electronics
Adobe MAX 2006 - Creating Flash Content for Consumer Electronics
 
Chapter_2_v8.3.pptx
Chapter_2_v8.3.pptxChapter_2_v8.3.pptx
Chapter_2_v8.3.pptx
 
Monitoraggio del Traffico di Rete Usando Python ed ntop
Monitoraggio del Traffico di Rete Usando Python ed ntopMonitoraggio del Traffico di Rete Usando Python ed ntop
Monitoraggio del Traffico di Rete Usando Python ed ntop
 
Chapter_2_v8.1.pptx
Chapter_2_v8.1.pptxChapter_2_v8.1.pptx
Chapter_2_v8.1.pptx
 
Computer network network edge and network
Computer network network edge and networkComputer network network edge and network
Computer network network edge and network
 
OpenStack Neutron new developers on boarding
OpenStack Neutron new developers on boardingOpenStack Neutron new developers on boarding
OpenStack Neutron new developers on boarding
 
Developing rich multimedia applications with Kurento: a tutorial for Java Dev...
Developing rich multimedia applications with Kurento: a tutorial for Java Dev...Developing rich multimedia applications with Kurento: a tutorial for Java Dev...
Developing rich multimedia applications with Kurento: a tutorial for Java Dev...
 
Design Hypermedia APIs
Design Hypermedia APIsDesign Hypermedia APIs
Design Hypermedia APIs
 
Tutorial: Writing Sencha Touch Mobile Apps using ]project-open[
Tutorial: Writing Sencha Touch Mobile Apps using ]project-open[Tutorial: Writing Sencha Touch Mobile Apps using ]project-open[
Tutorial: Writing Sencha Touch Mobile Apps using ]project-open[
 
Hack Like It's 2013 (The Workshop)
Hack Like It's 2013 (The Workshop)Hack Like It's 2013 (The Workshop)
Hack Like It's 2013 (The Workshop)
 
Generating Unified APIs with Protocol Buffers and gRPC
Generating Unified APIs with Protocol Buffers and gRPCGenerating Unified APIs with Protocol Buffers and gRPC
Generating Unified APIs with Protocol Buffers and gRPC
 
IoTivity: From Devices to the Cloud
IoTivity: From Devices to the CloudIoTivity: From Devices to the Cloud
IoTivity: From Devices to the Cloud
 
FIWARE Global Summit - Real-time Media Stream Processing Using Kurento
FIWARE Global Summit - Real-time Media Stream Processing Using KurentoFIWARE Global Summit - Real-time Media Stream Processing Using Kurento
FIWARE Global Summit - Real-time Media Stream Processing Using Kurento
 
Docker for Development
Docker for DevelopmentDocker for Development
Docker for Development
 

More from digitalSTROM.org

digitalSTROM Developer Day 2011: Wie digitalSTROM auf das iPhone kommt II
digitalSTROM Developer Day 2011: Wie digitalSTROM auf das iPhone kommt IIdigitalSTROM Developer Day 2011: Wie digitalSTROM auf das iPhone kommt II
digitalSTROM Developer Day 2011: Wie digitalSTROM auf das iPhone kommt IIdigitalSTROM.org
 
digitalSTROM Developer Day 2011: Wie digitalSTROM auf das iPhone kommt I
digitalSTROM Developer Day 2011: Wie digitalSTROM auf das iPhone kommt IdigitalSTROM Developer Day 2011: Wie digitalSTROM auf das iPhone kommt I
digitalSTROM Developer Day 2011: Wie digitalSTROM auf das iPhone kommt IdigitalSTROM.org
 
digitalSTROM Developer Day 2011: digitalSTROM-Server-Apps
digitalSTROM Developer Day 2011: digitalSTROM-Server-AppsdigitalSTROM Developer Day 2011: digitalSTROM-Server-Apps
digitalSTROM Developer Day 2011: digitalSTROM-Server-AppsdigitalSTROM.org
 
digitalSTROM Developer Day 2011: Wie Heimelektronik und digitalSTROM zusammen...
digitalSTROM Developer Day 2011: Wie Heimelektronik und digitalSTROM zusammen...digitalSTROM Developer Day 2011: Wie Heimelektronik und digitalSTROM zusammen...
digitalSTROM Developer Day 2011: Wie Heimelektronik und digitalSTROM zusammen...
digitalSTROM.org
 
digitalSTROM Developer Day 2011: digitalSTROM bindet auch externe Komponenten...
digitalSTROM Developer Day 2011: digitalSTROM bindet auch externe Komponenten...digitalSTROM Developer Day 2011: digitalSTROM bindet auch externe Komponenten...
digitalSTROM Developer Day 2011: digitalSTROM bindet auch externe Komponenten...
digitalSTROM.org
 
digitalSTROM Developer Day 2011: Jump Start in die digitalSTROM-Server Entwic...
digitalSTROM Developer Day 2011: Jump Start in die digitalSTROM-Server Entwic...digitalSTROM Developer Day 2011: Jump Start in die digitalSTROM-Server Entwic...
digitalSTROM Developer Day 2011: Jump Start in die digitalSTROM-Server Entwic...
digitalSTROM.org
 
digitalSTROM Developer Day 2011: Neue Möglichkeiten mit dem digitalSTROM-Server
digitalSTROM Developer Day 2011: Neue Möglichkeiten mit dem digitalSTROM-ServerdigitalSTROM Developer Day 2011: Neue Möglichkeiten mit dem digitalSTROM-Server
digitalSTROM Developer Day 2011: Neue Möglichkeiten mit dem digitalSTROM-Server
digitalSTROM.org
 
digitalSTROM Developer Day 2011: Referat Ludger Hovestadt
digitalSTROM Developer Day 2011: Referat Ludger HovestadtdigitalSTROM Developer Day 2011: Referat Ludger Hovestadt
digitalSTROM Developer Day 2011: Referat Ludger HovestadtdigitalSTROM.org
 
digitalSTROM Interaction Design Concepts
digitalSTROM Interaction Design ConceptsdigitalSTROM Interaction Design Concepts
digitalSTROM Interaction Design Concepts
digitalSTROM.org
 
digitalSTROM Server Development
digitalSTROM Server DevelopmentdigitalSTROM Server Development
digitalSTROM Server Development
digitalSTROM.org
 
Contributing to dSS development
Contributing to dSS developmentContributing to dSS development
Contributing to dSS development
digitalSTROM.org
 

More from digitalSTROM.org (12)

digitalSTROM Developer Day 2011: Wie digitalSTROM auf das iPhone kommt II
digitalSTROM Developer Day 2011: Wie digitalSTROM auf das iPhone kommt IIdigitalSTROM Developer Day 2011: Wie digitalSTROM auf das iPhone kommt II
digitalSTROM Developer Day 2011: Wie digitalSTROM auf das iPhone kommt II
 
digitalSTROM Developer Day 2011: Wie digitalSTROM auf das iPhone kommt I
digitalSTROM Developer Day 2011: Wie digitalSTROM auf das iPhone kommt IdigitalSTROM Developer Day 2011: Wie digitalSTROM auf das iPhone kommt I
digitalSTROM Developer Day 2011: Wie digitalSTROM auf das iPhone kommt I
 
digitalSTROM Developer Day 2011: digitalSTROM-Server-Apps
digitalSTROM Developer Day 2011: digitalSTROM-Server-AppsdigitalSTROM Developer Day 2011: digitalSTROM-Server-Apps
digitalSTROM Developer Day 2011: digitalSTROM-Server-Apps
 
digitalSTROM Developer Day 2011: Wie Heimelektronik und digitalSTROM zusammen...
digitalSTROM Developer Day 2011: Wie Heimelektronik und digitalSTROM zusammen...digitalSTROM Developer Day 2011: Wie Heimelektronik und digitalSTROM zusammen...
digitalSTROM Developer Day 2011: Wie Heimelektronik und digitalSTROM zusammen...
 
digitalSTROM Developer Day 2011: digitalSTROM bindet auch externe Komponenten...
digitalSTROM Developer Day 2011: digitalSTROM bindet auch externe Komponenten...digitalSTROM Developer Day 2011: digitalSTROM bindet auch externe Komponenten...
digitalSTROM Developer Day 2011: digitalSTROM bindet auch externe Komponenten...
 
digitalSTROM Developer Day 2011: Jump Start in die digitalSTROM-Server Entwic...
digitalSTROM Developer Day 2011: Jump Start in die digitalSTROM-Server Entwic...digitalSTROM Developer Day 2011: Jump Start in die digitalSTROM-Server Entwic...
digitalSTROM Developer Day 2011: Jump Start in die digitalSTROM-Server Entwic...
 
digitalSTROM Developer Day 2011: Neue Möglichkeiten mit dem digitalSTROM-Server
digitalSTROM Developer Day 2011: Neue Möglichkeiten mit dem digitalSTROM-ServerdigitalSTROM Developer Day 2011: Neue Möglichkeiten mit dem digitalSTROM-Server
digitalSTROM Developer Day 2011: Neue Möglichkeiten mit dem digitalSTROM-Server
 
digitalSTROM Developer Day 2011: Referat Ludger Hovestadt
digitalSTROM Developer Day 2011: Referat Ludger HovestadtdigitalSTROM Developer Day 2011: Referat Ludger Hovestadt
digitalSTROM Developer Day 2011: Referat Ludger Hovestadt
 
digitalSTROM Interaction Design Concepts
digitalSTROM Interaction Design ConceptsdigitalSTROM Interaction Design Concepts
digitalSTROM Interaction Design Concepts
 
digitalSTROM Server Development
digitalSTROM Server DevelopmentdigitalSTROM Server Development
digitalSTROM Server Development
 
dSS API by example
dSS API by exampledSS API by example
dSS API by example
 
Contributing to dSS development
Contributing to dSS developmentContributing to dSS development
Contributing to dSS development
 

Recently uploaded

GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 

Recently uploaded (20)

GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 

UPnP and digitalSTROM

  • 1.  UPnP AV MediaServer and digitalStrom Developer Day, January 15, 2010 Sergey 'Jin' Bostandzhyan jin@mediatomb.cc
  • 2.   Overview ● very brief introduction on UPnP ● introduction on MediaTomb and feature overview ● closer look at the “active items” feature ● interaction with digitalSTROM
  • 3.   Universal Plug and Play The UPnP forum, an industry initiative of more than 800 companies. “The Forum's goals are to allow devices to connect seamlessly and to simplify network implementation in the home and corporate environments. Toward this end, UPnP Forum members work together to define and publish UPnP device control protocols built upon open, Internet-based communication standards.” http://www.upnp.org/about/default.asp
  • 4.   Universal Plug and Play ● allows peer-to-peer networking of CE devices, PC's, etc. ● protocol based on IP, TCP, UDP, HTTP, XML among others ● supports zero-configuration networking ● devices announce their presence ● devices can query and learn capability of other devices ● defines various standardized specifications
  • 5.   Universal Plug and Play MediaServer ● provides information about media format ● reads meta data from media files ● offers means to organize media collections ● presents a browseable hierarchy to the MediaRenderer via the Content Directory Service ● allows to stream/download media
  • 6.   Universal Plug and Play MediaRenderer ● allows the user to browse content of media servers ● shows information about the media ● allows the user to play/watch media
  • 7.   WAN Universal Plug and Play LAN Iomega StorCenter running MediaTomb Philips SPF508 Digital Picture Frame Notebook running MediaTomb D-Link DSM-510
  • 8.   MediaTomb – UPnP AV MediaServer http://mediatomb.cc ● open source, GPLv2 ● meta data extraction from media files (ID3, EXIF, etc.) ● user configurable media layout / browse hierarchy via JS ● provides means for custom playlist parsing via JS ● highly flexible media format transcoding via plugins / scripts ● web UI with a tree view of the database and the file system ● runs on x86, Alpha, ARM, MIPS, Sparc, ... ● available in major Linux distributions like Debian, Fedora, etc.
  • 9.   MediaTomb – UPnP AV MediaServer http://mediatomb.cc
  • 10.   MediaTomb – UPnP AV MediaServer http://mediatomb.cc Active Item Feature ● allows to run a script on the server when media was requested for download ● allows the script to modify properties of the virtual UPnP object that corresponds to the requested media
  • 11.   MediaTomb – UPnP AV MediaServer http://mediatomb.cc “Browse” User navigates into a container: S browse request (SOAP, XML) P E Server lists container contents: browse response (SOAP, XML) L R <DIDL­Lite>     <item id="1888" parentID="1752" restricted="1">       <dc:title>УАЗик, реставрация</dc:title> A V       <upnp:class>object.item.imageItem</upnp:class>       <dc:date>2009­10­29</dc:date>       <res protocolInfo="http­get:*:image/jpeg:*" size="1526998"  Y E resolution="2848x2136">http://192.168.5.5:50500/content/media/object_id /1888/res_id/0/ext/file.jpg</res>       <res protocolInfo="http­get:*:image/jpeg:*"  E R resolution="160x120">http://192.168.5.5:50500/content/media/object_id/ 1888/res_id/1/rct/EX_TH/ext/file.jpg</res>     </item> R </DIDL­Lite>
  • 12.   MediaTomb – UPnP AV MediaServer http://mediatomb.cc “Play” S User presses “Play”: HTTP GET http://192.168.5.5:50500/content/media/object_id/1888/res_id/0/ext/file.jpg P E ● server looks up object id 1888 in the database ● looks up the location of the media on disk L R ● sends data A V HTTP/1.1 200 OK CONTENT­LENGTH: 1526998 CONTENT­TYPE: image/jpeg Y E DATE: Fri, 01 Jan 2010 21:39:18 GMT LAST­MODIFIED: Thu, 19 Nov 2009 09:22:57 GMT SERVER: Linux/2.6.31.9­174.fc12.x86_64, UPnP/1.0, MediaTomb/0.12.0 E R CONNECTION: close Content­Disposition: attachment; filename="DSCF7914.JPG" Accept­Ranges: bytes R
  • 13.   MediaTomb – UPnP AV MediaServer http://mediatomb.cc “Play”: Active Item S User presses “Play”: HTTP GET http://192.168.5.5:50500/content/media/object_id/1889/res_id/0/ext/file.jpg P E L server looks up object id 1889 in the database R ● A ● recognizes, that the requested object is an “Active Item” ● ... V Y E E R R
  • 14.   MediaTomb – UPnP AV MediaServer http://mediatomb.cc “Play”: Active Item S ● ● ... recognizes, that the requested object is an “Active Item” E ● renders the requested UPnP object as XML R ● launches a user defined script, feeding it a the rendered XML on stdin V ● ● expects the script to spit out same or modified XML to stdout updates the object in the database using the XML received from the script E ● looks up the location of the updated object on disk R ● sends the data to the player
  • 15.   MediaTomb – UPnP AV MediaServer http://mediatomb.cc Active Item: script input <item id="2292" parentID="1752" restricted="1"                  xmlns:dc="http://purl.org/dc/elements/1.1/"                  xmlns:upnp="urn:schemas­upnp­org:metadata­1­/upnp/">   <dc:title>DSCF7919.JPG</dc:title>   <upnp:class>object.item.imageItem</upnp:class>   <dc:date>2009­10­29</dc:date>   <action>/usr/local/bin/myscript.py</action>   <state>0</state>   <location>/opt/Photos/УАЗ/25­11­09/DSCF7919.JPG</location>   <mime­type>image/jpeg</mime­type> </item>
  • 16.   MediaTomb – UPnP AV MediaServer http://mediatomb.cc Active Item: script logic ● read XML from standard input ● parse XML and if needed evaluate the <status> tag ● perform any desired operation on the server machine ● update the XML if you want to pass along information to the user ● print updated XML to standard output
  • 17.   MediaTomb – UPnP AV MediaServer http://mediatomb.cc Active Item: script output <item id="2292" parentID="1752" restricted="1"                  xmlns:dc="http://purl.org/dc/elements/1.1/"                  xmlns:upnp="urn:schemas­upnp­org:metadata­1­/upnp/">   <dc:title>I ran a script!</dc:title>   <upnp:class>object.item.imageItem</upnp:class>   <dc:date>2009­10­29</dc:date>   <action>/usr/local/bin/myscript.py</action>   <state>1</state>   <location>/opt/Photos/УАЗ/25­11­09/DSCF7919.JPG</location>   <mime­type>image/jpeg</mime­type> </item>
  • 18.   How to control digitalSTROM via MediaTomb? We need to... ● think of an easy way to generate a browseable hierarchy of active items which would represent the dS controls ● create a script that will be triggered by the active items, that will identify them as particular dS controls and perform appropriate calls to the digitalSTROM server
  • 19.   How to control digitalSTROM via MediaTomb? Generating the hierarchy can be done using MediaTomb's playlist import feature which allows to write custom playlist parsers using JavaScript. We have to... ● come up with a meaningful playlist format that we could use ● tell MediaTomb to treat our file as a playlist ● customize the default playlist parser so that it handles our playlist
  • 20.   How to control digitalSTROM via MediaTomb? Simply use JSON apartment structure dump from the digitalSTROM server! http://<dsshost>:8080/json/apartment/getStructure {"ok":true,  "result":{"apartment":{     "zones":[{"id":313,"name":"Wohnzimmer","isPresent":true,"firstZoneOnDSMeter":0,   "devices":[{"id":"3504175fe000000000001b78","isSwitch":false,               "name":"Taster Eingang","fid":4098, "circuitID":0,"busID":897,               "isPresent":true,"lastDiscovered":"2010­01­12 14:49:19",               "firstSeen":"2009­11­09 10:44:16","on":false},              {"id":"3504175fe000000000001b9f","isSwitch":false,               "name":"Gehen Taster","fid":28770,"circuitID":0,"busID":898,               "isPresent":true,"lastDiscovered":"2010­01­12 14:49:19",               "firstSeen":"2009­11­09 10:44:16","on":false},                ........
  • 21.   How to control digitalSTROM via MediaTomb? In the playlist parser script of MediaTomb, convert the JSON data to a JS object and loop through the data:     do      {         json_content = json_content + line;         line = readln(); // readln function is provided by MediaTomb     }      while (line);     // evaluate content of json file     apartment = eval('(' + json_content + ')').result.apartment;     while(apartment.zones.length > 0)      {         zone = apartment.zones.shift();         addScenes(zone.id, zone.name); // helper function     };
  • 22.   How to control digitalSTROM via MediaTomb? Define desired scenes depending on the zone id: function Scene(id, name) {     this.id = id;     this.name = name; } function addScenes(zoneid, zonename) {     var item = new Object();     // scene id ­> scene name mapping     if(zoneid == 313) // Wohnen     {         scenes = new Array(new Scene(5, "Essen"), new Scene(17, "Fernsehen"),                            new Scene(18, "Lesen"), new Scene(19, "Putzen"),                            new Scene(13, "Alles aus"));     } ...         
  • 23.   How to control digitalSTROM via MediaTomb? Create new active item objects and add them to MediaTomb: function addScenes(zoneid, zonename) {     .....     while(scenes.length > 0) {         scene = scenes.shift();         item.objectType = OBJECT_TYPE_ACTIVE_ITEM;         item.action = "/home/demo/Desktop/call_item_by_state.py";         item.state = "class=scene;zone=" + zoneid + ";scene=" + scene.id;         item.title = scene.name;         item.location = "/home/demo/Desktop/selected.mp3";         item.mimetype = 'audio/mpeg';         item.upnpclass = UPNP_CLASS_ITEM_MUSIC_TRACK;         chain = new Array("Wohnung – Musik", zonename, scene.name);         addCdsObject(item, createContainerChain(chain),                      UPNP_CLASS_PLAYLIST_CONTAINER);     } }         
  • 24.   How to control digitalSTROM via MediaTomb?
  • 25.   How to control digitalSTROM via MediaTomb? When the “Essen” item gets played, the action /home/demo/Desktop/call_item_by_state.py is executed, receving this XML on stdin: <item id="49921" parentID="49920" restricted="1"       xmlns:dc="http://purl.org/dc/elements/1.1/"        xmlns:upnp="urn:schemas­upnp­org:metadata­1­0/upnp/">   <dc:title>Essen</dc:title>   <upnp:class>object.item.audioItem.musicTrack</upnp:class>   <action>/home/demo/Desktop/call_item_by_state.py</action>   <state>class=scene;zone=313;scene=5</state>   <location>/home/demo/Desktop/send.mp3</location>   <mime­type>audio/mpeg</mime­type> </item>
  • 26.   How to control digitalSTROM via MediaTomb? call_item_by_state.py: ● parses the item XML and get the <state> value ● parses the state and gets zone and scene id's ● runs a helper script which calls the scene on the dSS ● returns unmodified XML back to MediaTomb (no item update)
  • 27.   How to control digitalSTROM via MediaTomb? call_scene.sh helper script: #!/bin/bash DSS_SERVER=localhost:8080 BASE_URL="http://$DSS_SERVER/json/zone/callScene" if [ ­z "$2" ]; then     echo "Usage: $(basename $0) <zone id> <scene id>"     exit 1 fi wget ­O ­ "${BASE_URL}?id=$1&sceneNr=$2&groupID=1" &> /dev/null
  • 28.   Summary In order to perform calls on the dSS from any UPnP player ● download the JSON dump from dSS and use it as a playlist in MediaTomb ● use the playlist parser from this presentation or customize your own ● install the active item action script and the dSS helper script ● setup MediaTomb to use your parser and import the playlist ● on the player, navigate to the desired item and press play to trigger a call to the dSS Scripts used in this presentation are available here: http://developer.digitalstrom.org/files/contrib/
  • 29.   Questions? http://www.digitalstrom.org/ http://mediatomb.cc/ jin@mediatomb.cc Scripts used in this presentation: http://developer.digitalstrom.org/files/contrib/