{"id":4015,"date":"2019-10-28T10:37:01","date_gmt":"2019-10-28T10:37:01","guid":{"rendered":"https:\/\/puvox.software\/blog\/?p=4015"},"modified":"2021-11-14T13:45:48","modified_gmt":"2021-11-14T13:45:48","slug":"snippet-to-copy-current-youtube-video-url-with-time","status":"publish","type":"post","link":"https:\/\/puvox.software\/blog\/snippet-to-copy-current-youtube-video-url-with-time\/","title":{"rendered":"Snippet to copy current Youtube Video Url with Time"},"content":{"rendered":"<div class=\"default-content-clss content_4015 type_post \"><p><img fetchpriority=\"high\" decoding=\"async\" class=\"size-medium wp-image-4017 aligncenter\" src=\"https:\/\/puvox.software\/blog\/wp-content\/uploads\/sites\/2\/2019\/10\/youtube-video-copy-id-time-300x168.png\" alt=\"\" width=\"300\" height=\"168\" srcset=\"https:\/\/puvox.software\/blog\/wp-content\/uploads\/sites\/2\/2019\/10\/youtube-video-copy-id-time-300x168.png 300w, https:\/\/puvox.software\/blog\/wp-content\/uploads\/sites\/2\/2019\/10\/youtube-video-copy-id-time-400x225.png 400w, https:\/\/puvox.software\/blog\/wp-content\/uploads\/sites\/2\/2019\/10\/youtube-video-copy-id-time.png 750w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<h1 style=\"text-align: center;\">Quickly Copy <a href=\"https:\/\/youtube.com\">Youtube<\/a> video url with current time<\/h1>\n<p>While watching the current video and want to quickly get the link to current moment, it&#8217;s a bit long process to do that using YT native menu (you need to click &#8220;Share, then click &#8220;current time&#8221; checkbox and copy the selected link.<\/p>\n<p>There exists a small snippet to do the work. Just select all this code and drag into your Browser&#8217;s bookmarks bar:<\/p>\n\n\n<pre class=\"wp-block-code\"><code>javascript: use_DIRECT_COPY=true; function fallbackCopyTextToClipboard(text) { var textArea = document.createElement(\"textarea\"); textArea.value = text; textArea.style.position=\"fixed\"; document.body.appendChild(textArea); textArea.focus(); textArea.select(); try { var successful = document.execCommand(\"copy\"); } catch (err) { promptCopy1(text); } document.body.removeChild(textArea); } function promptCopy1(text){ prompt(\"url\", text); }; (function(){ var yt=document.getElementById(\"movie_player\"); var data=yt.getVideoData(); var text=data[\"title\"] + \" \" + \"https:\/\/youtu.be\/\"+data[\"video_id\"]+\"?t=\"+Math.floor(yt.getCurrentTime()); if (use_DIRECT_COPY) fallbackCopyTextToClipboard(text); else {promptCopy1(text);} })(); void(0);<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">So, when you are on Youtube video, just click that button and it will copy the link into buffer, with the title.<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<div class=\"default-content-clss excerpt_4015 type_post \"><p>Quickly Copy Youtube video url with current time While watching the current video and want to quickly get the link to current moment, it&#8217;s a bit long process to do<a class=\"excerpt-read-more\" href=\"https:\/\/puvox.software\/blog\/snippet-to-copy-current-youtube-video-url-with-time\/\">(Continue Reading)<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":4017,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[10,13],"tags":[],"class_list":["post-4015","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-browser","category-website"],"_links":{"self":[{"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/posts\/4015","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/comments?post=4015"}],"version-history":[{"count":0,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/posts\/4015\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/media\/4017"}],"wp:attachment":[{"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/media?parent=4015"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/categories?post=4015"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/puvox.software\/blog\/wp-json\/wp\/v2\/tags?post=4015"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}