我认为您正在寻找 Media Session API。例如,它可用于设置当前播放媒体的标题。
navigator.mediaSession.metadata = new MediaMetadata({ title: 'My title' });