libgdx / gdx-video

A libGDX cross platform video rendering extension
Apache License 2.0
147 stars 50 forks source link

trouble getting started using gdx-video for Android with Android Studio #14

Closed jltrem closed 8 years ago

jltrem commented 8 years ago

I am new to Java/Android development. Using Android Studio 1.5.1. I've built gdx-video and gdx-video-android to two jar files using jdk1.8.0_66\bin\jar.exe cfv filename.jar *. I added the two files to a libs folder just under my libgdx project (at the same level as core and android folders). In my project's build.gradle I added these lines to both the core and android dependencies blocks:

compile fileTree(dir: '../libs', include: '*.jar')

then resync'd gradle and added the following inside the ApplicationAdapter's create():

    videoPlayer = VideoPlayerCreator.createVideoPlayer();
    videoPlayer.resize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    videoPlayer.setOnVideoSizeListener(new VideoPlayer.VideoSizeListener() {
        @Override
        public void onVideoSize(float v, float v2) {
            videoLoaded = true;
        }
    });

Android Studio asks to import the unknown class com.badlogic.gdx.video.VideoPlayer, I respond with Alt+Enter and it prompts again for the same import. If I add com.bad.logic.gdx.video.VideoPlayer manually, .video is not recognized.

What step am I missing? Thank you.

RBogie commented 8 years ago

It sounds like the project isn't correctly included in the classpath. Are you sure this is the normal way of including libraries for your project?

Unfortunately I don't have any experience with android studio, and I don't have a lot of experience with gradle (I'm still one of those maven people... :wink:).