I rolled up the working method (for video in youtube) in which I process the user's link (I pull out the ID and substitute it in the template link form):
private String onUserInput(String input) { Uri uri = Uri.parse(input); String videoID = uri.getQueryParameter("v"); if (TextUtils.isEmpty(videoID)) { String[] str = input.split("/"); videoID = str[str.length - 1]; } url = "http://img.youtube.com/vi/" + videoID + "/0.jpg"; Log.d("url", url + " " + controlList.get(23).getImageUploads().size()); adapterForm.notifyDataSetChanged(); return url; } Help to correctly update the method for the link in vimeo:
https://vimeo.com/api/v2/video/183364240.json As I understand it, you need to also parse the data from the link, since .json And already after I pull out the link, it will be possible to access any image size (thumbnail_small, thumbnail_medium, thumbnail_large), like about here:
https://i.vimeocdn.com/video/595198868_100x75.jpg I tried to update the method as follows, but even before I read about JSON:
private void useLinkInput(String input, EVideo video) { Uri uri = Uri.parse(input); String videoID = uri.getQueryParameter("v"); if (TextUtils.isEmpty(videoID)) { String[] str = input.split("/"); videoID = str[str.length - 1]; } if (video == EVideo.YOUTUBE) { source = "http://img.youtube.com/vi/"; } else { source = "http://VIMEO.CN"; } url = source + videoID + "/0.jpg"; Log.d("url", url); } Variables declared so:
public enum EVideo { YOUTUBE, VIMEO } I'm not sure that the attempt is " counted " because problems arise with the json operation itself, how is it possible to push it into our code?
https://vimeo.com/api/v2/video/183364240.jsonto get the number183364240? - post_zeew