{"id":66345,"date":"2025-01-02T03:01:00","date_gmt":"2025-01-01T17:01:00","guid":{"rendered":"https:\/\/www.rjmprogramming.com.au\/ITblog\/?p=66345"},"modified":"2025-01-01T21:33:55","modified_gmt":"2025-01-01T11:33:55","slug":"youtube-video-api-event-stop-propagation-idea-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/youtube-video-api-event-stop-propagation-idea-tutorial\/","title":{"rendered":"YouTube Video API Event Stop Propagation Idea Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/esp_ornot_esp.html\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"YouTube Video API Event Stop Propagation Idea Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/esp_ornot_esp.jpg\" title=\"YouTube Video API Event Stop Propagation Idea Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">YouTube Video API Event Stop Propagation Idea Tutorial<\/p><\/div>\n<p>We&#8217;re back using the  <a target=\"_blank\" title='YouTube API for Iframe embedded videos' href='https:\/\/developers.google.com\/youtube\/iframe_api_reference' rel=\"noopener\">YouTube API<\/a> video playing themes of <a title='YouTube Video API Interfacer Audio Play Tutorial' href='#ytvapiiapt'>YouTube Video API Interfacer Audio Play Tutorial<\/a> as a means to setting up a web application that may help explain &#8230;<\/p>\n<p><code><br \/>\n<a target=\"_blank\" title='Information about event.stopPropagation()' href='http:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Event\/stopPropagation' rel=\"noopener\">event.stopPropagation();<\/a><br \/>\n<\/code><\/p>\n<p> &#8230; Javascript event control of it&#8217;s &#8220;bubbling&#8221; <font size=1>(up through an element hierarchy)<\/font>, in other words, depending where you place this, stopping it&#8217;s &#8220;bubbling up&#8221; at that element concerned &#8230;<\/p>\n<blockquote cite='http:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Event\/stopPropagation'><p>\nThe stopPropagation() method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases. It does not, however, prevent any default behaviors from occurring; for instance, clicks on links are still processed. If you want to stop those behaviors, see the preventDefault() method. It also does not prevent propagation to other event-handlers of the current element. If you want to stop those, see stopImmediatePropagation().\n<\/p><\/blockquote>\n<p>We find, around here, we don&#8217;t know we&#8217;ve created a need for event.stopPropagation() usage until we&#8217;ve stumbled onto it, most of the time, so trying to get in ahead of it with today&#8217;s <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/esp_ornot_esp.html_GETME\" rel=\"noopener\">proof of concept<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/esp_ornot_esp.html\" rel=\"noopener\">to event.stopPropagation() or not to event.stopPropagation()<\/a> web application feels a bit novel to us, in a good way.<\/p>\n<p>This means by which to toggle that mode of use was more straightforward than &#8220;data control&#8221; with our musical YouTube API video functionality allowing a user to choose and slot in their own video ideas via either &#8230;<\/p>\n<ul>\n<li>YouTube video ID &#8230; 11 characters long &#8230; or &#8230;<\/li>\n<li>search string to try to select a video, via a programmatically populated dropdown, with an 11 character long YouTube video ID<\/li>\n<\/ul>\n<p> &#8230; asking us to do a fair bit of tweaking to our inhouse interfacing &#8230;<\/p>\n<ul>\n<li><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/karaoke_youtube_api.html----------------------------------GETME\" rel=\"noopener\">tweaked<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/karaoke_youtube_api.html----------------------------------GETME\" rel=\"noopener\">karaoke_youtube_api.htm<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/karaoke_youtube_api.htm\" rel=\"noopener\">inhouse YouTube video interfacer<\/a> &#8230; helped out by &#8230;<\/li>\n<li><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/stop_start_youtube.html----------------GETME\" rel=\"noopener\">tweaked<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/stop_start_youtube.html----------------GETME\" rel=\"noopener\">stop_start_youtube.html<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/stop_start_youtube.html\" rel=\"noopener\">YouTube API caller<\/a><\/li>\n<\/ul>\n<p> &#8230; you might want to try out, yourself, to see what we&#8217;re getting at here, below &#8230;<\/p>\n<p><iframe src=\"\/\/www.rjmprogramming.com.au\/esp_ornot_esp.html\" style=\"width:100%;height:1200px;\"><\/iframe><\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=\"_blank\" href='\/\/www.rjmprogramming.com.au\/ITblog\/youtube-video-api-event-stop-propagation-idea-tutorial\/' rel=\"noopener\">YouTube Video API Event Stop Propagation Idea Tutorial<\/a>.<\/p-->\n<hr>\n<p id='ytvapiiapt'>Previous relevant <a target=\"_blank\" title='YouTube Video API Interfacer Audio Play Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/youtube-video-api-interfacer-audio-play-tutorial\/' rel=\"noopener\">YouTube Video API Interfacer Audio Play Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/karaoke_youtube_api.htm?huh=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/earth_scanner.html\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"YouTube Video API Interfacer Audio Play Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/karaoke_audio.gif\" title=\"YouTube Video API Interfacer Audio Play Tutorial\"  style=\"float:left;\" \/><\/a><p class=\"wp-caption-text\">YouTube Video API Interfacer Audio Play Tutorial<\/p><\/div>\n<p>The recent <a target=\"_blank\" href='https:\/\/www.rjmprogramming.com.au\/ITblog\/making-of-earth-scanner-legs-tutorial\/' title='Making Of Earth Scanner Legs Tutorial' rel=\"noopener\">Making Of Earth Scanner Legs Tutorial<\/a> set us to thinking about how to offer a toggling arrangement between our inhouse YouTube Embedded Iframe API playing of &#8230;<\/p>\n<ul>\n<li>video &#8230; with an incarnation of this that plays &#8230;<\/li>\n<li>audio &#8230; &#8220;sort of&#8221; only (but able to be toggled back to video playing)\n<\/ul>\n<p> &#8230; and it got us wondering how to &#8220;dull out&#8221; a video.  We chose the CSS &#8230;<\/p>\n<p>&lt;style&gt;<br \/>\n<code><br \/>\n iframe {  filter: invert(45%);  }<br \/>\n<\/code><br \/>\n&lt;\/style&gt;<\/p>\n<p>If you want a &#8220;complete dull out&#8221; try <i>filter: invert(50%);<\/i> &#8230; but we wanted to see controls down the bottom, still useful for audio <sub>only<\/sub> playing.<\/p>\n<p>You can try this all out in <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/karaoke_youtube_api.html--------------------------------GETME\" rel=\"noopener\">the changed<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/karaoke_youtube_api.html--------------------------------GETME\" rel=\"noopener\">karaoke_youtube_api.htm<\/a> <a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/karaoke_youtube_api.htm\" rel=\"noopener\">inhouse YouTube video interfacer<\/a>.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d62826' onclick='var dv=document.getElementById(\"d62826\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/audio\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d62826' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d66345' onclick='var dv=document.getElementById(\"d66345\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/youtube\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d66345' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;re back using the YouTube API video playing themes of YouTube Video API Interfacer Audio Play Tutorial as a means to setting up a web application that may help explain &#8230; event.stopPropagation(); &#8230; Javascript event control of it&#8217;s &#8220;bubbling&#8221; (up &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/youtube-video-api-event-stop-propagation-idea-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,14,37],"tags":[88,2397,4291,400,4295,564,576,608,652,997,5051,1319,1369,1493,2017],"class_list":["post-66345","post","type-post","status-publish","format-standard","hentry","category-elearning","category-event-driven-programming","category-tutorials","tag-api","tag-bubble","tag-bubbling","tag-event","tag-event-stoppropagation","tag-hierarchy","tag-html","tag-inheritance","tag-javascript","tag-programming","tag-stoppropagatin","tag-tutorial","tag-video","tag-youtube","tag-youtube-api"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/66345"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=66345"}],"version-history":[{"count":11,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/66345\/revisions"}],"predecessor-version":[{"id":66357,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/66345\/revisions\/66357"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=66345"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=66345"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=66345"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}