diff --git a/.gitignore b/.gitignore index 10ddf14..ec6f44b 100755 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ msi-packager.js package-lock.json *.js !renderers/main/injection.js -!renderers/main/offline_banner.js \ No newline at end of file +!renderers/main/offline_banner.js +!renderers/main/titleBar.js \ No newline at end of file diff --git a/README.es-ES.md b/README.es-ES.md index 2d74e2b..b51c738 100644 --- a/README.es-ES.md +++ b/README.es-ES.md @@ -3,9 +3,9 @@ # **YouTube TV** [![Downloads](https://img.shields.io/github/downloads/marcosrg9/YouTubeTV/total.svg?color=FF0000&label=Total%20downloads)](https://github.com/marcosrg9/YouTubeTV/releases/) -[![Downloads](https://img.shields.io/github/downloads/marcosrg9/YouTubeTV/v2.3.4/total.svg?color=blue&label=2.3.4%20Downloads)](https://github.com/marcosrg9/YouTubeTV/releases/tag/v2.3.4) +[![Downloads](https://img.shields.io/github/downloads/marcosrg9/YouTubeTV/v2.4.1/total.svg?color=blue&label=2.4.1%20Downloads)](https://github.com/marcosrg9/YouTubeTV/releases/tag/v2.4.1) -Cliente de YouTube TV sencillo para escritorio basado en [electron](https://www.electronjs.org/). Puede conectar un dispositivo compatible, como un teléfono o un equipo con Google Chrome y enviar los vídeos a la aplicación para visualizarlos. +Cliente de YouTube TV sencillo para escritorio basado en [electron](https://www.electronjs.org/). Puede conectar un dispositivo compatible, como un teléfono o un equipo con Google Chrome y enviar los vídeos a la aplicación para visualizarlos, igual que en ChromeCast o televisores inteligentes con YouTube. @@ -33,19 +33,17 @@ Si ya tiene instalado electron de forma global, podrá iniciar la app con ```ele ## 📦 Builds El proyecto se puede descargar compilado y listo para su uso. Disponible para Linux, macOS y Windows. En arquitecturas x86, x64 y ARM. -**⚠️ Nota: La arquitectura de 32 bits ya no es soportada para Linux, y se planea eliminar el soporte para Windows en el futuro.** - | Platform | Architecture | Link | |---------------|:----------------:|:------:| -| Windows | x32/x64 | [Descargar](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.3.4/YouTube.TV-2.3.4.exe) | -| Linux (Deb) | x64 | [Descargar](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.3.4/YouTube.TV-2.3.4-amd64.deb) | -| Linux (Deb) | ARM64 | [Descargar](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.3.4/YouTube.TV-2.3.4-arm64.deb) | -| Linux (Deb) | ARMv7l | [Descargar](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.3.4/YouTube.TV-2.3.4-armv7l.deb) | -| Linux (RPM) | x64 | [Descargar](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.3.4/YouTube.TV-2.3.4-x86_64.rpm) | -| Linux (RPM) | ARMv7l | [Descargar](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.3.4/YouTube.TV-2.3.4-armv7l.rpm) | -| Linux (RPM) | ARM64 | [Descargar](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.3.4/YouTube.TV-2.3.4-aarch64.rpm) | -| macOS | Intel (x64) | [Descargar](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.3.4/YouTube.TV-2.3.4.dmg) | -| macOs | Apple Chip (ARM) | [Descargar](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.3.4/YouTube.TV-2.3.4-arm64.dmg) | +| Windows | x32/x64 | [Descargar](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.4.1/YouTube_TV-2.4.1.exe) | +| Linux (Deb) | x64 | [Descargar](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.4.1/YouTube_TV-2.4.1-amd64.deb) | +| Linux (Deb) | ARM64 | [Descargar](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.4.1/YouTube_TV-2.4.1-arm64.deb) | +| Linux (Deb) | ARMv7l | [Descargar](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.4.1/YouTube_TV-2.4.1-armv7l.deb) | +| Linux (RPM) | x64 | [Descargar](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.4.1/YouTube_TV-2.4.1-x86_64.rpm) | +| Linux (RPM) | ARMv7l | [Descargar](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.4.1/YouTube_TV-2.4.1-armv7l.rpm) | +| Linux (RPM) | ARM64 | [Descargar](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.4.1/YouTube_TV-2.4.1-aarch64.rpm) | +| macOS | Intel (x64) | [Descargar](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.4.1/YouTube_TV-2.4.1.dmg) | +| macOs | Apple Chip (ARM) | [Descargar](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.4.1/YouTube_TV-2.4.1-arm64.dmg) | [Todas las builds](https://github.com/marcosrg9/YouTubeTV/releases/latest) @@ -58,12 +56,13 @@ El proyecto se puede descargar compilado y listo para su uso. Disponible para Li No comprobado en Windows y macOS para plataformas ARM, excepto linux ARM para Raspberry (armv7l). -## 🔌 Mensaje fuera de conexión – [Última actualización – 2.3.4] - -Cuando YouTube TV carga sin conexión, mostrará un mensaje indicando que no es posible conectarse con los servidores de YouTube. - -Cuando el renderizador detecte conectividad, lo volverá a intentar nuevamente. - +## ⚡️ Últimos cambios [2.4.0/2.4.1] +### **2.4.1** +- Error solucionado por el cual el proceso de YouTube TV no se cerraba completamente en plataformas que no fueran macOS. +- La barra de título es transparente (solo para macOS). +- La barra de título de la ventana de configuración no cargaba el título en español. +### **2.4.0** +- YouTube TV almacena parámetros del estado de la ventana principal de forma persistente, tales como posición, tamaño, pantalla completa y visibilidad del cursor. ## 🔧 Configuración diff --git a/README.md b/README.md index 2eb46f9..ed8842b 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,9 @@ # **YouTube TV** [![Downloads](https://img.shields.io/github/downloads/marcosrg9/YouTubeTV/total.svg?color=FF0000&label=Total%20downloads)](https://github.com/marcosrg9/YouTubeTV/releases/) -[![Downloads](https://img.shields.io/github/downloads/marcosrg9/YouTubeTV/v2.3.4/total.svg?color=blue&label=2.3.4%20Downloads)](https://github.com/marcosrg9/YouTubeTV/releases/tag/v2.3.4) +[![Downloads](https://img.shields.io/github/downloads/marcosrg9/YouTubeTV/latest/total.svg?color=blue&label=2.4.1%20Downloads)](https://github.com/marcosrg9/YouTubeTV/releases/tag/v2.4.1) -Simple YouTube TV Client for desktop based on [electron](https://www.electronjs.org/). It can connect with a compatible device, like a phone or a computer with Google Chrome and send videos to the application to visualize them. +Simple YouTube TV Client for desktop based on [electron](https://www.electronjs.org/). You can connect a compatible device such as a phone or computer with Google Chrome and send videos to the app for viewing, just like on ChromeCast or smart TVs with YouTube. @@ -28,20 +28,19 @@ It can use ```npm start``` or else ```npx electron .``` . If you already have electron installed globally, you can start the app with ```electron .``` ## 📦 Builds -The project can be downloaded already built and ready to use. Available for Linux, macOS and Windows. On x86, x84 and ARM architectures.\ -**⚠️ Note: The 32-bit architecture is no longer supported on Linux, and support for Windows is planned to be removed in the future.** +The project can be downloaded already built and ready to use. Available for Linux, macOS and Windows. On x86, x84 and ARM architectures. | Platform | Architecture | Link | |---------------|:----------------:|:------:| -| Windows | x32/x64 | [Download](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.3.4/YouTube.TV-2.3.4.exe) | -| Linux (Deb) | x64 | [Download](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.3.4/YouTube.TV-2.3.4-amd64.deb) | -| Linux (Deb) | ARM64 | [Download](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.3.4/YouTube.TV-2.3.4-arm64.deb) | -| Linux (Deb) | ARMv7l | [Download](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.3.4/YouTube.TV-2.3.4-armv7l.deb) | -| Linux (RPM) | x64 | [Download](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.3.4/YouTube.TV-2.3.4-x86_64.rpm) | -| Linux (RPM) | ARMv7l | [Download](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.3.4/YouTube.TV-2.3.4-armv7l.rpm) | -| Linux (RPM) | ARM64 | [Download](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.3.4/YouTube.TV-2.3.4-aarch64.rpm) | -| macOS | Intel (x64) | [Download](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.3.4/YouTube.TV-2.3.4.dmg) | -| macOs | Apple Chip (ARM) | [Download](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.3.4/YouTube.TV-2.3.4-arm64.dmg) | +| Windows | x32/x64 | [Download](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.4.1/YouTube_TV-2.4.1.exe) | +| Linux (Deb) | x64 | [Download](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.4.1/YouTube_TV-2.4.1-amd64.deb) | +| Linux (Deb) | ARM64 | [Download](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.4.1/YouTube_TV-2.4.1-arm64.deb) | +| Linux (Deb) | ARMv7l | [Download](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.4.1/YouTube_TV-2.4.1-armv7l.deb) | +| Linux (RPM) | x64 | [Download](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.4.1/YouTube_TV-2.4.1-x86_64.rpm) | +| Linux (RPM) | ARMv7l | [Download](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.4.1/YouTube_TV-2.4.1-armv7l.rpm) | +| Linux (RPM) | ARM64 | [Download](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.4.1/YouTube_TV-2.4.1-aarch64.rpm) | +| macOS | Intel (x64) | [Download](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.4.1/YouTube_TV-2.4.1.dmg) | +| macOs | Apple Chip (ARM) | [Download](https://github.com/marcosrg9/YouTubeTV/releases/download/v2.4.1/YouTube_TV-2.4.1-arm64.dmg) | [All builds](https://github.com/marcosrg9/YouTubeTV/releases/latest) @@ -53,11 +52,13 @@ The project can be downloaded already built and ready to use. Available for Linu Not tested on Windows and macOS for ARM platforms, except for ARM Linux for Raspberry (armv7l). -## 🔌 Offline message – [Last update – 2.3.4] -When YouTube TV loads offline, it will display a message indicating that it has been unable to connect to YouTube's servers. - -When the renderer detects connectivity, it will try again. - +## ⚡️ Last changes [2.4.0/2.4.1] +### **2.4.1** +- Fixed bug where the YouTube TV process would not close completely on platforms other than macOS. +- The title bar is transparent (macOS only). +- The title bar of the window did not load the Spanish title. +### **2.4.0** +- YouTube TV persistently stores parameters of the main window state, such as position, size, full screen and cursor visibility. ## 🔧 Configuration diff --git a/package.json b/package.json index 8e98ff9..9d1ef5c 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { - "name": "youtube-tv-electron", + "name": "youtube-tv", "productName": "YouTube TV", - "version": "2.4.0", - "description": "Cliente de YouTube TV sencillo para escritorio basado en electron.", + "version": "2.4.1", + "description": "Simple YouTube TV client for desktop based on electron.", "main": "main.js", "scripts": { "start": "electron main.js", diff --git a/readme/demo_player.png b/readme/demo_player.png index c7fef6e..ffbb4e6 100644 Binary files a/readme/demo_player.png and b/readme/demo_player.png differ diff --git a/renderers/main/injection.js b/renderers/main/injection.js index 99a0165..ca50874 100644 --- a/renderers/main/injection.js +++ b/renderers/main/injection.js @@ -185,6 +185,4 @@ loadConnectionEvents(); // Escucha las peticiones de consultas al localStorage. listenLocalStorageQueries(); -// Indica al proceso principal que el código se ha cargado. - console.log('JavaScript enhancements loaded at', new Date(Date.now()).toISOString()); \ No newline at end of file diff --git a/renderers/main/main.renderer.ts b/renderers/main/main.renderer.ts index 2eac513..b71ea4a 100644 --- a/renderers/main/main.renderer.ts +++ b/renderers/main/main.renderer.ts @@ -48,6 +48,9 @@ export class Renderer { /** JavaScript injection code */ private jsic: string = ''; + /** JavaScript injection title bar styles */ + private titleBar: string = ''; + constructor() { // Set app menu to null. @@ -61,7 +64,7 @@ export class Renderer { this.url = '__DFT__'; - this.window.webContents.on('dom-ready', this.injectJSCode.bind(this) ); + this.window.webContents.on('dom-ready', () => this.injectJSCode.bind(this)); this.setAccelerators(); @@ -77,9 +80,7 @@ export class Renderer { } }) }) - .on('window-all-closed', () => { - if (platform() === 'darwin') app.quit(); - }) + .on('window-all-closed', () => { app.quit() }) } /** Create a new renderer window. */ @@ -88,7 +89,7 @@ export class Renderer { this.window = new BrowserWindow({ width: 1230, height: 720, - titleBarStyle: 'default', + titleBarStyle: platform() === 'darwin' ? 'hiddenInset' : 'default', fullscreen: false, fullscreenable: true, title: 'YouTube TV', @@ -105,16 +106,34 @@ export class Renderer { } - /** Inject a JavaScript code into the renderer process to patch events and add some features. */ - private async injectJSCode() { + /** + * Inject a JavaScript code into the renderer process to patch events and add some features. + * @param script Type of script to be injected. + * */ + private async injectJSCode(script: 'all' | 'patchs' | 'titlebar' = 'all') { try { if (this.jsic === '') { this.jsic = await readFile(join(__dirname, 'injection.js'), { encoding: 'utf8' }); } - - this.window.webContents.executeJavaScript(this.jsic); + + if (platform() === 'darwin' && this.titleBar === '') { + this.titleBar = await readFile(join(__dirname, 'titleBar.js'), { encoding: 'utf8' }); + + } + + if (script === 'all') { + this.window.webContents.executeJavaScript(this.jsic); + platform() === 'darwin' ? this.window.webContents.executeJavaScript(this.titleBar) : false; + + } else if (script === 'patchs') { + this.window.webContents.executeJavaScript(this.jsic); + + } else if (script === 'titlebar') { + platform() === 'darwin' ? this.window.webContents.executeJavaScript(this.titleBar) : false; + + } } catch (error) { debugger; @@ -280,7 +299,7 @@ export class Renderer { } }) .catch(err => { - // If the data is not valid or not available, set the default resolution. + // If the data is invalid or not available, set the default resolution. this.setResEmulator(3840, 2160); }) @@ -297,10 +316,14 @@ export class Renderer { if (value === '__DFT__') url = ''; this.window.loadURL(this._url + url, { userAgent: this.userAgent }) + .then(() => { + this.injectJSCode(); + }) .catch(async() => { ipcMain.once('restored', () => { this.url = value }); + this.injectJSCode('titlebar'); const offline = await readFile(join(__dirname, 'offline_banner.js'), { encoding: 'utf8' }); this.window.webContents.executeJavaScript(offline); @@ -314,11 +337,15 @@ export class Renderer { this.window.fullScreen = true; this.window.webContents.loadURL(this._url + value, { userAgent: this.userAgent }) + .then(() => { + this.injectJSCode(); + }) // This should never happen... .catch(async() => { - ipcMain.once('restored', () => { this.url = value }); - + ipcMain.once('restored', () => { this.urlByDial = value }); + + this.injectJSCode('titlebar'); const offline = await readFile(join(__dirname, 'offline_banner.js'), { encoding: 'utf8' }); this.window.webContents.executeJavaScript(offline); diff --git a/renderers/main/titleBar.js b/renderers/main/titleBar.js new file mode 100644 index 0000000..172f549 --- /dev/null +++ b/renderers/main/titleBar.js @@ -0,0 +1,15 @@ +const loadDraggableTittleBar = () => { + + const titlebar = document.createElement('div'); + + titlebar.id = 'draggable_titlebar'; + + titlebar.style.width = '100%'; + titlebar.style.height = '35px'; + titlebar.style['-webkit-app-region'] = 'drag'; + + document.body.appendChild(titlebar); + +} + +loadDraggableTittleBar(); \ No newline at end of file diff --git a/renderers/settings/index.html b/renderers/settings/index.html index 595330b..d7ff8ec 100644 --- a/renderers/settings/index.html +++ b/renderers/settings/index.html @@ -80,6 +80,8 @@