mirror of
https://github.com/BluemediaGER/muse.git
synced 2024-11-12 21:05:29 +01:00
Fix YouTube track live attribute (#574)
This commit is contained in:
parent
667894e829
commit
df803b8c76
|
@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
### Fixed
|
||||
- The duration of live YouTube streams is now correctly formatted again
|
||||
|
||||
## [1.6.0] - 2022-03-13
|
||||
### Changed
|
||||
|
|
|
@ -193,7 +193,7 @@ export default class {
|
|||
offset: 0,
|
||||
url,
|
||||
playlist: queuedPlaylist ?? null,
|
||||
isLive: false,
|
||||
isLive: (video as YoutubeVideo).snippet.liveBroadcastContent === 'live',
|
||||
thumbnailUrl: video.snippet.thumbnails.medium.url,
|
||||
};
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ const getPlayerUI = (player: Player) => {
|
|||
const position = player.getPosition();
|
||||
const button = player.status === STATUS.PLAYING ? '⏹️' : '▶️';
|
||||
const progressBar = getProgressBar(15, position / song.length);
|
||||
const elapsedTime = `${prettyTime(position)}/${song.isLive ? 'live' : prettyTime(song.length)}`;
|
||||
const elapsedTime = song.isLive ? 'live' : `${prettyTime(position)}/${prettyTime(song.length)}`;
|
||||
|
||||
return `${button} ${progressBar} \`[${elapsedTime}]\` 🔉`;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue