Commit fcac6578 authored by yoshiki's avatar yoshiki Committed by Commit bot

Video Player: refresh token when it looks expired

It should be refreshed but it was not by bug. This patch fixes this.

BUG=none
TEST=manual
TBR=fukino@chromium.org

Review URL: https://codereview.chromium.org/543103002

Cr-Commit-Position: refs/heads/master@{#293532}
parent 2247b151
...@@ -329,7 +329,8 @@ CastVideoElement.prototype = { ...@@ -329,7 +329,8 @@ CastVideoElement.prototype = {
var message = JSON.parse(messageAsJson); var message = JSON.parse(messageAsJson);
if (message['message'] === 'request-token') { if (message['message'] === 'request-token') {
if (message['previousToken'] === this.token_) { if (message['previousToken'] === this.token_) {
this.mediaManager_.getToken().then(function(token) { this.mediaManager_.getToken(true).then(function(token) {
this.token_ = token;
this.sendMessage_({message: 'push-token', token: token}); this.sendMessage_({message: 'push-token', token: token});
// TODO(yoshiki): Revokes the previous token. // TODO(yoshiki): Revokes the previous token.
}.bind(this)).catch(function(error) { }.bind(this)).catch(function(error) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment