Package javafx.scene.media.MediaPlayer

Examples of javafx.scene.media.MediaPlayer.Status


        mediaView.setMediaPlayer(mp);
        mediaView.fitHeightProperty().bind(this.heightProperty().subtract(playControlBar.heightProperty()));
        mediaView.fitWidthProperty().bind(this.widthProperty());

        controlButton.setOnAction((ActionEvent e) -> {
            Status status = mp.getStatus();
            switch (status) {
                case UNKNOWN:
                case HALTED:
                    // don't do anything in these states
                    return;
View Full Code Here


         */
        private void setProgressActionListeners() {
            pauseButton.setOnAction(new EventHandler<ActionEvent>() {
                @Override
                public void handle(ActionEvent e) {
                    Status status = mediaPlayer.getStatus();

                    switch (status) {
                        // If playing, pause
                        case PLAYING:
                            mediaPlayer.pause();
                            break;
                        // If ready, paused or stopped, continue playing
                        case READY:
                        case PAUSED:
                        case STOPPED:
                            mediaPlayer.play();
                            break;
                        default:
                            logger.log(Level.INFO, "MediaPlayer in unexpected state: " + status.toString()); //NON-NLS
                            // If the MediaPlayer is in an unexpected state, stop playback.
                            mediaPlayer.stop();
                            setInfoLabelText(NbBundle.getMessage(this.getClass(),
                                                                 "FXVideoPanel.pauseButton.infoLabel.playbackErr"));
                            break;
View Full Code Here

TOP

Related Classes of javafx.scene.media.MediaPlayer.Status

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.