Share this page

com.hp.lft.sdk.web

## Interface MediaControl

- All Known Subinterfaces:
    AudioControl, VideoControl

      public interface MediaControl

  Web methods for playing media (audio/video) files embedded in the HTML page.

- - ### Method Summary

    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `getCurrentSource()` Returns the URL of the media file currently selected in the browser window.
    `int` | `getDuration()` Returns the length of the currently selected media file (in milliseconds).
    `double` | `getPlaybackRate()` Returns the speed of the media playback.
    `int` | `getPlaybackTime()` Returns the current playback position in the media file (in milliseconds).
    `java.lang.String[]` | `getSources()` Returns a collection of all media file source URLs.
    `double` | `getVolume()` Returns the volume used when playing this media file.
    `boolean` | `hasAutoPlay()` Indicates whether this media file starts playing as soon as it loads.
    `boolean` | `hasPlaybackControls()` Indicates whether this media player should display playback controls.
    `boolean` | `isMuted()` Indicates whether the media volume is muted.
    `boolean` | `isPlaying()` Returns whether this media is currently playing.
    `boolean` | `isPlayInLoop()` Indicates whether this media file should start playing again from the beginning as soon as it finishes playing.
    `void` | `pause()` Pauses the media playback.
    `void` | `play()` Plays the media file.
    `void` | `reload()` Reloads the media file.

- - ### Method Detail

    - #### hasAutoPlay

          boolean hasAutoPlay()
                       throws GeneralLeanFtException

      Indicates whether this media file starts playing as soon as it loads.
      Returns:
        true, if the media file starts playing as soon as it loads.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### hasPlaybackControls

          boolean hasPlaybackControls()
                               throws GeneralLeanFtException

      Indicates whether this media player should display playback controls.
      Returns:
        true, if the media player should display playback controls.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### getCurrentSource

          java.lang.String getCurrentSource()
                                     throws GeneralLeanFtException

      Returns the URL of the media file currently selected in the browser window.
      Returns:
        the URL of the media file currently selected in the browser window.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### isPlayInLoop

          boolean isPlayInLoop()
                        throws GeneralLeanFtException

      Indicates whether this media file should start playing again from the beginning as soon as it finishes playing.
      Returns:
        true, if the media file should start playing again from the beginning as soon as it finishes playing.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### isMuted

          boolean isMuted()
                   throws GeneralLeanFtException

      Indicates whether the media volume is muted.
      Returns:
        true, if the media volume is muted.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### getPlaybackRate

          double getPlaybackRate()
                          throws GeneralLeanFtException

      Returns the speed of the media playback. Possible values: Numbers with up to two decimal places. For example, 0.51 or 1.00.
      Returns:
        the speed of the media playback. Possible values: Numbers with up to two decimal places. For example, 0.51 or 1.00.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### isPlaying

          boolean isPlaying()
                     throws GeneralLeanFtException

      Returns whether this media is currently playing.
      Returns:
        true, if the media is currently playing.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### getVolume

          double getVolume()
                    throws GeneralLeanFtException

      Returns the volume used when playing this media file. Possible values: Numbers with up to two decimal places. For example, 0.51 or 1.00.
      Returns:
        the volume used when playing the media file. Possible values: Numbers with up to two decimal places. For example, 0.51 or 1.00.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### getPlaybackTime

          int getPlaybackTime()
                       throws GeneralLeanFtException

      Returns the current playback position in the media file (in milliseconds).
      Returns:
        the current playback position in the media file (in milliseconds).
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### getDuration

          int getDuration()
                   throws GeneralLeanFtException

      Returns the length of the currently selected media file (in milliseconds).
      Returns:
        the length of the currently selected media file (in milliseconds).
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### getSources

          java.lang.String[] getSources()
                                 throws GeneralLeanFtException

      Returns a collection of all media file source URLs. A media file may have multiple URL addresses for use in different browser types. If the src attribute was set, but no sources were defined in the HTML, the Sources property will return a collection containing a single item with the "src" value.
      Returns:
        a collection of all media file source URLs.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### reload

          void reload()
               throws GeneralLeanFtException

      Reloads the media file.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### play

          void play()
             throws GeneralLeanFtException

      Plays the media file.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

    - #### pause

          void pause()
              throws GeneralLeanFtException

      Pauses the media playback.
      Throws:
        `GeneralLeanFtException` - if an error occurs during execution.

Tips to improve your search results... UFT Developer Java SDK Reference Version 15.0-15.0.2 UFT Developer SDK Reference All View Local Help Center View Online Help Center back Go back in browser history forward Go forward in browser history Remove search highlights next topic Go to next topic previous topic Go to previous topic Print the current topic Version: