mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-06 09:56:36 +00:00
Merge branch 'media-control' into media-control
This commit is contained in:
@@ -53,6 +53,8 @@ class ZenMediaController {
|
||||
this.mediaControlBar.setAttribute('hidden', 'true');
|
||||
this.mediaControlBar.removeAttribute('muted');
|
||||
this.mediaControlBar.classList.remove('playing');
|
||||
|
||||
gZenUIManager.updateTabsToolbar();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -65,7 +67,14 @@ class ZenMediaController {
|
||||
this.mediaControlBar.classList.add('playing');
|
||||
}
|
||||
|
||||
this.mediaServiceTitle.textContent = this._currentBrowser._originalURI.displayHost;
|
||||
// Have it displayed as e.g. <white>youtube</white><grey>.com</grey>
|
||||
let host = this._currentBrowser._originalURI.displayHost;
|
||||
if (host.startsWith('www.')) host = host.slice(4);
|
||||
// note: we might have subdomains, so we need to split the host
|
||||
const [service, ...tld] = host.split('.');
|
||||
this.mediaServiceTitle.querySelector('.service').textContent = service;
|
||||
this.mediaServiceTitle.querySelector('.tld').textContent = '.' + tld.join('.');
|
||||
|
||||
this.mediaServiceIcon.src = this._currentBrowser.mIconURL;
|
||||
this.mediaFocusButton.style.listStyleImage = `url(${this._currentBrowser.mIconURL})`;
|
||||
|
||||
@@ -73,6 +82,8 @@ class ZenMediaController {
|
||||
this.mediaTitle.textContent = metadata.title || '';
|
||||
this.mediaArtist.textContent = metadata.artist || '';
|
||||
|
||||
gZenUIManager.updateTabsToolbar();
|
||||
|
||||
this._currentPosition = positionState.position;
|
||||
this._currentDuration = positionState.duration;
|
||||
this.updateMediaPosition();
|
||||
|
Reference in New Issue
Block a user