diff --git a/shaka_handler.js b/shaka_handler.js index 39139eb..31916c3 100644 --- a/shaka_handler.js +++ b/shaka_handler.js @@ -245,7 +245,38 @@ async function playChannelInShaka(channel, windowId) { return; } - instance.channel = channel; + instance.channel = channel; + + const newTitle = channel.name || 'Advanced DRM Player'; + const titleElement = instance.container.querySelector('.player-window-title'); + if (titleElement) { + titleElement.textContent = newTitle; + } + const taskbarItem = document.getElementById(`taskbar-item-${windowId}`); + if (taskbarItem) { + taskbarItem.title = newTitle; + const taskbarText = taskbarItem.querySelector('.taskbar-item-text'); + if (taskbarText) { + taskbarText.textContent = newTitle; + } + + const iconContainer = taskbarItem.querySelector('.taskbar-item-icon-container'); + if (iconContainer) { + const logoSrc = channel['tvg-logo'] || ''; + let iconHtml; + if (logoSrc) { + iconHtml = ` + `; + } else { + iconHtml = `${newTitle.charAt(0)}`; + } + iconContainer.innerHTML = iconHtml; + } + } + if (document.title.includes("Advanced DRM Player")) { + document.title = newTitle; + } + const player = instance.player; const videoElement = instance.videoElement;