mirror of
				https://github.com/TitanEmbeds/Titan.git
				synced 2025-11-04 15:57:02 +01:00 
			
		
		
		
	Autoplay false for twitch.tv video rich embed
This commit is contained in:
		@@ -1387,6 +1387,15 @@
 | 
				
			|||||||
                disembed.isVideo = false;
 | 
					                disembed.isVideo = false;
 | 
				
			||||||
                if (disembed.type == "video") {
 | 
					                if (disembed.type == "video") {
 | 
				
			||||||
                    disembed.isVideo = true;
 | 
					                    disembed.isVideo = true;
 | 
				
			||||||
 | 
					                    if (disembed.video) {
 | 
				
			||||||
 | 
					                        var url = new URL(disembed.video.url);
 | 
				
			||||||
 | 
					                        if (url.hostname.endsWith("twitch.tv")) {
 | 
				
			||||||
 | 
					                            if (url.searchParams.has("autoplay")) {
 | 
				
			||||||
 | 
					                                url.searchParams.set("autoplay", "false");
 | 
				
			||||||
 | 
					                                disembed.video.url = url.toString();
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                disembed.toRenderFooter = false;
 | 
					                disembed.toRenderFooter = false;
 | 
				
			||||||
                if (disembed.footer) {
 | 
					                if (disembed.footer) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user