How to send a link to Vimeo?

偶尔善良 提交于 2019-12-08 07:04:47

问题


How can I send a link from the application that I'm doing now to a specific URL?

 blah.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View arg0) {
                Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://player.vimeo.com/video/83178705?"));
                startActivity(browserIntent);
            }
        });

回答1:


If you wish to open the Vimeo URL in the Vimeo Android application, you can either do as you posted, or you can intent out to the Vimeo application with the correct intent data (a.k.a. deep linking). To help facilitate both of these intent types, you can use the vimeo-deeplink-android library.

For the above video https://www.vimeo.com/83178705 you have two options:

VimeoDeeplink.openUrl(getApplicationContext(), "https://www.vimeo.com/83178705");

VimeoDeeplink.showVideoWithUri(getApplicationContext(), "/videos/83178705");

For the latter request, you could re-write it as:

VimeoDeeplink.showVideoWithUri(getApplicationContext(), VimeoDeeplink.VIMEO_VIDEO_URI_PREFIX + "83178705");

These requests will all open the Vimeo Android application (if installed) and launch the video player.



来源:https://stackoverflow.com/questions/35787253/how-to-send-a-link-to-vimeo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!