mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add check that an item can be played before playing via default action
This commit is contained in:
parent
76d2b7018c
commit
481e62a6e0
1 changed files with 9 additions and 5 deletions
|
@ -204,11 +204,15 @@ import toast from './toast/toast';
|
||||||
} else if (action === 'play' || action === 'resume') {
|
} else if (action === 'play' || action === 'resume') {
|
||||||
const startPositionTicks = parseInt(card.getAttribute('data-positionticks') || '0');
|
const startPositionTicks = parseInt(card.getAttribute('data-positionticks') || '0');
|
||||||
|
|
||||||
playbackManager.play({
|
if (playbackManager.canPlay(item)) {
|
||||||
ids: [playableItemId],
|
playbackManager.play({
|
||||||
startPositionTicks: startPositionTicks,
|
ids: [playableItemId],
|
||||||
serverId: serverId
|
startPositionTicks: startPositionTicks,
|
||||||
});
|
serverId: serverId
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.warn('Unable to play item', item);
|
||||||
|
}
|
||||||
} else if (action === 'queue') {
|
} else if (action === 'queue') {
|
||||||
if (playbackManager.isPlaying()) {
|
if (playbackManager.isPlaying()) {
|
||||||
playbackManager.queue({
|
playbackManager.queue({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue