Mediathek

Discuss issues related to PS3 Media Server development (only for programmers)

Mediathek

Postby venraij » Mon Jul 26, 2010 9:38 pm

I have downloaded the software today it is quite nice. While playing around a bit I have programmed a little plugin that automatically downloads the ARD/ZDF and other Mediathekdata and offers them at runtime as virtual media.
It is working quit fine but the place where I have implemented it is no the best place posssibly. It is working with another open source project called Mediathekview (http://sourceforge.net/projects/zdfmediathk/) . My code is bridging the two.
Do have an idea where to put the code, something about a plugin I have found but it doesn't seems much helpful for my case....

-----Code ---snipllets----

Code: Select all
   private void addMediathekVideoFeeds(RendererConfiguration renderer) {
      ListeFilme filme = (ListeFilme) StartMediathekReader.daten.listeFilme;
      for (int i = 0; i < filme.size(); i++) {
         DLNAResource node = getRootFolder(renderer);
         node = goDownToTopic(node, "videostream.Web");
         node = goDownToTopic(node, "Video");
         DatenFilm film = filme.get(i);
         node = goDownToTopic(node, film.arr[Konstanten.FILM_SENDER_NR]);
         node = goDownToTopic(node, film.arr[Konstanten.FILM_THEMA_NR]);

         String titel = film.arr[Konstanten.FILM_TITEL_NR];
//         String url  = film.arr[Konstanten.FILM_URL_HD_NR];
         String url  = film.arr[Konstanten.FILM_URL_NR];

         DLNAResource titleNode = node.searchByName(titel);
         if(titleNode == null) {
            // WebVideoStream(String fluxName, String URL, String thumbURL)
            node.addChild(new  WebVideoStream(titel, url, ""));
         }

         node = getRootFolder(renderer);
         node = goDownToTopic(node, "videofeed.Web");
         node = goDownToTopic(node, "Video");
         node = goDownToTopic(node, film.arr[Konstanten.FILM_SENDER_NR]);
         node = goDownToTopic(node, film.arr[Konstanten.FILM_THEMA_NR]);

         titleNode = node.searchByName(titel);
         if(titleNode == null) {
            // WebVideoStream(String fluxName, String URL, String thumbURL)
            node.addChild(new  WebVideoStream(titel, url, ""));
         }
      
      }
   }
   private DLNAResource goDownToTopic(DLNAResource parent, String topic) {
      DLNAResource node = parent.searchByName(topic);
      if(node != null)
         return node;
      node = new VirtualFolder(topic, "");
      parent.addChild(node);
      
      return node;
   }

RendererConfig:
   public RootFolder getRootFolder() {
      if (rootFolder == null) {
...
      } else {
         PMS.get().addMediaLibraryFolder(this);
      }
      return rootFolder;
   }
venraij
 
Posts: 9
Joined: Mon Jul 26, 2010 9:26 pm

Re: Mediathek

Postby venraij » Thu Jul 29, 2010 4:26 pm

Maybe I could use the interface AdditionalFolderAtRoot but the probelm with that is that it is called to late after the root was initialized, when I am changing the source code of the media serve however it works.

PMS.init()
....
try {
ExternalFactory.lookup();
manageRoot(RendererConfiguration.getDefaultConf()); // XXX needed for additional roots ????
} catch (Exception e) {
PMS.error("Error in the plugins lookup", e);
}

That the way the roots will be reevaluated (already done three times yet) _after_ creating the plugins. By this way my folders are added the the root. Are I am doing something wrong or how do other developpers create such plugin?
venraij
 
Posts: 9
Joined: Mon Jul 26, 2010 9:26 pm


Return to Developers

Who is online

Users browsing this forum: No registered users and 3 guests