Add 'ready' promise

This commit is contained in:
Albin Larsson 2018-06-15 23:01:33 +02:00
parent aab2817ddc
commit 2af60c5c0d

View File

@ -111,3 +111,9 @@ export function unbindListeners() {
this.eventListeners = [];
}
}
// Run method when / if player is ready
export function ready () {
return new Promise(resolve => this.ready ? setTimeout(resolve, 0) : on.call(this, this.elements.container, 'ready', resolve))
.then(() => {});
}