JavaFX MediaView 🎞️

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ม.ค. 2025

ความคิดเห็น • 49

  • @BroCodez
    @BroCodez  3 ปีที่แล้ว +8

    package application;
    import java.io.File;
    import java.net.URL;
    import java.util.ResourceBundle;
    import javafx.fxml.FXML;
    import javafx.fxml.Initializable;
    import javafx.scene.control.Button;
    import javafx.scene.media.Media;
    import javafx.scene.media.MediaPlayer;
    import javafx.scene.media.MediaView;
    import javafx.util.Duration;
    public class Controller implements Initializable{
    @FXML
    private MediaView mediaView;

    @FXML
    private Button playButton, pauseButton, resetButton;

    private File file;
    private Media media;
    private MediaPlayer mediaPlayer;

    @Override
    public void initialize(URL arg0, ResourceBundle arg1) {

    file = new File("MarioKart.mp4");
    media = new Media(file.toURI().toString());
    mediaPlayer = new MediaPlayer(media);
    mediaView.setMediaPlayer(mediaPlayer);

    }

    public void playMedia() {

    mediaPlayer.play();
    }

    public void pauseMedia() {

    mediaPlayer.pause();
    }

    public void resetMedia() {

    if(mediaPlayer.getStatus() != MediaPlayer.Status.READY) {
    mediaPlayer.seek(Duration.seconds(0.0));
    }
    }
    }

  • @conradpierce8994
    @conradpierce8994 3 ปีที่แล้ว +9

    underrated channel. How are your videos getting no views and comments? They're so underrated. Commenting for the algorithm.

    • @BroCodez
      @BroCodez  3 ปีที่แล้ว +2

      Thanks Conrad!

  • @drtnt8855
    @drtnt8855 3 ปีที่แล้ว +6

    Hey Bro, when you are done with going over all the FX elements. I think you should show how to make basic software's like a text editor like you did for swing. Its just a suggestion. Keep up the great work :)

  • @ruthadenike3548
    @ruthadenike3548 3 ปีที่แล้ว +2

    Best tutorial channel ever👍👍👍👍👍

    • @BroCodez
      @BroCodez  3 ปีที่แล้ว

      thanks Ruth!

  • @digantaray540
    @digantaray540 ปีที่แล้ว +4

    here mediaviw are not working when we add media viws then error occoure

  • @keu5662
    @keu5662 3 ปีที่แล้ว +3

    that intro was a good plot twist LOL, good tutorial Bro :)

    • @BroCodez
      @BroCodez  3 ปีที่แล้ว

      Thanks! 😁

  • @davyswanson7412
    @davyswanson7412 3 ปีที่แล้ว

    fantastic videos and a great way of teaching, thanks for all the help bro

  • @ahmadghumman-y5n
    @ahmadghumman-y5n หลายเดือนก่อน

    Do we need to master collection in java to make software

  • @prizepig
    @prizepig 2 ปีที่แล้ว +4

    Needs instructions for how to implement the arguments in IntelliJ. I couldnt finish this one.

  • @boorjagallegoo
    @boorjagallegoo 11 หลายเดือนก่อน

    Good video brother, a tip if after defining the buttons in the view.fxml you click on save and exit, and you position yourself at the top by right clicking on "Create controller" it generates only the events and components.

  • @rapbimsfrienda22
    @rapbimsfrienda22 3 ปีที่แล้ว +1

    Thanks sir for your amazing 🤩 explanation and to share the source code which you have shared

  • @hilarytan
    @hilarytan 3 ปีที่แล้ว

    simple and clear ...

  • @SanjayKumar-zc4hs
    @SanjayKumar-zc4hs 3 ปีที่แล้ว

    You are awesome bro... Keep doing ... Please start a playlist for j2EE and spring 🙏.

  • @themodestai9603
    @themodestai9603 3 ปีที่แล้ว +2

    get my bro views

  • @bent3942
    @bent3942 2 ปีที่แล้ว

    Thanks for the refresh tip!

  • @traumlos8464
    @traumlos8464 3 ปีที่แล้ว +2

    How do you learn those things without a tutorialvideo?

    • @danilo-arantzibia
      @danilo-arantzibia 3 ปีที่แล้ว +1

      That's the question!

    • @itsTyrion
      @itsTyrion 2 ปีที่แล้ว

      reading documentation, googling, trial and error

  • @DudaCastro-y6q
    @DudaCastro-y6q 11 หลายเดือนก่อน

    Can you do a Java course intermediate? (btw love the tutorials!!!)

  • @minecraftguides7760
    @minecraftguides7760 3 ปีที่แล้ว

    Bro code, I have a question. Does the JScrollPane properly work on the JPanel?

  • @ayushtripathi7178
    @ayushtripathi7178 2 ปีที่แล้ว

    Can we play rtsp streams using Media Player?

  • @wilsonoey1121
    @wilsonoey1121 3 ปีที่แล้ว

    what application did you use to create JavaFX MediaView?

  • @benderbg
    @benderbg ปีที่แล้ว

    Some interesting thing I've noticed while working on this lesson. I had my video files both in project folder and app folder while working out the paths. For w/e reason Java was loading video file first time fine and the 2nd time video wouldn't show up at all. Its like it tried to find a file in different location every time regardless of file path I provided. Issue resolved itself once I had file only in project folder.

  • @kleynotnilu2713
    @kleynotnilu2713 3 ปีที่แล้ว +1

    dude can u explain why javafx it is even used nowadays?

    • @drtnt8855
      @drtnt8855 3 ปีที่แล้ว

      It's an upgraded swing or awt.

    • @kleynotnilu2713
      @kleynotnilu2713 3 ปีที่แล้ว

      @@drtnt8855 so its used in business?

    • @drtnt8855
      @drtnt8855 3 ปีที่แล้ว

      @@kleynotnilu2713 I'm not sure, if you are trying to decide if you should learn it. I think you should if you have a good understanding of swing and Java as whole. In my opinion its very easy to get the hang of. Other good languages I know are used in business are C, C++, and C#

    • @kleynotnilu2713
      @kleynotnilu2713 3 ปีที่แล้ว

      @@drtnt8855 well im at beginning of my journey i learned few basic from java and im trying to learn english

  • @ahmadfx8962
    @ahmadfx8962 2 ปีที่แล้ว

    audio mp3 works, but video did not show or play, i did not given any error when running the program...any help?, i tried path to my video library and also tried by locating the video in my project folder all the same

  • @andromydous
    @andromydous 2 ปีที่แล้ว

    Been following along with the 4+ hour video of this series while looking forward to this one in particular. However, I can't get a video to play. There's no errors. Just a blank screen. I've looked over the code, I don't know how many times, and can't figure out what's wrong. Any ideas?

    • @M1a2n3o43
      @M1a2n3o43 2 ปีที่แล้ว +1

      Bro its the same for me. Have you figured it out?

    • @andromydous
      @andromydous 2 ปีที่แล้ว

      @@M1a2n3o43 Actually, I had forgot all about it until now. I had switched gears to Python. If memory serves, the problem might have to do with the fact that I'm using Linux (maybe missing some specific video packages).

  • @ctluwua7695
    @ctluwua7695 3 ปีที่แล้ว

    Hey BRO
    I am stuck
    I want my video to played in the second scene and When I am Saying
    @FXML
    private MediaView mediaiview ;
    Its taking the mediaview from my scene one
    and THE mediaview is null in first scene
    I am Adding MediaView in my Second scene
    How can I say I AM Taking my mediaview from Second scene?
    How can I fix that
    HELP ME !

  • @jianhe
    @jianhe 3 ปีที่แล้ว

    Cool. wondering how to forward and rewind 10 second.

  • @shashwatgupta6187
    @shashwatgupta6187 23 วันที่ผ่านมา

    “nuclear Launch codes” , this is a folder on his desktop😂

  • @chircatstv8033
    @chircatstv8033 ปีที่แล้ว

    Im using nwtbeans but theres no run configuration...please help me brother 😢

  • @ahmadfx8962
    @ahmadfx8962 2 ปีที่แล้ว

    thank you, thaaaank you :)

  • @mosesomorogbe2325
    @mosesomorogbe2325 หลายเดือนก่อน

    Someone pls help me, i want to do this in vscode

  • @adszization
    @adszization 3 ปีที่แล้ว

    Can i find a job by studying javafx??

  • @unknownhero5480
    @unknownhero5480 3 ปีที่แล้ว

    .

  • @ralkey
    @ralkey 11 หลายเดือนก่อน

    IntelliJ IDEA is not recognizing javafx.scene.media.MediaView
    from ``
    im using java 21, how can i fix this?

    • @rectaalborween8471
      @rectaalborween8471 10 หลายเดือนก่อน

      If you've figured it out i wanna know too

    • @ralkey
      @ralkey 10 หลายเดือนก่อน

      @@rectaalborween8471 i would tell you but youtube keeps deleting my messages

  • @CosmoKuz
    @CosmoKuz ปีที่แล้ว +1

    javafx.scene.media.MediaView - I can't import this.