Force youtube embed to start in 720p

(This answer was updated, as the previous method using vq isn’t recognized anymore.) Specifying the height of the video will change the quality accordingly. example for html 5; <iframe style=”width:100%; height:800px;” src=”https://www.youtube.com/embed/xxxxxxxx”></iframe> If you don’t want to hardcode the width and height you can add a class to the iframe for css media queries. Tested … Read more

Code for download video from Youtube on Java, Android

3 steps: Check the source code (HTML) of YouTube, you’ll get the link like this http%253A%252F%252Fo-o.preferred.telemar-cnf1.v18.lscache6.c.youtube.com%252Fvideoplayback … Decode the url (remove the codes %2B, %25, etc), create a decoder with the codes and use the function Uri.decode(url) to replace invalid escaped octets Use the code to download stream: URL u = null; InputStream is = … Read more

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 Autoplay does not work with iFrame

It’s not working since April of 2018 because Google decided to give greater control of playback to users. You just need to add &mute=1 to your URL. Autoplay Policy Changes <iframe id=”existing-iframe-example” width=”640″ height=”360″ src=”https://www.youtube.com/embed/-SFcIUEvNOQ?autoplay=1&mute=1&enablejsapi=1″ frameborder=”0″ style=”border: solid 4px #37474F” ></iframe> Update : Audio/Video Updates in Chrome 73 Google said : Now that Progressive Web … Read more

How can I list the uploads from a YouTube Channel?

Once you have the channel_id, change the highlighted letter as is shown: Channel: Microsoft Hololens Channel_id: UCT2rZIAL-zNqeK1OmLLUa6g Uploads (playlist): UUT2rZIAL-zNqeK1OmLLUa6g Once you have the uploads playlist, you can use this request for get the uploaded videos: https://www.googleapis.com/youtube/v3/playlistItems?part=snippet%2CcontentDetails&playlistId=<UPLOAD_PLAYLIST_ID>&fields=items(contentDetails(videoId%2CvideoPublishedAt)%2Csnippet(publishedAt%2Ctitle))&key={YOUR_API_KEY} And these are the results: { “nextPageToken”: “CAUQAA”, “pageInfo”: { “totalResults”: 61, “resultsPerPage”: 5 }, “items”: [ { … Read more

Youtube Video in WebView doesn’t load

Now it works, with a combination of some things: public class Videos extends Activity { private WebView mWebView; private String extra; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.videos_layout); extra = getIntent().getStringExtra(“VideosId”); mWebView = (WebView) findViewById(R.id.videos_webview); mWebView.getSettings().setJavaScriptEnabled(true); mWebView.getSettings().setPluginsEnabled(true); final Activity activity = this; mWebView.setWebChromeClient(new WebChromeClient() { public void onProgressChanged(WebView view, int progress) { // Activities … 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