Package com.jogamp.graph.ui.widgets
Class MediaPlayer
- java.lang.Object
-
- com.jogamp.graph.ui.Shape
-
- com.jogamp.graph.ui.Group
-
- com.jogamp.graph.ui.widgets.Widget
-
- com.jogamp.graph.ui.widgets.MediaPlayer
-
- All Implemented Interfaces:
Container
public class MediaPlayer extends Widget
Media playerWidget, embedding aMediaButtonand its controls.- See Also:
#MediaPlayer(int, Scene, GLMediaPlayer, Uri, int, float, boolean, float, List)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.jogamp.graph.ui.Group
Group.Layout
-
Nested classes/interfaces inherited from class com.jogamp.graph.ui.Shape
Shape.DrawListener, Shape.EventInfo, Shape.ForwardKeyListener, Shape.ForwardMouseListener, Shape.Listener, Shape.MouseGestureAdapter, Shape.MouseGestureListener, Shape.MoveListener, Shape.PointerListener, Shape.Visitor1, Shape.Visitor2
-
-
Field Summary
Fields Modifier and Type Field Description static floatCtrlButtonHeightstatic floatCtrlButtonWidthstatic com.jogamp.math.Vec4fCtrlCellColstatic com.jogamp.math.Vec2fFixedSymSizestatic com.jogamp.math.Vec2fSymSpacing-
Fields inherited from class com.jogamp.graph.ui.Shape
ZAscendingComparator, ZDescendingComparator
-
-
Constructor Summary
Constructors Constructor Description MediaPlayer(int renderModes, Scene scene, GLMediaPlayer mPlayer, Uri medium, float aratio, boolean letterBox, float zoomSize, boolean enableStills, List<Shape> customCtrls)Constructs aMediaPlayer, i.e.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringgetInfo(int ptsMS, int durationMS, GLMediaPlayer mPlayer, boolean full)static StringgetInfo(long currentMillis, GLMediaPlayer mPlayer, boolean full)static StringgetMultilineTime(int ptsMS, int durationMS)static StringgetMultilineTime(long currentMillis, GLMediaPlayer mPlayer)voidsetSubtitleColor(com.jogamp.math.Vec4f color, float blend)Sets text/ASS subtitle colorsvoidsetSubtitleParams(Font subFont, float subLineHeightPct, float subLineDY, Alignment subAlignment)Sets text/ASS subtitle parameter, enabling subtitle renderingvoidsetSubtitlesEnabled(boolean v)Toggle enabling subtitle rendering-
Methods inherited from class com.jogamp.graph.ui.Group
addShape, addShapes, contains, disableTopLevelWidget, enableTopLevelWidget, getBounds, getClipMvFrustum, getClipOnBounds, getFixedSize, getFixedSize, getLayout, getRelayoutOnDirtyShapes, getRenderedShapes, getShapeByID, getShapeByIdx, getShapeByName, getShapeCount, getShapes, getSubString, hasColorChannel, isCullingEnabled, isGroup, isOutside, isOutside2, isPMvCullingEnabled, isTopLevelWidget, removeAllShapes, removeShape, removeShape, removeShapes, removeShapes, replaceShape, setClipMvFrustum, setClipOnBounds, setFixedSize, setFixedSize, setLayout, setPMvCullingEnabled, setRelayoutOnDirtyShapes
-
Methods inherited from class com.jogamp.graph.ui.Shape
addActivationListener, addKeyListener, addMouseListener, applyMatToMv, clear, destroy, draw, drawToSelect, getActiveColorMod, getAdjustedZ, getBorderColor, getBorderThickness, getBounds, getBounds, getColor, getID, getMat, getMat, getName, getPadding, getParent, getPixelPerShapeUnit, getPixelPerShapeUnit, getPixelPerShapeUnit, getPosition, getPressedColorMod, getRotation, getRotationPivot, getScale, getScaledDepth, getScaledHeight, getScaledWidth, getSurfacePort, getSurfaceSize, getSurfaceSize, getSurfaceSize, getToggleOffColorMod, getToggleOnColorMod, getTooltip, hasBorder, hasPadding, isActivable, isActive, isDiscarded, isDraggable, isFixedARatioResize, isInteractive, isMatIdentity, isPressed, isResizable, isToggleable, isToggleOn, isVisible, markShapeDirty, markStateDirty, move, move, moveTo, moveTo, onClicked, onDraw, onHover, onMove, onToggle, receiveKeyEvents, receiveMouseEvents, removeActivationListener, removeKeyListener, removeMouseListener, removeToolTip, runSynced, scale, scale, setActivable, setActiveColorMod, setBorder, setBorderColor, setBorderColor, setColor, setColor, setDiscarded, setDragAndResizable, setDraggable, setFixedARatioResize, setID, setInteractive, setName, setPaddding, setPMVMatrix, setPMVMatrix, setPressed, setPressedColorMod, setResizable, setRotation, setRotationPivot, setRotationPivot, setScale, setScale, setToggle, setToggleable, setToggleOffColorMod, setToggleOnColorMod, setToolTip, setVisible, shapeToWinCoord, shapeToWinCoord, shapeToWinCoord, toggle, toString, updateMat, validate, validate, validate, winToShapeCoord, winToShapeCoord, winToShapeCoord
-
-
-
-
Field Detail
-
FixedSymSize
public static final com.jogamp.math.Vec2f FixedSymSize
-
SymSpacing
public static final com.jogamp.math.Vec2f SymSpacing
-
CtrlButtonWidth
public static final float CtrlButtonWidth
- See Also:
- Constant Field Values
-
CtrlButtonHeight
public static final float CtrlButtonHeight
- See Also:
- Constant Field Values
-
CtrlCellCol
public static final com.jogamp.math.Vec4f CtrlCellCol
-
-
Constructor Detail
-
MediaPlayer
public MediaPlayer(int renderModes, Scene scene, GLMediaPlayer mPlayer, Uri medium, float aratio, boolean letterBox, float zoomSize, boolean enableStills, List<Shape> customCtrls)Constructs aMediaPlayer, i.e. its shapes and controls.- Parameters:
renderModes- Graph'sRegionrender modes, seecreate(..).scene- the usedSceneto query parameter and access rendering loopmPlayer- freshGLMediaPlayerinstance owned by thisMediaPlayer, may be customized via e.g.GLMediaPlayer.setTextureMinMagFilter(int[]).medium-Uristream source, either a file or network sourcearatio- aspect ratio of the resultingShape, usually 16.0f/9.0f or 4.0f/3.0f, which also denotes the width of this shape while using height 1.0.letterBox- togglesGLMediaPlayer.setARatioLetterbox(boolean, Vec4f)on or offzoomSize- zoom-size (0..1] for zoom-out controlenableStills- passtrueto enable still images on the time slider on mouse-over, involves a 2nd internalGLMediaPlayerinstancecustomCtrls- optional custom controls, maybe an empty list
-
-
Method Detail
-
setSubtitlesEnabled
public void setSubtitlesEnabled(boolean v)
Toggle enabling subtitle rendering
-
setSubtitleParams
public void setSubtitleParams(Font subFont, float subLineHeightPct, float subLineDY, Alignment subAlignment)
Sets text/ASS subtitle parameter, enabling subtitle rendering- Parameters:
subFont- text/ASS subtitle font, passnullforFontFactory.getDefaultFont()FontFactory.getFallbackFont()is usedif providing a better coverageof a Text/ASS subtitle line.subLineHeightPct- text/ASS subtitle line height percentage, defaults toMediaButton.DEFAULT_ASS_SUB_HEIGHTsubLineDY- text/ASS y-axis offset to bottom in line-height, defaults toMediaButton.DEFAULT_ASS_SUB_POSsubAlignment- text/ASS subtitle alignment, defaults to#DEFAULT_ASS_SUB_ALIGNMENT
-
setSubtitleColor
public void setSubtitleColor(com.jogamp.math.Vec4f color, float blend)Sets text/ASS subtitle colors- Parameters:
color- color for the text/ASS, defaults toMediaButton.DEFAULT_ASS_SUB_COLORblend- blending alpha (darkness), defaults toMediaButton.DEFAULT_ASS_SUB_BLEND
-
getInfo
public static String getInfo(long currentMillis, GLMediaPlayer mPlayer, boolean full)
-
getInfo
public static String getInfo(int ptsMS, int durationMS, GLMediaPlayer mPlayer, boolean full)
-
getMultilineTime
public static String getMultilineTime(long currentMillis, GLMediaPlayer mPlayer)
-
getMultilineTime
public static String getMultilineTime(int ptsMS, int durationMS)
-
-