Holger's
Java API

com.antelmann.net.web
Class YouTubeVideo

java.lang.Object
  extended by com.antelmann.db.AbstractDBEntry
      extended by com.antelmann.net.web.YouTubeVideo
All Implemented Interfaces:
DBEntry, Imageable, DetailedString, Serializable

@Todo(value="needs work after V2 has been deprecated")
public class YouTubeVideo
extends AbstractDBEntry
implements DetailedString, Imageable

wraps a YouTube video ID and provides access to online meta data for the video

Since:
13.12.2013, 15:09:45
Author:
holger
See Also:
JYouTubeField, Serialized Form

Field Summary
 
Fields inherited from interface com.antelmann.db.DBEntry
ENTRY_FLAVOR, ENTRY_LIST_FLAVOR
 
Constructor Summary
YouTubeVideo(String id)
           
 
Method Summary
 void clean()
           
 void ensureLoaded()
           
static String extractID(String urlString)
          attempts to extract the video id from the given URL
 String getAuthor()
           
 String getDescription()
           
 Image getDisplayIcon()
          returns an image that is suitable for use as an icon for this instance.
 Image getDisplayImage()
          returns an image that represents a visual representation of this instance.
 long getDuration()
           
 GeoPoint getGeoPoint()
           
 Map<String,URL> getImageMap()
           
 Image getLargestImage()
           
 Date getModifiedDate()
           
 Date getPublishDate()
           
 double getRating()
           
 String getTitle()
           
 Date getUploadDate()
           
 long getViewCount()
           
 XmlHelper getXmlInfo()
           
 boolean isLoaded()
           
 boolean isValid()
           
 void loadContent()
           
 void loadContentFrom(InputSource source)
           
 void openBrowser(boolean fullScreen)
           
 String toDetailedString()
          provides full details of this instance in a String.
 
Methods inherited from class com.antelmann.db.AbstractDBEntry
equals, getID, hashCode, hashEntry, sameEntry, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

YouTubeVideo

public YouTubeVideo(String id)
Method Detail

openBrowser

public void openBrowser(boolean fullScreen)
                 throws IOException
Throws:
IOException

clean

public void clean()

isLoaded

public boolean isLoaded()

loadContent

public void loadContent()
                 throws IOException,
                        SAXException,
                        ParserConfigurationException,
                        UnexpectedDataException
Throws:
IOException
SAXException
ParserConfigurationException
UnexpectedDataException

loadContentFrom

public void loadContentFrom(InputSource source)
                     throws SAXException,
                            IOException,
                            ParserConfigurationException
Throws:
SAXException
IOException
ParserConfigurationException

ensureLoaded

public void ensureLoaded()
                  throws RuntimeException
Throws:
RuntimeException

getXmlInfo

public XmlHelper getXmlInfo()

toDetailedString

public String toDetailedString()
Description copied from interface: DetailedString
provides full details of this instance in a String. In case the String contains multiple lines, it is recommended to use '\n' rather than the platform specific line-break for better compatibility.

Specified by:
toDetailedString in interface DetailedString
Returns:
a (potentially multi-line) String providing full details on this object instance

isValid

public boolean isValid()

getTitle

public String getTitle()

getPublishDate

public Date getPublishDate()

getModifiedDate

public Date getModifiedDate()

getAuthor

public String getAuthor()

getRating

public double getRating()

getViewCount

public long getViewCount()

getDescription

public String getDescription()

getUploadDate

public Date getUploadDate()

getDuration

public long getDuration()

getGeoPoint

public GeoPoint getGeoPoint()
                     throws FormatException
Throws:
FormatException

getDisplayImage

public Image getDisplayImage()
                      throws IOException
Description copied from interface: Imageable
returns an image that represents a visual representation of this instance. The method may return null;

Specified by:
getDisplayImage in interface Imageable
Throws:
IOException

getDisplayIcon

public Image getDisplayIcon()
                     throws IOException
Description copied from interface: Imageable
returns an image that is suitable for use as an icon for this instance. The method may return null;

Specified by:
getDisplayIcon in interface Imageable
Throws:
IOException

getImageMap

public Map<String,URL> getImageMap()
                            throws IOException
Throws:
IOException

getLargestImage

public Image getLargestImage()
                      throws IOException
Throws:
IOException

extractID

public static String extractID(String urlString)
attempts to extract the video id from the given URL



(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads