/*Canopy - The next generation of stoner streaming software Copyright (C) 2024 Rainbownapkin and the TTN Community This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see .*/ class channel{ constructor(){ //Establish connetion to the server via socket.io this.connect(); //Define socket listeners this.defineListeners(); //Scrape channel name off URL this.channelName = window.location.pathname.split('/c/')[`1`]; //Create the Video Player Object this.player = new player(this); //Create the Chat Box Object this.chatBox = new chatBox(this); //Create the User List Object this.userList = new userList(this); //Create the Canopy Panel Object this.cPanel = new cPanel(this); } connect(){ this.socket = io(); } defineListeners(){ //This function should serve mostly to glue functions from channel and it's children to it's socket's listeners. this.socket.on("connect", () => { document.title = `${this.channelName} - Connected` }); } } const client = new channel();