Created
March 7, 2017 03:52
-
-
Save crobinson42/93597d890785fb87877f93453c2fe54e to your computer and use it in GitHub Desktop.
Promise refactor
This file contains hidden or 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.props | |
.saveSession(this.titleContent.id, this.props.deviceId, true) | |
.then(response => { | |
const initialSeekTime = response.payload.data.seconds | |
this.props.fetchUpFrontAuthToken(this.titleContent.segments[0].mediaKey, this.props.patronInfo.patron.id, this.titleContent.circId) | |
.then(response => { | |
this.initializePlayer(this.props.patronInfo.patron.id, this.titleContent.circId, response.payload.data, config.castlabsWidevineUrl, config.castlabsPlayReadyUrl, initialSeekTime) | |
}) | |
}) |
This file contains hidden or 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
let initialSeekTime | |
this.props | |
.saveSession(this.titleContent.id, this.props.deviceId, true) | |
.then(response => { | |
initialSeekTime = response.payload.data.seconds | |
return this.props.fetchUpFrontAuthToken( | |
this.titleContent.segments[0].mediaKey, | |
this.props.patronInfo.patron.id, | |
this.titleContent.circId | |
) | |
}) | |
.then(response => { | |
this.initializePlayer( | |
this.props.patronInfo.patron.id, | |
this.titleContent.circId, | |
response.payload.data, | |
config.castlabsWidevineUrl, | |
config.castlabsPlayReadyUrl, | |
initialSeekTime | |
) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment