Note that there are some explanatory texts on larger screens.

plurals
  1. POEmbed a YouTube video to JFrame?
    text
    copied!<p>I've been doing a lot of research and trying to find a guide that can teach me how to correctly embed a YouTube video directly to my <code>JFrame</code>. I've read all of the Google Developers guides on the <strong>YouTube API</strong> but can't find just what I'm looking to do. </p> <p>I'm trying to embed a YouTube video straight to the <code>JFrame</code> using an init in my main method. For example:</p> <pre><code>/** * Main * @param args * @throws IOException */ public static void main(String[] args) throws IOException { try { UIManager.setLookAndFeel(new NimbusLookAndFeel()); } catch (UnsupportedLookAndFeelException ulafe) { Loader loader = new Loader(); loader.doFrame(); } Start Loader = new Start(); Loader.setVisible(true); } /** * Start * @throws IOException */ public Start() throws IOException { super("Ryan's Client Launcher version: '0.0.1'"); try { getContentPane().setBackground(Color.BLACK); setBackground(Color.BLACK); BufferedImage image39 = ImageIO.read(getClass().getResourceAsStream("\\jaggl\\igs\\39.png")); this.setIconImage(image39); this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setSize(new Dimension(launcherWidth, launcherHeight)); this.setLocationRelativeTo(null); this.setResizable(false); this.setUndecorated(true); getContentPane().setLayout(null); initWorldSelectInterface(); } catch (IOException e) { System.out.println(e); } } </code></pre> <p>Under where I have initiated my world select interface I would like to have "<code>initYouTubeVideo</code>"</p> <p>I've created a void "<code>initYouTubeVideo</code>" and don't exactly understand how I can just embed the video &amp; only the video. Say I make an update for my game &amp; I make a YouTube video about it. I'd like to feature that video on my <code>JFrame</code> (no comment Section or anything else just simply the YouTube video).</p> <p>Could someone please give me a guide that I can learn from directly on how to Embed the YouTube video.</p> <p>For this post I made an example JFrame to help you visually understand what I'm trying to accomplish. Here is the Image:</p> <p><img src="https://i.stack.imgur.com/vaPab.png" alt="Image"></p> <p>In the image the red is where I would place the YouTube player &amp; The green is my interfaces. Now again say I made an update in my game &amp; made a youtube video about it. I want to be able to just put the link to the video in &amp; when someone runs the client they can click play &amp; watch the video.</p> <p>Note: I am using <em>Google's YouTube API</em></p> <p>I have looked at the following Guides: Everything about the YouTube API found here: <a href="https://developers.google.com/youtube/v3/getting-started" rel="noreferrer">https://developers.google.com/youtube/v3/getting-started</a></p> <p>Again All i want is just to add the video to the JFrame so my players can get video updates on the latest game content.</p> <p>Thank you &amp; Rep to those that can help me.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload