-
-
Save DHuckaby/e741f188cdce6ac00d75 to your computer and use it in GitHub Desktop.
SimpleYouTubeHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SimpleYouTubeHelper { | |
public static String getImageUrlQuietly(String youtubeUrl) { | |
try { | |
if (youtubeUrl != null) { | |
return String.format("http://img.youtube.com/vi/%s/0.jpg", Uri.parse(youtubeUrl).getQueryParameter("v")); | |
} | |
} catch (UnsupportedOperationException e) { | |
e.printStackTrace(); | |
} | |
return null; | |
} | |
public static String getTitleQuietly(String youtubeUrl) { | |
try { | |
if (youtubeUrl != null) { | |
URL embededURL = new URL("http://www.youtube.com/oembed?url=" + youtubeUrl + "&format=json"); | |
return new JSONObject(IOUtils.toString(embededURL)).getString("title"); | |
} | |
} catch (JSONException e) { | |
e.printStackTrace(); | |
} catch (IOException e) { | |
e.printStackTrace(); | |
} | |
return null; | |
} | |
} |
Hello can you please give me IOUtils.toString(embededURL) this method
just mail me on guris.1068@gmail.com
Thanks in advance
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Simple adroid app
Hello, I am struggling with an assignment in my android development class which requires me to build a simple android app that will connect two devices via Bluetooth, then share information about what YouTube video one device is playing on its browser . This will be implemented in such a way that the discoverable Bluetooth name is always updated as the name of the current YouTube video. Lastly, the user on the other device should be able to click on the YouTube video information and have a browser launch to play the video.
A simple GUI where all of these can be implemented would be appreciated.
Please help me with this and I will be willing to make a donation to your YouTube channel.
You can contact me on soyaleye@gmail.com.
Thanks.