0

Stackoverflow ユーザーの皆様、こんにちは。現在、JFrame にビデオを追加しようとしています。Google の YouTube API を使用しています。今、コンテンツ ペインにビデオ エントリを実際に追加する方法に行き詰まっています。

私のコード: (正しいコードではないようです....?)

/**
 * Youtube Video's
 */
private void create(String video_id) {
    try {
    YouTubeService service = new YouTubeService("app", "abcd");

    String videoEntryURL = "http://gdata.youtube.com/feeds/api/videos/"+video_id;

    VideoEntry videoEntry = service.getEntry(new URL(videoEntryURL), VideoEntry.class);

    getContentPane().add(videoEntryURL);

    System.out.println(videoEntry.getTitle().getPlainText());
    } catch (MalformedURLException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    } catch (ServiceException e) {
        e.printStackTrace();
    }
}

&私のvoid homeScreen方法では、これがあります:

/**
         * Youtube Video 1
         */
        //YouTubeService service = new YouTubeService("xxx.apps.googleusercontent.com",  "AAA");
        create("EKyirtVHsK0");

問題: メソッドの videoEntry を何に置き換えるかcreate(String video_id)

これ:

getContentPane().add(videoEntry);

4

0 に答える 0