mirror of
				https://github.com/DerTyp7/obs-twitch-camera-frame.git
				synced 2025-10-31 05:37:13 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			563 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			563 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| fetch("https://api.tipeeestream.com/v2.0/site/socket")
 | |
| 	.then((res) => res.json())
 | |
| 	.then((json) => {
 | |
| 		if (json.code == 200) {
 | |
| 			const socket = io(`${json.datas.host}:${json.datas.port}`, {
 | |
| 				query: {
 | |
| 					access_token: CONFIG.apiKey,
 | |
| 				},
 | |
| 			});
 | |
| 
 | |
| 			socket.on("connect", () => {
 | |
| 				console.log("Connected");
 | |
| 				socket.emit("join-room", {
 | |
| 					room: CONFIG.apiKey,
 | |
| 					username: "DerTyp876",
 | |
| 				});
 | |
| 			});
 | |
| 			socket.on("new-event", (data) => {
 | |
| 				if (data.event.type == "subscription") {
 | |
| 					sub(data.event.parameters.username);
 | |
| 				}
 | |
| 			});
 | |
| 		}
 | |
| 	});
 | 
