Class Player

  • All Implemented Interfaces:
    Visual, javafx.css.Styleable, javafx.event.EventTarget

    public final class Player
    extends javafx.scene.Group
    implements Visual
    Author:
    Group 3 Based on: https://github.com/caprica/vlcj-javafx-demo/commit/a057335a1a0ad5761e6d78c469afe1b5a80a9f86
    • Field Summary

      • Fields inherited from class javafx.scene.Node

        BASELINE_OFFSET_SAME_AS_HEIGHT
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Player​(double width, double height, uk.co.caprica.vlcj.factory.MediaPlayerFactory fact)
      Constructor.Make a new player.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void free()
      Release native resources.
      void hideControls()
      Hide the control box.
      void load​(byte[] mediaBytes, java.lang.Double offset)
      Play media "from" an input stream.Warning: I'm writing your stream to a temp file as vlcj really doesn't enjoy streams.
      void load​(java.lang.String mrl, java.lang.Double newoffset)
      Play media from an MRL.
      void pause()
      Pause the media if possible.
      void play()
      Play the media if possible.
      void setLoop​(java.lang.Boolean loop)
      Set playback loop.
      void setSeek​(java.lang.Double seekOffset)
      Set player offset.
      void setSize​(SizeObj size)
      Resize the player.
      void setVisualProps​(VisualProps props)
      Set properties.
      void showControls()
      Show the control box.
      • Methods inherited from class javafx.scene.Group

        autoSizeChildrenProperty, getChildren, isAutoSizeChildren, layoutChildren, minHeight, minWidth, prefHeight, prefWidth, setAutoSizeChildren
      • Methods inherited from class javafx.scene.Parent

        computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, getBaselineOffset, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, requestLayout, requestParentLayout, setNeedsLayout, updateBounds
      • Methods inherited from class javafx.scene.Node

        accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClassCssMetaData, getClip, getContentBias, getCssMetaData, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInitialCursor, getInitialFocusTraversable, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isResizable, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, maxHeight, maxWidth, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resize, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface javafx.css.Styleable

        getStyleableNode
    • Constructor Detail

      • Player

        protected Player​(double width,
                         double height,
                         uk.co.caprica.vlcj.factory.MediaPlayerFactory fact)
        Constructor.Make a new player.
        Parameters:
        width - Initial target width.
        height - Initial target height.
        fact - Common factory for the embedded media player.
    • Method Detail

      • load

        public void load​(java.lang.String mrl,
                         java.lang.Double newoffset)
        Play media from an MRL.
        Parameters:
        mrl - Media location.
        newoffset - Seek offset (in seconds).
      • load

        public void load​(byte[] mediaBytes,
                         java.lang.Double offset)
                  throws java.io.IOException
        Play media "from" an input stream.Warning: I'm writing your stream to a temp file as vlcj really doesn't enjoy streams. As such, this is really slow.
        Parameters:
        mediaBytes - media in memory as bytes.
        offset - Offset to start at.
        Throws:
        java.io.IOException - Couldn't open or write to temp file.
      • setSeek

        public void setSeek​(java.lang.Double seekOffset)
        Set player offset.
        Parameters:
        seekOffset - Offset.
      • setLoop

        public void setLoop​(java.lang.Boolean loop)
        Set playback loop.
        Parameters:
        loop - loop playback.
      • pause

        public void pause()
        Pause the media if possible.
      • play

        public void play()
        Play the media if possible.
      • setVisualProps

        public void setVisualProps​(VisualProps props)
        Set properties.
        Specified by:
        setVisualProps in interface Visual
        Parameters:
        props - Properties.
      • setSize

        public void setSize​(SizeObj size)
        Resize the player.
        Specified by:
        setSize in interface Visual
        Parameters:
        size - Size to target.
      • showControls

        public void showControls()
        Show the control box.
      • hideControls

        public void hideControls()
        Hide the control box.
      • free

        public void free()
        Release native resources.