Package me.aurous.ui.panels

Examples of me.aurous.ui.panels.ControlPanel


  // private static StreamFunctions sFunctions = new StreamFunctions();

  public MediaView view;

  public Scene createScene(final String sourceURL) throws Throwable {
    final ControlPanel panel = UISession.getControlPanel();
    final Group root = new Group();
    root.autosize();
    MediaUtils.activeMedia = sourceURL;
    final String trailer = MediaUtils.getMediaURL(sourceURL);
    try {
      media = new Media(trailer.trim());
    } catch (final Exception e) {
      MediaUtils.handleEndOfStream();
    }

    player = new MediaPlayer(media);

    view = new MediaView(player);
    view.setFitWidth(1);
    view.setFitHeight(1);
    view.setPreserveRatio(false);

    // System.out.println("media.width: "+media.getWidth());

    final Scene scene = new Scene(root, 1, 1, Color.BLACK);

    // player.play();

    player.setOnReady(() -> {
      player.setAutoPlay(false);
      panel.seek().setValue(0);
      if (sourceURL
          .contains("https://www.youtube.com/watch?v=kGubD7KG9FQ")) {
        player.pause();
      } else {
        player.play();
View Full Code Here


    return (scene);
  }

  private void updateTime(final long currentTime, final long totalDuration) {
    final ControlPanel panel = UISession.getControlPanel();
    final int percentage = (int) (((currentTime * 100.0) / totalDuration) + 0.5); // jesus
    final double seconds = currentTime / 1000.0;
    UISession.getControlPanel().seek().setValue(percentage);
    panel.seek().setValue(percentage);
    panel.current().setText(MediaUtils.calculateTime((int) seconds));

  }
View Full Code Here

    this.aurousFrame.setFont(new Font("Calibri", Font.PLAIN, 12));
    // we don't actually have to add the panel
    jfxPanel = new JFXPanel();

    try {
      final ControlPanel mediaControlsPanel = new ControlPanel();
      UISession.setControlPanel(mediaControlsPanel);
      this.aurousFrame.getContentPane().add(mediaControlsPanel,
          BorderLayout.SOUTH);
    } catch (final IOException e) {
      // TODO Auto-generated catch block
View Full Code Here

TOP

Related Classes of me.aurous.ui.panels.ControlPanel

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.