-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Before calling the provider to get the media config, update the loading spinner state of the ui manager using the setConfig API. Also, moved all UI logic to ui-actions file.
- Loading branch information
Dan Ziv
authored
Apr 9, 2018
1 parent
b387358
commit a936117
Showing
3 changed files
with
30 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// @flow | ||
import {UIManager} from 'playkit-js-ui' | ||
|
||
/** | ||
* Sets the media info on error component to the "retry" functionality. | ||
* @param {UIManager} uiManager - The ui manager. | ||
* @param {ProviderMediaInfoObject} mediaInfo - The media info. | ||
* @returns {void} | ||
*/ | ||
function setUIErrorOverlayConfig(uiManager: UIManager, mediaInfo: ProviderMediaInfoObject): void { | ||
uiManager.setConfig({ | ||
mediaInfo: mediaInfo | ||
}, 'error'); | ||
} | ||
|
||
/** | ||
* Sets the loading spinner state. | ||
* @param {UIManager} uiManager - The ui manager. | ||
* @param {boolean} show - The spinner state. | ||
* @returns {void} | ||
*/ | ||
function setUILoadingSpinnerState(uiManager: UIManager, show: boolean): void { | ||
uiManager.setConfig({ | ||
show: show | ||
}, 'loading'); | ||
} | ||
|
||
export {setUIErrorOverlayConfig, setUILoadingSpinnerState}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters