congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ItemNode.getFirstResource
Code IndexAdd Tabnine to your IDE (free)

How to use
getFirstResource
method
in
org.cybergarage.upnp.std.av.server.object.item.ItemNode

Best Java code snippets using org.cybergarage.upnp.std.av.server.object.item.ItemNode.getFirstResource (Showing top 3 results out of 315)

origin: cybergarage/cybergarage-upnp

public boolean setAVTransportURI(
    Device dev,
    ItemNode itemNode)
{
  if (dev == null)
    return false;
  
  ResourceNode resNode = itemNode.getFirstResource();
  if (resNode == null)
    return false;
  String resURL = resNode.getURL();
  if (resURL == null || resURL.length() <= 0)
    return false;
  
  Service avTransService = dev.getService(AVTransport.SERVICE_TYPE);
  if (avTransService == null)
    return false;
  
  Action action = avTransService.getAction(AVTransport.SETAVTRANSPORTURI);
  if (action == null)
    return false;
  
  action.setArgumentValue(AVTransport.INSTANCEID, "0");
  action.setArgumentValue(AVTransport.CURRENTURI, resURL);
  action.setArgumentValue(AVTransport.CURRENTURIMETADATA, "");
  
  return action.postControlAction();
}

origin: geniusgithub/MediaPlayer

public boolean setAVTransportURI(
    Device dev,
    ItemNode itemNode)
{
  if (dev == null)
    return false;
  
  ResourceNode resNode = itemNode.getFirstResource();
  if (resNode == null)
    return false;
  String resURL = resNode.getURL();
  if (resURL == null || resURL.length() <= 0)
    return false;
  
  Service avTransService = dev.getService(AVTransport.SERVICE_TYPE);
  if (avTransService == null)
    return false;
  
  Action action = avTransService.getAction(AVTransport.SETAVTRANSPORTURI);
  if (action == null)
    return false;
  
  action.setArgumentValue(AVTransport.INSTANCEID, "0");
  action.setArgumentValue(AVTransport.CURRENTURI, resURL);
  action.setArgumentValue(AVTransport.CURRENTURIMETADATA, "");
  
  return action.postControlAction();
}

origin: geniusgithub/MediaPlayer

   public static MediaItem create(ItemNode node){
     MediaItem item = new MediaItem();
     item.setStringid(node.getID());
     item.setTitle(node.getTitle());
     item.setObjectClass(node.getUPnPClass());
     item.setDate(node.getDateTime());
     item.setAlbum(node.getAlbum());
     item.setAlbumUri(node.getAlbumArtURI());
     item.setArtist(node.getArtist());
     ResourceNode resourceNode = node.getFirstResource();
     if (resourceNode != null){
       item.setRes(resourceNode.getURL());
       item.setprotocolInfo(resourceNode.getProtocolInfo());
       item.setDuration(DlnaUtil.formatDurationString(resourceNode.getDuration()));
       item.setSize(DlnaUtil.formatSizeString(resourceNode.getSize()));
     }
    return item;
   }
}
org.cybergarage.upnp.std.av.server.object.itemItemNodegetFirstResource

Popular methods of ItemNode

  • getID
  • <init>
  • getDateTime
  • isItemNode
  • addNode
  • addResourceNode
  • getContentDirectory
  • getContentInputStream
  • getContentLength
  • getDate
  • getMimeType
  • getNResourceNodeLists
  • getMimeType,
  • getNResourceNodeLists,
  • getPropertyAttribureValue,
  • getPropertyLongValue,
  • getPropertyValue,
  • getProtocolInfo,
  • getResource,
  • getResourceNode,
  • getTitle

Popular in Java

  • Making http requests using okhttp
  • startActivity (Activity)
  • compareTo (BigDecimal)
  • getSystemService (Context)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now