YouTube Player in Java GUI

18,750

Solution 1

Have a look at Google's YouTube Data API, retrieving a VideoEntry should be pretty trivial (see for example Interact with YouTube from Java ). Playing them from Java may require a bit more work and I guess you'll need to embed a SWF Player. Or maybe check gwt2swf, a Flash/Flex Widget for GWT.

Solution 2

I guess in order to do that you would have to make our Java application play Flash videos. There is this Java Flash Player API, but I am really not sure how it will work. You will have to check the terms and conditions of YouTube to check if this is allowed - and also to check if you can get more of the video information with the YouTube API (from the video URL).

The easiest path, IMHO, is to get the player ID and use the custom player to open a browser page only with the player on it. It will not be embedded inside your application, but it should work as a charm.

Solution 3

Use Xuggler's MediaViewer object for a Java media player, and check out the Xuggle-Utils library for a set of utility functions for getting a playable FLV from a Youtube URL.

  • Art
Share:
18,750

Related videos on Youtube

Alex
Author by

Alex

Updated on April 19, 2022

Comments

  • Alex
    Alex about 2 years

    I was thinking about implementing an application in Java (with a GWT GUI) that among its options will be able to play YouTube video and audio, or at least only audio.

    The problem is that I can't seem to find any API or source code that enables it. What I want is that given a URL for a video in YouTube, one can play it using Java.