2

使用此https://github.com/vimeo/vimeo-networking-java进行 vimeo 视频播放器。使用编译

com.vimeo.networking:vimeo-networking:1.0.1

在 build.gradle 但仍然错误

得到错误

FATAL EXCEPTION: main

Process: com.sample.vimeosdkapplication, PID: 2113

    java.lang.AssertionError: Instance must be configured before use
    at com.vimeo.networking.VimeoClient.getInstance(VimeoClient.java:94)
    at com.sample.vimeosdkapplication.MainActivity.<init>(MainActivity.java:28)
    at java.lang.reflect.Constructor.newInstance(Native Method)
    at java.lang.Class.newInstance(Class.java:1572)
    at android.app.Instrumentation.newActivity(Instrumentation.java:1065)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2199)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
    at android.app.ActivityThread.access$800(ActivityThread.java:144)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5221)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
    07-22 16:56:57.000 2113-2120/com.sample.vimeosdkapplication W/art: Suspending all threads took: 10ms
4

1 回答 1

4

您需要初始化VimeoClient该类。您可以在README的这一部分中了解如何执行此操作。

您需要使用所需的库选项构建构建器,然后调用initialize.

以下是构建器的示例:

Configuration.Builder configBuilder =
      new Configuration.Builder(clientId, clientSecret, SCOPE,
                                testAccountStore, new AndroidGsonDeserializer())
          .setCacheDirectory(this.getCacheDir())

然后你在这里静态调用初始化:

VimeoClient.initialize(<your builder here>);
于 2016-07-22T19:45:12.197 回答