GWT-Youtube-API no source code available for YouTu

2019-07-28 18:55发布

问题:

I tried to embed a Video in my GWT Project but I get the following error in my console when I open the panel containing the video:

No source code is available for type com.google.youtube.client.YouTubeEmbeddedPlayer; did you forget to inherit a required module?

My Build Path for the Project

And this is the example code

    YouTubeEmbeddedPlayer youTubeEmbeddedPlayer = new YouTubeEmbeddedPlayer("hqXUKxJiDls");
    youTubeEmbeddedPlayer.setWidth("427px");
    youTubeEmbeddedPlayer.setHeight("320px");
    absolutePanel.add(youTubeEmbeddedPlayer, 200, 30);

project.gwt.xml:

    <inherits name="com.google.gdata.YouTubeAPI" />
    <inherits name="com.google.youtube.Player" />

I followed the GettingStarted wiki entry but I don't know where to put the settings.xml (it's not explained).

Thank's in advance.

回答1:

Try adding gwt-youtube-api-1.0.3-sources.jar to your classpath as a standard library instead of adding it as a source attachment for gwt-youtube-api-1.0.3.jar.