Thornack Posted March 8, 2015 Posted March 8, 2015 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 Quote
shadowfacts Posted March 8, 2015 Posted March 8, 2015 You'll probably have to use a library like JavaChromiumEmbeded to render the YouTube video inside of Minecraft. Quote Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods
Recommended Posts
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.