2020-05-19 03:59:37 +09:00
|
|
|
import connectionManager from 'connectionManager';
|
|
|
|
|
|
|
|
export class PhotoPlayer {
|
|
|
|
constructor() {
|
|
|
|
this.name = 'Photo Player';
|
|
|
|
this.type = 'mediaplayer';
|
|
|
|
this.id = 'photoplayer';
|
|
|
|
this.priority = 1;
|
2018-10-23 01:05:09 +03:00
|
|
|
}
|
2019-01-10 15:39:37 +03:00
|
|
|
|
2020-05-19 03:59:37 +09:00
|
|
|
play(options) {
|
2019-01-10 15:39:37 +03:00
|
|
|
|
|
|
|
return new Promise(function (resolve, reject) {
|
|
|
|
|
2020-05-29 16:47:21 +09:00
|
|
|
import('slideshow').then(({default: slideshow}) => {
|
2019-01-10 15:39:37 +03:00
|
|
|
|
2018-10-23 01:05:09 +03:00
|
|
|
var index = options.startIndex || 0;
|
2019-01-10 15:39:37 +03:00
|
|
|
|
2020-05-02 00:57:51 +05:30
|
|
|
var apiClient = connectionManager.currentApiClient();
|
2020-05-02 02:40:48 +05:30
|
|
|
|
2020-05-02 02:54:14 +05:30
|
|
|
apiClient.getCurrentUser().then(function(result) {
|
2020-05-02 02:40:48 +05:30
|
|
|
|
|
|
|
var newSlideShow = new slideshow({
|
|
|
|
showTitle: false,
|
|
|
|
cover: false,
|
|
|
|
items: options.items,
|
|
|
|
startIndex: index,
|
|
|
|
interval: 11000,
|
|
|
|
interactive: true,
|
|
|
|
user: result
|
2020-05-02 00:57:51 +05:30
|
|
|
});
|
2020-05-02 02:40:48 +05:30
|
|
|
|
|
|
|
newSlideShow.show();
|
|
|
|
|
|
|
|
resolve();
|
2019-01-10 15:39:37 +03:00
|
|
|
});
|
2020-05-02 02:40:48 +05:30
|
|
|
});
|
2019-01-10 15:39:37 +03:00
|
|
|
});
|
2020-05-19 03:59:37 +09:00
|
|
|
}
|
2019-01-10 15:39:37 +03:00
|
|
|
|
2020-05-19 03:59:37 +09:00
|
|
|
canPlayMediaType(mediaType) {
|
2019-01-10 15:39:37 +03:00
|
|
|
|
|
|
|
return (mediaType || '').toLowerCase() === 'photo';
|
2020-05-19 03:59:37 +09:00
|
|
|
}
|
|
|
|
}
|
2019-01-10 15:39:37 +03:00
|
|
|
|
2020-05-19 03:59:37 +09:00
|
|
|
export default PhotoPlayer;
|