ngx-soundmanager2
Version:
SoundManager2 Music Player for Angular2+
61 lines • 1.96 kB
JavaScript
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
import { Directive, HostListener, Input } from '@angular/core';
import { MusicPlayerService } from './music-player.service';
export class PlayAllDirective {
/**
* @param {?} _musicPlayerService
*/
constructor(_musicPlayerService) {
this._musicPlayerService = _musicPlayerService;
this.play = true;
}
/**
* @return {?}
*/
onClick() {
this._musicPlayerService.clearPlaylist(() => {
for (let /** @type {?} */ i = 0; i < this.songs.length; i++) {
this._musicPlayerService.addTrack(this.songs[i]);
}
if (this.play) {
// play first song
this._musicPlayerService.play();
}
});
}
}
PlayAllDirective.decorators = [
{ type: Directive, args: [{
selector: '[playAll]'
},] }
];
/** @nocollapse */
PlayAllDirective.ctorParameters = () => [
{ type: MusicPlayerService, },
];
PlayAllDirective.propDecorators = {
"songs": [{ type: Input },],
"play": [{ type: Input },],
"onClick": [{ type: HostListener, args: ['click', ['$event'],] },],
};
function PlayAllDirective_tsickle_Closure_declarations() {
/** @type {!Array<{type: !Function, args: (undefined|!Array<?>)}>} */
PlayAllDirective.decorators;
/**
* @nocollapse
* @type {function(): !Array<(null|{type: ?, decorators: (undefined|!Array<{type: !Function, args: (undefined|!Array<?>)}>)})>}
*/
PlayAllDirective.ctorParameters;
/** @type {!Object<string,!Array<{type: !Function, args: (undefined|!Array<?>)}>>} */
PlayAllDirective.propDecorators;
/** @type {?} */
PlayAllDirective.prototype.songs;
/** @type {?} */
PlayAllDirective.prototype.play;
/** @type {?} */
PlayAllDirective.prototype._musicPlayerService;
}
//# sourceMappingURL=play-all.directive.js.map