How can I get the actual video URL of a YouTube live stream?

You need to get the HLS m3u8 playlist files from the video’s manifest. There are ways to do this by hand, but for simplicity I’ll be using the youtube-dl tool to get this information. I’ll be using this live stream as an example: https://www.youtube.com/watch?v=_Gtc-GtLlTk First, get the formats of the video: ➜ ~ youtube-dl –list-formats … Read more

youtube api v3 page tokens

You’re experiencing what is intended; using the nextPageToken, you can only get up to 500 results. If you’re interested in the development of how this came about, you could read through this thread: https://code.google.com/p/gdata-issues/issues/detail?id=4282 But as a summary of that thread, it basically comes down to the fact that, with so much data on YouTube, … Read more

YouTube API v3 get all channels associated with a logged in user

Found the answer in YouTube’s API Blog here: http://apiblog.youtube.com/2013/06/google-page-identities-and-youtube-api.html According to this as I’m using Android with OAuth2 there is no native Android account switcher, and the then the API will choose the “wrong” channel in some cases, or even no channel (e.g., if the personal account doesn’t have a channel). So I’ve got two … Read more

Embed a YouTube video to JFrame?

Here’s the way I usualy use to embed YouTube videos into Swing application. Instead of YouTube API a native browser component is embedded into JPanel using DJ Native Swing: public class YouTubeViewer { public static void main(String[] args) { NativeInterface.open(); SwingUtilities.invokeLater(new Runnable() { public void run() { JFrame frame = new JFrame(“YouTube Viewer”); frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); frame.getContentPane().add(getBrowserPanel(), … Read more

Struggling with Youtube Player Support Fragment

I ran into this problem before and I believe the issue stemmed from trying to inflate the YouTubePlayerSupportFragment layout. I solved my issue by creating a fragment like this: public class PlayerYouTubeFrag extends YouTubePlayerSupportFragment { private String currentVideoID = “video_id”; private YouTubePlayer activePlayer; public static PlayerYouTubeFrag newInstance(String url) { PlayerYouTubeFrag playerYouTubeFrag = new PlayerYouTubeFrag(); Bundle … Read more

Pause youtube video, youtube api

Use player.playVideo(); (resume) and player.pauseVideo(); (pause) once the player is ready: http://jsfiddle.net/4WPmY/6/ function onYouTubePlayerAPIReady() {     player = new YT.Player(‘player’, {         height: ‘315’,         width: ‘560’,         videoId: ‘bpOR_HuHRNs’,     });     document.getElementById(‘resume’).onclick = function() {         player.playVideo();     };     document.getElementById(‘pause’).onclick = function() {   … Read more