1
0
Fork 0
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:
MrTimscampi 2020-05-30 13:00:51 +02:00
parent 9cae07205c
commit 0c302adbb5

View file

@ -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;