mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Move plugins to a dedicated directory
This commit is contained in:
parent
e5a13a2020
commit
128baad126
14 changed files with 11 additions and 11 deletions
45
src/plugins/photoPlayer/plugin.js
Normal file
45
src/plugins/photoPlayer/plugin.js
Normal file
|
@ -0,0 +1,45 @@
|
|||
import connectionManager from 'connectionManager';
|
||||
|
||||
export default class PhotoPlayer {
|
||||
constructor() {
|
||||
this.name = 'Photo Player';
|
||||
this.type = 'mediaplayer';
|
||||
this.id = 'photoplayer';
|
||||
this.priority = 1;
|
||||
}
|
||||
|
||||
play(options) {
|
||||
|
||||
return new Promise(function (resolve, reject) {
|
||||
|
||||
import('slideshow').then(({default: slideshow}) => {
|
||||
|
||||
var index = options.startIndex || 0;
|
||||
|
||||
var apiClient = connectionManager.currentApiClient();
|
||||
|
||||
apiClient.getCurrentUser().then(function(result) {
|
||||
|
||||
var newSlideShow = new slideshow({
|
||||
showTitle: false,
|
||||
cover: false,
|
||||
items: options.items,
|
||||
startIndex: index,
|
||||
interval: 11000,
|
||||
interactive: true,
|
||||
user: result
|
||||
});
|
||||
|
||||
newSlideShow.show();
|
||||
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
canPlayMediaType(mediaType) {
|
||||
|
||||
return (mediaType || '').toLowerCase() === 'photo';
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue