2013-11-28 41 views
1

如何从android应用程序启动vimeo intent。 我厌倦了使用下面的链接....重定向到Vimeo播放器

http://player.vimeo.com/video/VIDEO_ID

但它正从Vimeo的应用程序崩溃并出现以下错误:

11-28 17:46:12.076: E/Vimeo(4144): **uncaught exception** 
11-28 17:46:12.076: E/Vimeo(4144): **java.lang.ClassNotFoundException: com.vimeo.android.lib.ui.player.LaunchFullScreenVideoPlayerFullScreenVideoPlayer** 
11-28 17:46:12.076: E/Vimeo(4144): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61) 
11-28 17:46:12.076: E/Vimeo(4144): at java.lang.ClassLoader.loadClass(ClassLoader.java:501) 
11-28 17:46:12.076: E/Vimeo(4144): at java.lang.ClassLoader.loadClass(ClassLoader.java:461) 
11-28 17:46:12.076: E/Vimeo(4144): at android.app.Instrumentation.newActivity(Instrumentation.java:1053) 
11-28 17:46:12.076: E/Vimeo(4144): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974) 
11-28 17:46:12.076: E/Vimeo(4144): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084) 
11-28 17:46:12.076: E/Vimeo(4144): at android.app.ActivityThread.access$600(ActivityThread.java:130) 
11-28 17:46:12.076: E/Vimeo(4144): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195) 
11-28 17:46:12.076: E/Vimeo(4144): at android.os.Handler.dispatchMessage(Handler.java:99) 
11-28 17:46:12.076: E/Vimeo(4144): at android.os.Looper.loop(Looper.java:137) 
11-28 17:46:12.076: E/Vimeo(4144): at android.app.ActivityThread.main(ActivityThread.java:4745) 
11-28 17:46:12.076: E/Vimeo(4144): at java.lang.reflect.Method.invokeNative(Native Method) 
11-28 17:46:12.076: E/Vimeo(4144): at java.lang.reflect.Method.invoke(Method.java:511) 
11-28 17:46:12.076: E/Vimeo(4144): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 
11-28 17:46:12.076: E/Vimeo(4144): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 
11-28 17:46:12.076: E/Vimeo(4144): at dalvik.system.NativeStart.main(Native Method) 

请建议我... 谢谢提前... :)

+0

请添加相关代码 – slecorne

+0

startActivity(新意图(Intent.ACTION_VIEW,Uri.parse( “http://player.vimeo.com/video/40886162”))) ; – Jay

回答

0

试试这个它会导航到Vimeo应用程序。

try{ 
    Intent browserIntent = null; 
    PackageManager pmi = getPackageManager(); 
    browserIntent =  pmi.getLaunchIntentForPackage("com.vimeo.android.videoapp"); 
    browserIntent.setAction(Intent.ACTION_VIEW); 
// browserIntent.setData(Uri.parse("http://player.vimeo.com/video/83178705")); 

    startActivity(browserIntent); 
} 
catch(Exception e){ 
    // App is not Installed 
    //Navigate to Play Store or display message 
    Toast.makeText(MainActivity.this, "In Catch Block", Toast.LENGTH_SHORT).show(); 
} 
1

这个问题超级陈旧,基于最近更新的Vimeo Android应用程序(2015年12月重新启动)添加了一个新的答案。您现在可以深入到正式的Vimeo Android应用程序中。您可以手动执行此操作,也可以使用vimeo-deeplink库。即使您不使用该库,请查阅其自述文件以获取Vimeo应用程序的deeplink API的说明。您可能也有兴趣Vimeo Android SDK

注:我在Vimeo的工作