2013-11-28 40 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的工作