-
Bug
-
Resolution: Won't Fix
-
P3
-
None
-
Version 1.1
On my Windows system, the following code demonstrates radical swings in video start-up latency. Repeated clicking of play (green) and stop (red) buttons invariably leads to a very long delay before the video plays back. Subsequent plays can nevertheless play back almost immediately. The delay in start-up is therefore not particularly predictable. This behavior was exhibited with the attached 700KB 3GP video sample.
import javafx.scene.Group;
import javafx.scene.input.MouseEvent;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import javafx.scene.media.MediaView;
import javafx.scene.paint.Color;
import javafx.scene.Scene;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
def mediaViewer: MediaView = MediaView {
mediaPlayer: MediaPlayer {
media: media
}
}
def media: Media = Media {
source: "file:///C:/development/netbeans_workspace/musicpinboardmobile/test/jirabugs/demo.3gp" // insert the attached video's URL here
}
Stage {
width: 250
height: 250
scene: Scene {
content: Group {
content: [
mediaViewer
Rectangle {
x: 30
y: 140
width: 30
height: 30
fill: Color.RED
onMouseReleased: function(e:MouseEvent) {
mediaViewer.mediaPlayer.stop();
mediaViewer.mediaPlayer.media = null;
}
}
Rectangle {
x: 70
y: 140
width: 30
height: 30
fill: Color.GREEN
onMouseReleased: function(e:MouseEvent) {
mediaViewer.mediaPlayer.media = media;
mediaViewer.mediaPlayer.play();
}
}
]
}
}
}
import javafx.scene.Group;
import javafx.scene.input.MouseEvent;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import javafx.scene.media.MediaView;
import javafx.scene.paint.Color;
import javafx.scene.Scene;
import javafx.scene.shape.Rectangle;
import javafx.stage.Stage;
def mediaViewer: MediaView = MediaView {
mediaPlayer: MediaPlayer {
media: media
}
}
def media: Media = Media {
source: "file:///C:/development/netbeans_workspace/musicpinboardmobile/test/jirabugs/demo.3gp" // insert the attached video's URL here
}
Stage {
width: 250
height: 250
scene: Scene {
content: Group {
content: [
mediaViewer
Rectangle {
x: 30
y: 140
width: 30
height: 30
fill: Color.RED
onMouseReleased: function(e:MouseEvent) {
mediaViewer.mediaPlayer.stop();
mediaViewer.mediaPlayer.media = null;
}
}
Rectangle {
x: 70
y: 140
width: 30
height: 30
fill: Color.GREEN
onMouseReleased: function(e:MouseEvent) {
mediaViewer.mediaPlayer.media = media;
mediaViewer.mediaPlayer.play();
}
}
]
}
}
}