Class VideoPlayer
- java.lang.Object
-
- org.silverpeas.core.contribution.content.form.displayers.VideoPlayer
-
public class VideoPlayer extends Object
An (X)HTML video player with javascript. The video player is set up and rendered by using javascript.
-
-
Constructor Summary
Constructors Constructor Description VideoPlayer()
Creates a new displayer of a video player with the default settings: no video to play, autoplay set at false, the width at 425 pixels and the height at 300 pixels.VideoPlayer(String videoURL, boolean autoplay)
Creates a new displayer of a video player that will play the video at the specified URL.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getBackgroundColor()
Gets the background color (CSS RGB) of the player.int
getHeight()
Gets the height of the video player (300 by default).String
getMimeType()
Gets the mime-type of the video.String
getPosterURL()
Gets the URL of the poster to display before the video starts.String
getVideoURL()
Gets the URL of the video to play.int
getWidth()
Gets the width of the video player (425 by default).void
init(org.apache.ecs.ConcreteElement element)
Initializes the video player by declaring the required ressources (script, stylesheets, ...).boolean
isAutoplay()
Should the video player autostart?void
renderIn(org.apache.ecs.ConcreteElement element)
Renders the video player into the specified (X)HTML element.void
setAutoplay(boolean autoplay)
Sets the video autoplaying propertyvoid
setBackgroundColor(String backgroundColor)
Sets the background color of the player.void
setHeight(int height)
Sets the height of the video player(in pixels).void
setMimeType(String mimeType)
Sets the mime-type of the video.void
setPosterURL(String posterURL)
Sets the URL of the poster to display before the video starts.void
setVideoURL(String videoURL)
Sets the URL of the video to play.void
setWidth(int width)
Sets the width of the video player (in pixels).
-
-
-
Constructor Detail
-
VideoPlayer
public VideoPlayer(String videoURL, boolean autoplay)
Creates a new displayer of a video player that will play the video at the specified URL. By default the width and the height of the video player is respectively 425 pixels and 300 pixels.- Parameters:
videoURL
- the URL of the video to play.autoplay
- the video playing should be autostarted?
-
VideoPlayer
public VideoPlayer()
Creates a new displayer of a video player with the default settings: no video to play, autoplay set at false, the width at 425 pixels and the height at 300 pixels.
-
-
Method Detail
-
isAutoplay
public boolean isAutoplay()
Should the video player autostart?- Returns:
- true if the video should be autoplayed, false otherwise.
-
setAutoplay
public void setAutoplay(boolean autoplay)
Sets the video autoplaying property- Parameters:
autoplay
- true to autostart the video, false otherwise.
-
getVideoURL
public String getVideoURL()
Gets the URL of the video to play.- Returns:
- the video URL.
-
setVideoURL
public void setVideoURL(String videoURL)
Sets the URL of the video to play.- Parameters:
videoURL
- the URL of the video to play.
-
getMimeType
public String getMimeType()
Gets the mime-type of the video.- Returns:
- the mime-type.
-
setMimeType
public void setMimeType(String mimeType)
Sets the mime-type of the video.- Parameters:
mimeType
- the mime-type.
-
getPosterURL
public String getPosterURL()
Gets the URL of the poster to display before the video starts.- Returns:
- the poster URL.
-
setPosterURL
public void setPosterURL(String posterURL)
Sets the URL of the poster to display before the video starts.- Parameters:
posterURL
- the URL of the poster.
-
getHeight
public int getHeight()
Gets the height of the video player (300 by default).- Returns:
- the video height.
-
setHeight
public void setHeight(int height)
Sets the height of the video player(in pixels).- Parameters:
height
- the video height.
-
getWidth
public int getWidth()
Gets the width of the video player (425 by default).- Returns:
- the video width.
-
setWidth
public void setWidth(int width)
Sets the width of the video player (in pixels).- Parameters:
width
- the video width.
-
getBackgroundColor
public String getBackgroundColor()
Gets the background color (CSS RGB) of the player.- Returns:
- the background color.
-
setBackgroundColor
public void setBackgroundColor(String backgroundColor)
Sets the background color of the player.- Parameters:
backgroundColor
- the background color.
-
init
public void init(org.apache.ecs.ConcreteElement element)
Initializes the video player by declaring the required ressources (script, stylesheets, ...). This method is required before any call of the display method.- Parameters:
element
- an XHTML element into which the resources declaration will be rendered.
-
renderIn
public void renderIn(org.apache.ecs.ConcreteElement element)
Renders the video player into the specified (X)HTML element.- Parameters:
element
- an (X)HTML element into which the video player will be rendered.
-
-