net.sourceforge.openutils.mgnlmedia.media.types.externals
Class YoutubeSupport

java.lang.Object
  extended by net.sourceforge.openutils.mgnlmedia.media.types.externals.YoutubeSupport
All Implemented Interfaces:
ExternalVideoSupport

public class YoutubeSupport
extends Object
implements ExternalVideoSupport

ExternalVideoSupport specific for Youtube URLs.

Version:
$Id: YoutubeSupport.java 3482 2011-05-22 17:36:31Z fgiust $
Author:
fgiust

Constructor Summary
YoutubeSupport()
           
 
Method Summary
 boolean canHandle(String url)
          Can this VideoSupport class handle this kind of urls? Usually done by checking the domain.
 String getFlvUrl(String shareUrl)
          Return the FLV url from the share url.
 String getMediaName(String shareUrl)
          Return the video name from the share url.
 String getPreviewUrl(String shareUrl)
          Return the preview url from the share url.
 boolean isEnabled()
          Is this VideoSupport class enabled?
 void setEnabled(boolean enabled)
          Sets the enabled.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

YoutubeSupport

public YoutubeSupport()
Method Detail

isEnabled

public boolean isEnabled()
Is this VideoSupport class enabled?

Specified by:
isEnabled in interface ExternalVideoSupport
Returns:
true if this video support class should be used when an external video is loaded

setEnabled

public void setEnabled(boolean enabled)
Sets the enabled.

Parameters:
enabled - the enabled to set

canHandle

public boolean canHandle(String url)
Can this VideoSupport class handle this kind of urls? Usually done by checking the domain.

Specified by:
canHandle in interface ExternalVideoSupport
Parameters:
url - share URL
Returns:
true if this class can handle video with the given URL

getFlvUrl

public String getFlvUrl(String shareUrl)
Return the FLV url from the share url. This method is guaranteed to be called only if canHandle() returned true for the same URL.

Specified by:
getFlvUrl in interface ExternalVideoSupport
Parameters:
shareUrl - share URL
Returns:
flv direct URL

getPreviewUrl

public String getPreviewUrl(String shareUrl)
Return the preview url from the share url. This method is guaranteed to be called only if canHandle() returned true for the same URL.

Specified by:
getPreviewUrl in interface ExternalVideoSupport
Parameters:
shareUrl - share URL
Returns:
preview URL (may be null)

getMediaName

public String getMediaName(String shareUrl)
Return the video name from the share url. This method is guaranteed to be called only if canHandle() returned true for the same URL.

Specified by:
getMediaName in interface ExternalVideoSupport
Parameters:
shareUrl - share URL
Returns:
video name (name of the node that will be created in the media repository)


Copyright © 2008-2011 Openmind. All Rights Reserved.