mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Add format checking to EPUB player
This commit is contained in:
parent
9cae07205c
commit
0c302adbb5
1 changed files with 7 additions and 17 deletions
|
@ -215,24 +215,7 @@ export class BookPlayer {
|
|||
Id: item.Id
|
||||
}
|
||||
};
|
||||
if (!item.Path.endsWith('.epub')) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let errorDialog = dialogHelper.createDialog({
|
||||
size: 'small',
|
||||
autoFocus: false,
|
||||
removeOnClose: true
|
||||
});
|
||||
|
||||
errorDialog.innerHTML = '<h1 class="bookplayerErrorMsg">This book type is not supported yet</h1>';
|
||||
|
||||
this.stop();
|
||||
|
||||
dialogHelper.open(errorDialog);
|
||||
loading.hide();
|
||||
|
||||
return resolve();
|
||||
});
|
||||
}
|
||||
let serverId = item.ServerId;
|
||||
let apiClient = connectionManager.getApiClient(serverId);
|
||||
|
||||
|
@ -283,6 +266,13 @@ export class BookPlayer {
|
|||
canPlayMediaType(mediaType) {
|
||||
return (mediaType || '').toLowerCase() === 'book';
|
||||
}
|
||||
|
||||
canPlayItem(item) {
|
||||
if (item.Path && (item.Path.endsWith('epub'))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
export default BookPlayer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue