class MediaPlayer extends SFXDelegate[javafx.scene.media.MediaPlayer]
- Source
- MediaPlayer.scala
- Alphabetic
- By Inheritance
- MediaPlayer
- SFXDelegate
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
audioSpectrumInterval: DoubleProperty
The interval between spectrum updates in seconds.
- def audioSpectrumInterval_=(v: Double): Unit
-
def
audioSpectrumListener: ObjectProperty[AudioSpectrumListener]
A listener for audio spectrum updates.
- def audioSpectrumListener_=(v: AudioSpectrumListener): Unit
-
def
audioSpectrumNumBands: IntegerProperty
The number of bands in the audio spectrum.
- def audioSpectrumNumBands_=(v: Int): Unit
-
def
audioSpectrumThreshold: IntegerProperty
The sensitivity threshold in decibels; must be non-positive.
- def audioSpectrumThreshold_=(v: Int): Unit
-
def
autoPlay: BooleanProperty
Whether playing should start as soon as possible.
- def autoPlay_=(v: Boolean): Unit
-
def
balance: DoubleProperty
The balance, or left-right setting, of the audio output.
- def balance_=(v: Double): Unit
-
def
bufferProgressTime: ReadOnlyObjectProperty[Duration]
The current buffer position indicating how much media can be played without stalling the MediaPlayer.
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native() @HotSpotIntrinsicCandidate()
-
def
currentCount: ReadOnlyIntegerProperty
The number of completed playback cycles.
-
def
currentRate: ReadOnlyDoubleProperty
The current rate of playback regardless of settings.
-
def
currentTime: ReadOnlyObjectProperty[Duration]
The current media playback time.
-
def
cycleCount: IntegerProperty
The number of times the media will be played.
- def cycleCount_=(v: Int): Unit
-
def
cycleDuration: ReadOnlyObjectProperty[Duration]
The amount of time between the startTime and stopTime of this player.
-
val
delegate: javafx.scene.media.MediaPlayer
JavaFX object to be wrapped.
JavaFX object to be wrapped.
- Definition Classes
- MediaPlayer → SFXDelegate
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
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
-
def
error: ReadOnlyObjectProperty[javafx.scene.media.MediaException]
Observable property set to a MediaException if an error occurs.
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
hashCode(): Int
- returns
The delegate hashcode
- Definition Classes
- SFXDelegate → AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
media: javafx.scene.media.Media
Retrieves the Media instance being played.
-
def
mute: BooleanProperty
Whether the player audio is muted.
- def mute_=(v: Boolean): Unit
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
-
def
onEndOfMedia: ObjectProperty[Runnable]
Event handler invoked when the player currentTime reaches stopTime and is not repeating.
- def onEndOfMedia_=(op: ⇒ Unit): Unit
- def onEndOfMedia_=(v: Runnable): Unit
-
def
onError: ObjectProperty[Runnable]
Event handler invoked when an error occurs.
- def onError_=(op: ⇒ Unit): Unit
- def onError_=(v: Runnable): Unit
-
def
onHalted: ObjectProperty[Runnable]
Event handler invoked when the status changes to HALTED.
- def onHalted_=(op: ⇒ Unit): Unit
- def onHalted_=(v: Runnable): Unit
-
def
onMarker: ObjectProperty[EventHandler[javafx.scene.media.MediaMarkerEvent]]
Event handler invoked when the player currentTime reaches a media marker.
- def onMarker_=(v: EventHandler[javafx.scene.media.MediaMarkerEvent]): Unit
-
def
onPaused: ObjectProperty[Runnable]
Event handler invoked when the status changes to PAUSED.
- def onPaused_=(op: ⇒ Unit): Unit
- def onPaused_=(v: Runnable): Unit
-
def
onPlaying: ObjectProperty[Runnable]
Event handler invoked when the status changes to PLAYING.
- def onPlaying_=(op: ⇒ Unit): Unit
- def onPlaying_=(v: Runnable): Unit
-
def
onReady: ObjectProperty[Runnable]
Event handler invoked when the status changes to READY.
- def onReady_=(op: ⇒ Unit): Unit
- def onReady_=(v: Runnable): Unit
-
def
onRepeat: ObjectProperty[Runnable]
Event handler invoked when the player currentTime reaches stopTime and will be repeating.
- def onRepeat_=(op: ⇒ Unit): Unit
- def onRepeat_=(v: Runnable): Unit
-
def
onStalled: ObjectProperty[Runnable]
Event handler invoked when the status changes to STALLED.
- def onStalled_=(op: ⇒ Unit): Unit
- def onStalled_=(v: Runnable): Unit
-
def
onStopped: ObjectProperty[Runnable]
Event handler invoked when the status changes to STOPPED.
- def onStopped_=(op: ⇒ Unit): Unit
- def onStopped_=(v: Runnable): Unit
-
def
rate: DoubleProperty
The rate at which the media should be played.
- def rate_=(v: Double): Unit
-
def
startTime: ObjectProperty[Duration]
The time offset where media should start playing, or restart from when repeating.
- def startTime_=(v: Duration): Unit
-
def
status: ReadOnlyObjectProperty[Status]
The current state of the MediaPlayer.
-
def
stopTime: ObjectProperty[Duration]
The time offset where media should stop playing or restart when repeating.
- def stopTime_=(v: Duration): Unit
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- returns
Returns the original delegate's
toString()
adding a[SFX]
prefix.
- Definition Classes
- SFXDelegate → AnyRef → Any
-
def
totalDuration: ReadOnlyObjectProperty[Duration]
The total amount of play time if allowed to play until finished.
-
def
volume: DoubleProperty
The volume at which the media should be played.
- def volume_=(v: Double): Unit
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
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 tojavafx.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 astage
that contains ascene
. Astage
roughly corresponds to a window in a typical UI environment. Thescene
holds UI content presented to the user. In the example below, the content is a pane with a singlelabel
component.