Package jltk.gui

Class Video


  • public class Video
    extends Component
    The Video class represents a video in the gui. You can use a video from file or web.
    Version:
    22.08.2022
    Author:
    ms
    • Constructor Detail

      • Video

        public Video​(double pLeft,
                     double pTop,
                     double pWidth,
                     double pHeight,
                     String pVideoPath)
        Creates a video view with the specified size. As video path you can use a file path or an url.
        Parameters:
        pLeft - The horizontal coordinate
        pTop - The vertical coordinate
        pWidth - The width of the Video
        pHeight - The height of the Video
        pVideoPath - A file or url
      • Video

        public Video​(double pLeft,
                     double pTop,
                     double pWidth,
                     String pVideoPath)
        Creates a video view with the specified width. The height is scaled to preserve ratio. As video path you can use a file path or an url.
        Parameters:
        pLeft - The horizontal coordinate
        pTop - The vertical coordinate
        pWidth - The width of the Video
        pVideoPath - A file or url
      • Video

        public Video​(Window pWindow,
                     double pLeft,
                     double pTop,
                     double pWidth,
                     String pVideoPath)
        Creates a video view on the specified window with the specified width. The height is scaled to preserve ratio. As video path you can use a file path or an url.
        Parameters:
        pLeft - The horizontal coordinate
        pTop - The vertical coordinate
        pWidth - The width of the Video
        pVideoPath - A file or url
      • Video

        public Video​(Window pWindow,
                     double pLeft,
                     double pTop,
                     double pWidth,
                     double pHeight,
                     String pVideoPath)
        Creates a video view on the specified window with the specified size. As video path you can use a file path or an url.
        Parameters:
        pLeft - The horizontal coordinate
        pTop - The vertical coordinate
        pWidth - The width of the Video
        pHeight - The height of the Video
        pVideoPath - A file or url
    • Method Detail

      • setWidth

        public void setWidth​(double pWidth)
        Set the new width of this media to the specified value.
        Parameters:
        pWidth - The new width of this component
      • setHeight

        public void setHeight​(double pHeight)
        Set the new height of this media to the specified value.
        Parameters:
        pHeight - The new height of this component
      • setSize

        public void setSize​(double pWidth,
                            double pHeight)
        Sets the new size of the media.
        Parameters:
        pWidth - the new width
        pHeight - the new height
      • getDuration

        public double getDuration()
        Return the Duration of this video in seconds
        Returns:
        The video duration in second
      • getCurrentTime

        public double getCurrentTime()
        Return the current time in seconds
        Returns:
        The current time
      • getVolume

        public double getVolume()
        Return the current video playback volume.
        Returns:
        The video playback volume
      • play

        public void play()
        Starts playing the video.
      • autoplay

        public void autoplay()
      • stop

        public void stop()
        Stops playing the video. (Reset everything to start)
      • pause

        public void pause()
        Pauses playing the video.
      • setVolume

        public void setVolume​(double pVolume)
        Set the video playback volume. By default volume is 1.0.
        Parameters:
        pVolume - The video playback volume