Jump to content

[1.7.10] Open Youtube Video In a GUI to create a story for minecraft


Thornack

Recommended Posts

Hi everyone, My goal is to open a youtube video in minecraft to create a story for minecraft using cut-scenes that get triggered by events that occur in game.

 

So far I have a GUI class and am able to open the youtube video by clicking the P key - I arbitrarily set it to this. But the way I have it figured out currently uses the following method that is called whenever the player clicks the p key

 

In my GUI class I have the following methods for opening the web browser


@Override
public void handleKeyboardInput()
    {
        if (Keyboard.getEventKeyState()){
            this.keyTyped(Keyboard.getEventCharacter(), Keyboard.getEventKey());
        }
        else{
        	this.keyReleased(Keyboard.getEventKey(), Keyboard.getEventKey());
        }

        this.mc.func_152348_aa();
    }

@Override
protected void keyTyped(char key, int event){
	super.keyTyped(key, event);
if (key=='p'||key=='P'){
		this.openWebpage();
	}
}

public static String openWebpage() {
  if (Desktop.isDesktopSupported()) {
   try {
    Desktop.getDesktop().browse(new URI("http://www.Youtube.com"));
   } catch (IOException e) {
    e.printStackTrace();
    return "Can't open browser for some reason";
   } catch (URISyntaxException e) {
    e.printStackTrace();
    return "Bug Detected: The URL is invalid for some reason.";
   }
  } else {
   return "For some reason You Can't open the browser";
  }
  return null;
}

 

It works perfectly to open a webpage using the browser but I have a question, I want the url to open inside the GUI where currently it opens in the desktop (outside of MC). Not sure how to implement this part. I know you have to use the following two methods but I am not sure exactly how to get the last little bit so that I have a working cutscene

 

@Override

public void drawScreen(int mouseX, int mouseY, float p_73863_3_){}

 

        private void drawTexturedRect(Rectangle guiRect, Rectangle drawRect, Rectangle textureRect, int textureSize){}

       

any help is greatly appreciated

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.