public class SimpleMediaPlayer extends JMEItem implements ISimpleMediaPlayer, IInitable, uk.co.caprica.vlcj.player.direct.RenderCallback, uk.co.caprica.vlcj.player.direct.BufferFormatCallback
com.jme3.scene.Spatial.CullHint
INestable.IChildrenChangedListener
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CACHABLE_TYPE
The Constant CACHABLE_TYPE.
|
uk.co.caprica.vlcj.player.direct.DirectMediaPlayer |
mediaPlayer
The media player.
|
static java.util.ArrayList<SimpleMediaPlayer> |
mediaPlayers
The media players.
|
KEY_JMEITEMDATA
Constructor and Description |
---|
SimpleMediaPlayer(java.lang.String name,
java.util.UUID uuid)
Instantiates a new simple media player.
|
Modifier and Type | Method and Description |
---|---|
void |
addMediaPlayerEventListener(uk.co.caprica.vlcj.player.MediaPlayerEventAdapter mediaPlayerEventAdapter)
Adds the media player event listener.
|
void |
destroy()
Destroy.
|
void |
display(uk.co.caprica.vlcj.player.direct.DirectMediaPlayer mediaPlayer,
com.sun.jna.Memory[] nativeBuffers,
uk.co.caprica.vlcj.player.direct.BufferFormat bufferFormat) |
uk.co.caprica.vlcj.player.direct.BufferFormat |
getBufferFormat(int sourceWidth,
int sourceHeight) |
float |
getHeight()
Gets the height.
|
com.jme3.scene.Spatial |
getManipulableSpatial()
Gets the manipulable spatial.
|
float |
getPosition()
Gets the position.
|
boolean |
getRepeat()
Gets the repeat.
|
float |
getWidth()
Gets the width.
|
void |
initializeGeometry(com.jme3.asset.AssetManager assetManager)
Initialize geometry.
|
boolean |
isPlaying()
Checks if is playing.
|
void |
pause()
Pause.
|
void |
play()
Play.
|
void |
setActionOnVideoEndListener(IActionOnVideoEndListener actionOnVideoEndListener)
Sets the action on video end listener.
|
void |
setLocalResource(java.io.File file,
boolean autostart)
Sets the local resource.
|
void |
setLocalResource(java.lang.String localPath,
boolean autostart)
Sets the local resource.
|
void |
setPosition(float pos)
Sets the position.
|
void |
setRemoteResource(java.lang.String remotePath,
boolean autostart)
Sets the remote resource.
|
void |
setRepeat(boolean repeat)
Sets the repeat.
|
void |
setSize(float width,
float height)
Sets the size.
|
void |
setVisible(boolean isVisible)
Sets the visible.
|
void |
stop()
Stop.
|
void |
unpause()
Unpause.
|
addItem, addItemListener, behaviourAdded, centerItem, convertWorldVelocityToLocalVelocity, deRegisterChildrenChangedListener, getBehaviours, getBehaviours, getChildItems, getChildrenCount, getItemChildren, getItemListeners, getItemName, getMultiTouchDispatcher, getName, getParentItem, getRelativeLocation, getRelativeLocationOfWorldLocation, getRelativeRotation, getRelativeScale, getUUID, getWorldLocation, getWorldLocation, getWorldRotationDegrees, getZOrder, getZOrderManager, hasChildren, isVisible, registerChildrenChangedListener, removeAllItems, removeItem, removeItemListener, setInteractionEnabled, setItemListeners, setItemName, setParentItem, setRelativeLocation, setRelativeRotation, setRelativeScale, setWorldLocation, setZOrder, toString
attachChild, attachChildAt, childChange, clone, collideWith, deepClone, depthFirstTraversal, descendantMatches, descendantMatches, descendantMatches, detachAllChildren, detachChild, detachChildAt, detachChildNamed, getChild, getChild, getChildIndex, getChildren, getQuantity, getTriangleCount, getVertexCount, hasChild, read, setLodLevel, setMaterial, setModelBound, swapChildren, updateGeometricState, updateLogicalState, updateModelBound, write
addControl, addLight, breadthFirstTraversal, center, checkCulling, clone, getControl, getControl, getCullHint, getLastFrustumIntersection, getLocalCullHint, getLocalLightList, getLocalQueueBucket, getLocalRotation, getLocalScale, getLocalShadowMode, getLocalToWorldMatrix, getLocalTransform, getLocalTranslation, getNumControls, getParent, getQueueBucket, getShadowMode, getUserData, getUserDataKeys, getWorldBound, getWorldLightList, getWorldRotation, getWorldScale, getWorldTransform, getWorldTranslation, hasAncestor, localToWorld, lookAt, matches, move, move, removeControl, removeControl, removeFromParent, removeLight, rotate, rotate, rotateUpTo, runControlRender, scale, scale, setCullHint, setLastFrustumIntersection, setLocalRotation, setLocalRotation, setLocalScale, setLocalScale, setLocalScale, setLocalTransform, setLocalTranslation, setLocalTranslation, setName, setQueueBucket, setShadowMode, setUserData, worldToLocal
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
addItemListener, behaviourAdded, centerItem, convertWorldVelocityToLocalVelocity, getBehaviours, getBehaviours, getItemListeners, getMultiTouchDispatcher, getName, getParentItem, getRelativeLocation, getRelativeLocationOfWorldLocation, getRelativeRotation, getRelativeScale, getUUID, getWorldLocation, getWorldLocation, getWorldRotationDegrees, getZOrder, getZOrderManager, isVisible, removeItemListener, setInteractionEnabled, setItemListeners, setParentItem, setRelativeLocation, setRelativeRotation, setRelativeScale, setWorldLocation, setZOrder
addItem, deRegisterChildrenChangedListener, getChildItems, getChildrenCount, hasChildren, registerChildrenChangedListener, removeAllItems, removeItem
public static final java.lang.String CACHABLE_TYPE
public static java.util.ArrayList<SimpleMediaPlayer> mediaPlayers
public uk.co.caprica.vlcj.player.direct.DirectMediaPlayer mediaPlayer
public SimpleMediaPlayer(java.lang.String name, java.util.UUID uuid)
name
- the nameuuid
- the uuidpublic void addMediaPlayerEventListener(uk.co.caprica.vlcj.player.MediaPlayerEventAdapter mediaPlayerEventAdapter)
ISimpleMediaPlayer
addMediaPlayerEventListener
in interface ISimpleMediaPlayer
mediaPlayerEventAdapter
- the media player event adapterpublic void destroy()
ISimpleMediaPlayer
destroy
in interface ISimpleMediaPlayer
public void display(uk.co.caprica.vlcj.player.direct.DirectMediaPlayer mediaPlayer, com.sun.jna.Memory[] nativeBuffers, uk.co.caprica.vlcj.player.direct.BufferFormat bufferFormat)
display
in interface uk.co.caprica.vlcj.player.direct.RenderCallback
public uk.co.caprica.vlcj.player.direct.BufferFormat getBufferFormat(int sourceWidth, int sourceHeight)
getBufferFormat
in interface uk.co.caprica.vlcj.player.direct.BufferFormatCallback
public float getHeight()
ISimpleMediaPlayer
getHeight
in interface ISimpleMediaPlayer
public com.jme3.scene.Spatial getManipulableSpatial()
IItem
getManipulableSpatial
in interface IItem
public float getPosition()
ISimpleMediaPlayer
getPosition
in interface ISimpleMediaPlayer
public boolean getRepeat()
ISimpleMediaPlayer
getRepeat
in interface ISimpleMediaPlayer
public float getWidth()
ISimpleMediaPlayer
getWidth
in interface ISimpleMediaPlayer
public void initializeGeometry(com.jme3.asset.AssetManager assetManager)
IInitable
initializeGeometry
in interface IInitable
assetManager
- the asset managerpublic boolean isPlaying()
ISimpleMediaPlayer
isPlaying
in interface ISimpleMediaPlayer
public void pause()
ISimpleMediaPlayer
pause
in interface ISimpleMediaPlayer
public void play()
ISimpleMediaPlayer
play
in interface ISimpleMediaPlayer
public void setActionOnVideoEndListener(IActionOnVideoEndListener actionOnVideoEndListener)
ISimpleMediaPlayer
setActionOnVideoEndListener
in interface ISimpleMediaPlayer
actionOnVideoEndListener
- the new action on video end listenerpublic void setLocalResource(java.io.File file, boolean autostart)
ISimpleMediaPlayer
setLocalResource
in interface ISimpleMediaPlayer
file
- the fileautostart
- the autostartpublic void setLocalResource(java.lang.String localPath, boolean autostart)
ISimpleMediaPlayer
setLocalResource
in interface ISimpleMediaPlayer
localPath
- the local pathautostart
- the autostartpublic void setPosition(float pos)
ISimpleMediaPlayer
setPosition
in interface ISimpleMediaPlayer
pos
- the new positionpublic void setRemoteResource(java.lang.String remotePath, boolean autostart)
ISimpleMediaPlayer
setRemoteResource
in interface ISimpleMediaPlayer
remotePath
- the remote pathautostart
- the autostartpublic void setRepeat(boolean repeat)
ISimpleMediaPlayer
setRepeat
in interface ISimpleMediaPlayer
repeat
- the new repeatpublic void setSize(float width, float height)
ISimpleMediaPlayer
setSize
in interface ISimpleMediaPlayer
width
- the widthheight
- the heightpublic void setVisible(boolean isVisible)
IItem
setVisible
in interface IItem
setVisible
in class JMEItem
isVisible
- the new visiblepublic void stop()
public void unpause()
ISimpleMediaPlayer
unpause
in interface ISimpleMediaPlayer