-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
Windows Vista, JavaFX 1.1 pre-release
The following code attaches a MediaTimer to a MediaPlayer. It causes an exception to be reported and the timer is ignored.
Exception in trigger:
com.sun.media.jmc.OperationUnsupportedException: The operation is not supported
at com.sun.media.jmc.MediaProvider.addNotificationTime(MediaProvider.java:815)
at javafx.scene.media.MediaPlayer$10.onChange(MediaPlayer.fx:375)
at com.sun.javafx.runtime.location.SequenceVariable$4.onAction(SequenceVariable.java:219)
at com.sun.javafx.runtime.location.SequenceVariable$4.onAction(SequenceVariable.java:216)
at com.sun.javafx.runtime.location.DependencyIterator.action(AbstractLocation.java:503)
at com.sun.javafx.runtime.location.DependencyIterator.action(AbstractLocation.java:491)
at com.sun.javafx.runtime.util.Linkables.iterate(Linkables.java:82)
at com.sun.javafx.runtime.location.AbstractLocation.iterateChildren(AbstractLocation.java:282)
at com.sun.javafx.runtime.location.SequenceVariable.notifyListeners(SequenceVariable.java:216)
at com.sun.javafx.runtime.location.SequenceVariable.replaceSlice(SequenceVariable.java:129)
at com.sun.javafx.runtime.location.SequenceVariable.access$000(SequenceVariable.java:41)
at com.sun.javafx.runtime.location.SequenceVariable$1.onReplaceSlice(SequenceVariable.java:81)
at com.sun.javafx.runtime.sequence.SequenceMutator.replaceSlice(SequenceMutator.java:120)
at com.sun.javafx.runtime.location.SequenceVariable.setAsSequence(SequenceVariable.java:302)
at com.sun.javafx.runtime.location.SequenceVariable$5.apply(SequenceVariable.java:312)
at com.sun.javafx.runtime.location.AbstractVariable.needDefault(AbstractVariable.java:151)
at javafx.scene.media.MediaPlayer.initialize$(MediaPlayer.fx:370)
at javafxmedia.Media7.javafx$run$(Media7.fx:27)
at javafxmedia.Media7.javafx$run$(Media7.fx:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.javafx.runtime.provider.AWT_EDT_RuntimeProvider$1.run(AWT_EDT_RuntimeProvider.java:104)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
------------------------------------------------
package javafxmedia;
import javafx.ext.swing.SwingButton;
import javafx.scene.layout.HBox;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import javafx.scene.media.MediaTimer;
import javafx.scene.media.MediaView;
import javafx.scene.Scene;
import javafx.stage.Stage;
var mediaURL = "http://sun.edgeboss.net/download/sun/media/1460825906/"
"1460825906_2956241001_big-buck-bunny-640x360.flv";
var mediaView: MediaView;
var mediaPlayer: MediaPlayer;
Stage {
title: "Media #7"
resizable: false
scene: Scene {
width: 640
height: 400
content: [
mediaView = MediaView {
mediaPlayer:
mediaPlayer = MediaPlayer {
media: Media { source: mediaURL }
timers: [
MediaTimer {
time: 10s
action: function(t) { mediaPlayer.pause() }
}
]
}
}
HBox {
spacing: 20
translateY: 360
content: [
SwingButton {
text: bind if (mediaPlayer.paused)
"Start" else "Stop"
action: function() {
if (mediaPlayer.paused) {
mediaPlayer.play();
} else {
mediaPlayer.stop();
}
}
}
SwingButton {
enabled: bind not mediaPlayer.paused
text: "Pause"
action: function() {
mediaPlayer.pause();
}
}
]
}
]
}
}
Exception in trigger:
com.sun.media.jmc.OperationUnsupportedException: The operation is not supported
at com.sun.media.jmc.MediaProvider.addNotificationTime(MediaProvider.java:815)
at javafx.scene.media.MediaPlayer$10.onChange(MediaPlayer.fx:375)
at com.sun.javafx.runtime.location.SequenceVariable$4.onAction(SequenceVariable.java:219)
at com.sun.javafx.runtime.location.SequenceVariable$4.onAction(SequenceVariable.java:216)
at com.sun.javafx.runtime.location.DependencyIterator.action(AbstractLocation.java:503)
at com.sun.javafx.runtime.location.DependencyIterator.action(AbstractLocation.java:491)
at com.sun.javafx.runtime.util.Linkables.iterate(Linkables.java:82)
at com.sun.javafx.runtime.location.AbstractLocation.iterateChildren(AbstractLocation.java:282)
at com.sun.javafx.runtime.location.SequenceVariable.notifyListeners(SequenceVariable.java:216)
at com.sun.javafx.runtime.location.SequenceVariable.replaceSlice(SequenceVariable.java:129)
at com.sun.javafx.runtime.location.SequenceVariable.access$000(SequenceVariable.java:41)
at com.sun.javafx.runtime.location.SequenceVariable$1.onReplaceSlice(SequenceVariable.java:81)
at com.sun.javafx.runtime.sequence.SequenceMutator.replaceSlice(SequenceMutator.java:120)
at com.sun.javafx.runtime.location.SequenceVariable.setAsSequence(SequenceVariable.java:302)
at com.sun.javafx.runtime.location.SequenceVariable$5.apply(SequenceVariable.java:312)
at com.sun.javafx.runtime.location.AbstractVariable.needDefault(AbstractVariable.java:151)
at javafx.scene.media.MediaPlayer.initialize$(MediaPlayer.fx:370)
at javafxmedia.Media7.javafx$run$(Media7.fx:27)
at javafxmedia.Media7.javafx$run$(Media7.fx:27)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.javafx.runtime.provider.AWT_EDT_RuntimeProvider$1.run(AWT_EDT_RuntimeProvider.java:104)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
------------------------------------------------
package javafxmedia;
import javafx.ext.swing.SwingButton;
import javafx.scene.layout.HBox;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import javafx.scene.media.MediaTimer;
import javafx.scene.media.MediaView;
import javafx.scene.Scene;
import javafx.stage.Stage;
var mediaURL = "http://sun.edgeboss.net/download/sun/media/1460825906/"
"1460825906_2956241001_big-buck-bunny-640x360.flv";
var mediaView: MediaView;
var mediaPlayer: MediaPlayer;
Stage {
title: "Media #7"
resizable: false
scene: Scene {
width: 640
height: 400
content: [
mediaView = MediaView {
mediaPlayer:
mediaPlayer = MediaPlayer {
media: Media { source: mediaURL }
timers: [
MediaTimer {
time: 10s
action: function(t) { mediaPlayer.pause() }
}
]
}
}
HBox {
spacing: 20
translateY: 360
content: [
SwingButton {
text: bind if (mediaPlayer.paused)
"Start" else "Stop"
action: function() {
if (mediaPlayer.paused) {
mediaPlayer.play();
} else {
mediaPlayer.stop();
}
}
}
SwingButton {
enabled: bind not mediaPlayer.paused
text: "Pause"
action: function() {
mediaPlayer.pause();
}
}
]
}
]
}
}