Skip to content

Commit

Permalink
fixing flow errors
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyBregman committed Dec 5, 2019
1 parent 42ac3a5 commit d163342
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/flash.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ class Flash extends FakeEventTarget implements IEngine {
* @type {Object}
* @private
*/
_config: Object = null;
_config: ?Object = null;

/**
* Promise when load finished
* @type {Promise<*>}
* @private
*/
_loadPromise: Promise<*> = null;
_loadPromise: ?Promise<*> = null;

/**
* volume value
Expand Down Expand Up @@ -420,11 +420,13 @@ class Flash extends FakeEventTarget implements IEngine {
* @returns {void}
*/
play(): void {
this._loadPromise.then(() => {
if (this._api) {
this._api.play();
}
});
if (this._loadPromise) {
this._loadPromise.then(() => {
if (this._api) {
this._api.play();
}
});
}
}

pause(): void {
Expand Down Expand Up @@ -800,7 +802,7 @@ class Flash extends FakeEventTarget implements IEngine {
* @returns {boolean} - Whether the video tag has an attribute of playsinline.
*/
get playsinline(): boolean {
return this._config.playsinline;
return this._config ? this._config.playsinline : false;
}

/**
Expand Down

0 comments on commit d163342

Please sign in to comment.