Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Error 153 on Youtube Videos

MeganCox
Tera Contributor

Everything has been working perfectly fine for months now. But this week, on all of the YouTube videos on our intranet pages, there's an error code 153. I haven't been able to find information on what the issue is. 

 

We used the Rich Content editor with the Video block and entered YouTube information on all the videos on topic pages. We have not changed any settings on our YouTube, and our IT department has let me know we have not made any updates to policies that would affect YouTube or ServiceNow. The only videos working are the ones that we have in the Video Carousel widget. I updated all of the videos the other day, and it randomly started working for an hour or so, but then it went back to having issues. 

Has anyone else experienced this? Any ideas for fixes that still allow us to have a video within the Rich Content widget?

MeganCox_0-1757691887213.png

 

39 REPLIES 39

Pooja_Patil
ServiceNow Employee
ServiceNow Employee

Some users reported following worked for them, might work for you - 

Adding referrerpolicy="strict-origin-when-cross-origin" on the iframe element

  1. Enable code editor in RCE - Content Publishing > AdvancedPooja_Patil_1-1758038682624.png
  2. Open content, click on video component and click on edit code Pooja_Patil_2-1758039134913.png
  3. Add referrerpolicy attribute and click apply, save the content.Pooja_Patil_3-1758039201875.png

     

     

 

 

 

for some reason after i add this additional name/value pair 'referrerpolicy="strict-origin-when-cross-origin" ' to the videos they work, until I save or publish and the value is removed!!

 

I ran into the same issue. I ended up creating a "Youtube Video Helper" widget to sit in a copied kb_article_view page the Knowledge Article Content widget lives in.
Below is the extra widget I added to the page:

//CSS
/* Widget is invisible */
.youtube-helper {
	display: none;
}

 

//CLIENT
function($timeout) {
	var c = this;
	
	// Function to fix YouTube iframes
	function fixYouTubeIframes() {
		$timeout(function() {
			try {
				var origin = window.location.protocol + '//' + window.location.host;
				var selector = "iframe[src*='youtube.com/embed'], iframe[src*='youtube-nocookie.com/embed'], iframe[src*='youtu.be']";
				var iframes = document.querySelectorAll(selector);
				
				Array.prototype.forEach.call(iframes, function(iframe) {
					var rawsrc=iframe.getAttribute('src');
					if (!rawSrc) return;
					
					try {
						var url = new URL(rawSrc, window.location.href);
						
						// Add required parameters
						if (!url.searchParams.has('origin')) {
							url.searchParams.set('origin', origin);
						}
						if (!url.searchParams.has('rel')) {
							url.searchParams.set('rel', '0');
						}
						if (!url.searchParams.has('modestbranding')) {
							url.searchParams.set('modestbranding', '1');
						}
						
						// Set referrerpolicy
						if (!iframe.hasAttribute('referrerpolicy')) {
							iframe.setAttribute('referrerpolicy', 'strict-origin-when-cross-origin');
						}
						
						// Update src if changed
						var newsrc=url.toString();
						if (newSrc !== rawSrc) {
							iframe.setAttribute('src', newSrc);
						}
					} catch (e) {
						// Skip invalid URLs
					}
				});
			} catch (e) {
				// Silent fail
			}
		}, 1000); // Wait 1 second for content to load
	}
	
	// Run on initial load
	fixYouTubeIframes();
	
	// Run again after 2 seconds (catch late-loading content)
	$timeout(fixYouTubeIframes, 2000);
	
	// Run again after 4 seconds (catch very late content)
	$timeout(fixYouTubeIframes, 4000);
}

 

 

If value is getting removed that could mean your HTMLSanitizerConfig has blacklisted that attribute - 

https://www.servicenow.com/docs/bundle/zurich-platform-security/page/administer/security/task/t_Conf...

Johan van den H
Kilo Sage

We are also experiencing the "error 153" issue with embedded Youtube video's.
This seems to be something that needs a central solution instead of us having to edit all individual links manually.