Packages

  • package root

    ScalaFX is a UI DSL written within the Scala Language that sits on top of JavaFX 2.x and and JavaFX 8.

    ScalaFX is a UI DSL written within the Scala Language that sits on top of JavaFX 2.x and and JavaFX 8. This means that every ScalaFX application is also a valid Scala application. By extension it supports full interoperability with Java and can run anywhere the Java Virtual Machine (JVM) and JavaFX 2.0 or JavaFX 8 are supported.

    Package Structure

    ScalaFX package structure corresponds to JavaFX package structure, for instance scalafx.animation corresponds to javafx.animation.

    Example Usage

    A basic ScalaFX application is created creating an object that is an instance of JFXApp. Following Java FX theatre metaphor, it contains a stage that contains a scene. A stage roughly corresponds to a window in a typical UI environment. The scene holds UI content presented to the user. In the example below, the content is a pane with a single label component.

    package hello
    
    import scalafx.application.JFXApp
    import scalafx.application.JFXApp.PrimaryStage
    import scalafx.geometry.Insets
    import scalafx.scene.Scene
    import scalafx.scene.control.Label
    import scalafx.scene.layout.BorderPane
    
    object HelloWorld extends JFXApp {
      stage = new PrimaryStage {
        title = "Hello"
        scene = new Scene {
          root = new BorderPane {
            padding = Insets(25)
            center = new Label("Hello World")
          }
        }
      }
    }
    Definition Classes
    root
  • package scalafx

    Base package for ScalaFX classes.

    Base package for ScalaFX classes.

    Definition Classes
    root
  • package scene

    Wraps javafx.scene package.

    Wraps javafx.scene package.

    Definition Classes
    scalafx
  • package media

    Wraps javafx.scene.media package.

    Wraps javafx.scene.media package.

    Definition Classes
    scene
  • AudioClip
  • AudioEqualizer
  • AudioTrack
  • EqualizerBand
  • Media
  • MediaErrorEvent
  • MediaException
  • MediaIncludes
  • MediaMarkerEvent
  • MediaPlayer
  • MediaView
  • SubtitleTrack
  • Track
  • VideoTrack

class MediaPlayer extends SFXDelegate[javafx.scene.media.MediaPlayer]

Source
MediaPlayer.scala
Linear Supertypes
SFXDelegate[javafx.scene.media.MediaPlayer], AnyRef, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. MediaPlayer
  2. SFXDelegate
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new MediaPlayer(media: Media)

    Create a player for a specific media.

  2. new MediaPlayer(delegate: javafx.scene.media.MediaPlayer)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def audioSpectrumInterval: DoubleProperty

    The interval between spectrum updates in seconds.

  6. def audioSpectrumInterval_=(v: Double): Unit
  7. def audioSpectrumListener: ObjectProperty[AudioSpectrumListener]

    A listener for audio spectrum updates.

  8. def audioSpectrumListener_=(v: AudioSpectrumListener): Unit
  9. def audioSpectrumNumBands: IntegerProperty

    The number of bands in the audio spectrum.

  10. def audioSpectrumNumBands_=(v: Int): Unit
  11. def audioSpectrumThreshold: IntegerProperty

    The sensitivity threshold in decibels; must be non-positive.

  12. def audioSpectrumThreshold_=(v: Int): Unit
  13. def autoPlay: BooleanProperty

    Whether playing should start as soon as possible.

  14. def autoPlay_=(v: Boolean): Unit
  15. def balance: DoubleProperty

    The balance, or left-right setting, of the audio output.

  16. def balance_=(v: Double): Unit
  17. def bufferProgressTime: ReadOnlyObjectProperty[Duration]

    The current buffer position indicating how much media can be played without stalling the MediaPlayer.

  18. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  19. def currentCount: ReadOnlyIntegerProperty

    The number of completed playback cycles.

  20. def currentRate: ReadOnlyDoubleProperty

    The current rate of playback regardless of settings.

  21. def currentTime: ReadOnlyObjectProperty[Duration]

    The current media playback time.

  22. def cycleCount: IntegerProperty

    The number of times the media will be played.

  23. def cycleCount_=(v: Int): Unit
  24. def cycleDuration: ReadOnlyObjectProperty[Duration]

    The amount of time between the startTime and stopTime of this player.

  25. val delegate: javafx.scene.media.MediaPlayer

    JavaFX object to be wrapped.

    JavaFX object to be wrapped.

    Definition Classes
    MediaPlayerSFXDelegate
  26. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. def equals(ref: Any): Boolean

    Verifies if a object is equals to this delegate.

    Verifies if a object is equals to this delegate.

    ref

    Object to be compared.

    returns

    if the other object is equals to this delegate or not.

    Definition Classes
    SFXDelegate → AnyRef → Any
  28. def error: ReadOnlyObjectProperty[javafx.scene.media.MediaException]

    Observable property set to a MediaException if an error occurs.

  29. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  30. def hashCode(): Int

    returns

    The delegate hashcode

    Definition Classes
    SFXDelegate → AnyRef → Any
  31. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  32. def media: Media

    Retrieves the Media instance being played.

  33. def mute: BooleanProperty

    Whether the player audio is muted.

  34. def mute_=(v: Boolean): Unit
  35. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  36. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  37. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  38. def onEndOfMedia: ObjectProperty[Runnable]

    Event handler invoked when the player currentTime reaches stopTime and is not repeating.

  39. def onEndOfMedia_=(op: => Unit): Unit
  40. def onEndOfMedia_=(v: Runnable): Unit
  41. def onError: ObjectProperty[Runnable]

    Event handler invoked when an error occurs.

  42. def onError_=(op: => Unit): Unit
  43. def onError_=(v: Runnable): Unit
  44. def onHalted: ObjectProperty[Runnable]

    Event handler invoked when the status changes to HALTED.

  45. def onHalted_=(op: => Unit): Unit
  46. def onHalted_=(v: Runnable): Unit
  47. def onMarker: ObjectProperty[EventHandler[javafx.scene.media.MediaMarkerEvent]]

    Event handler invoked when the player currentTime reaches a media marker.

  48. def onMarker_=(v: EventHandler[javafx.scene.media.MediaMarkerEvent]): Unit
  49. def onPaused: ObjectProperty[Runnable]

    Event handler invoked when the status changes to PAUSED.

  50. def onPaused_=(op: => Unit): Unit
  51. def onPaused_=(v: Runnable): Unit
  52. def onPlaying: ObjectProperty[Runnable]

    Event handler invoked when the status changes to PLAYING.

  53. def onPlaying_=(op: => Unit): Unit
  54. def onPlaying_=(v: Runnable): Unit
  55. def onReady: ObjectProperty[Runnable]

    Event handler invoked when the status changes to READY.

  56. def onReady_=(op: => Unit): Unit
  57. def onReady_=(v: Runnable): Unit
  58. def onRepeat: ObjectProperty[Runnable]

    Event handler invoked when the player currentTime reaches stopTime and will be repeating.

  59. def onRepeat_=(op: => Unit): Unit
  60. def onRepeat_=(v: Runnable): Unit
  61. def onStalled: ObjectProperty[Runnable]

    Event handler invoked when the status changes to STALLED.

  62. def onStalled_=(op: => Unit): Unit
  63. def onStalled_=(v: Runnable): Unit
  64. def onStopped: ObjectProperty[Runnable]

    Event handler invoked when the status changes to STOPPED.

  65. def onStopped_=(op: => Unit): Unit
  66. def onStopped_=(v: Runnable): Unit
  67. def rate: DoubleProperty

    The rate at which the media should be played.

  68. def rate_=(v: Double): Unit
  69. def startTime: ObjectProperty[Duration]

    The time offset where media should start playing, or restart from when repeating.

  70. def startTime_=(v: Duration): Unit
  71. def status: ReadOnlyObjectProperty[Status]

    The current state of the MediaPlayer.

  72. def stopTime: ObjectProperty[Duration]

    The time offset where media should stop playing or restart when repeating.

  73. def stopTime_=(v: Duration): Unit
  74. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  75. def toString(): String

    returns

    Returns the original delegate's toString() adding a [SFX] prefix.

    Definition Classes
    SFXDelegate → AnyRef → Any
  76. def totalDuration: ReadOnlyObjectProperty[Duration]

    The total amount of play time if allowed to play until finished.

  77. def volume: DoubleProperty

    The volume at which the media should be played.

  78. def volume_=(v: Double): Unit
  79. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  80. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  81. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from SFXDelegate[javafx.scene.media.MediaPlayer]

Inherited from AnyRef

Inherited from Any

Ungrouped