Class Audio

All Implemented Interfaces:
HasAllDragAndDropHandlers, HasAllFocusHandlers, HasAllGestureHandlers, HasAllKeyHandlers, HasAllMediaHandlers, HasAllMouseHandlers, HasAllTouchHandlers, HasBlurHandlers, HasCanPlayThroughHandlers, HasClickHandlers, HasDoubleClickHandlers, HasDragEndHandlers, HasDragEnterHandlers, HasDragHandlers, HasDragLeaveHandlers, HasDragOverHandlers, HasDragStartHandlers, HasDropHandlers, HasEndedHandlers, HasFocusHandlers, HasGestureChangeHandlers, HasGestureEndHandlers, HasGestureStartHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasKeyUpHandlers, HasLoadedMetadataHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasProgressHandlers, HasTouchCancelHandlers, HasTouchEndHandlers, HasTouchMoveHandlers, HasTouchStartHandlers, HasAttachHandlers, HasHandlers, EventListener, Focusable, HasEnabled, HasFocus, HasVisibility, IsWidget, SourcesClickEvents, SourcesFocusEvents, SourcesKeyboardEvents, SourcesMouseEvents

public class Audio extends MediaBase

A widget representing an <audio> element.

Experimental API: This API is still under development and is subject to change.

This widget may not be supported on all browsers.
  • Constructor Details

  • Method Details

    • createIfSupported

      public static Audio createIfSupported()
      Return a new Audio if supported, and null otherwise.
      Returns:
      a new Audio if supported, and null otherwise
    • isSupported

      public static boolean isSupported()
      Runtime check for whether the audio element is supported in this browser.
      Returns:
      whether the audio element is supported
    • getAudioElement

      public AudioElement getAudioElement()
      Returns the attached AudioElement.
      Returns:
      the AudioElement