| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 // This hack prevents a bug on the cast extension. | 7 // This hack prevents a bug on the cast extension. |
| 8 // TODO(yoshiki): Remove this once the cast extension supports Chrome apps. | 8 // TODO(yoshiki): Remove this once the cast extension supports Chrome apps. |
| 9 // Although localStorage in Chrome app is not supported, but it's used in the | 9 // Although localStorage in Chrome app is not supported, but it's used in the |
| 10 // cast extension. This line prevents an exception on using localStorage. | 10 // cast extension. This line prevents an exception on using localStorage. |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 clearTimeout(checkTimer); | 98 clearTimeout(checkTimer); |
| 99 | 99 |
| 100 if (loaded) | 100 if (loaded) |
| 101 callback(); | 101 callback(); |
| 102 else | 102 else |
| 103 console.error('Google Cast extension load failed.', errorInfo); | 103 console.error('Google Cast extension load failed.', errorInfo); |
| 104 }.wrap(); | 104 }.wrap(); |
| 105 } else { | 105 } else { |
| 106 setTimeout(callback); // Runs asynchronously. | 106 setTimeout(callback); // Runs asynchronously. |
| 107 } | 107 } |
| 108 }; | 108 } |
| 109 | 109 |
| 110 /** | 110 /** |
| 111 * Initialize Cast API. | 111 * Initialize Cast API. |
| 112 */ | 112 */ |
| 113 function initializeApi() { | 113 function initializeApi() { |
| 114 var onSession = function() { | 114 var onSession = function() { |
| 115 // TODO(yoshiki): Implement this. | 115 // TODO(yoshiki): Implement this. |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 var onInitSuccess = function() { | 118 var onInitSuccess = function() { |
| (...skipping 26 matching lines...) Expand all Loading... |
| 145 } | 145 } |
| 146 | 146 |
| 147 player.setCastList(receivers); | 147 player.setCastList(receivers); |
| 148 } else if (availability == chrome.cast.ReceiverAvailability.UNAVAILABLE) { | 148 } else if (availability == chrome.cast.ReceiverAvailability.UNAVAILABLE) { |
| 149 player.setCastList([]); | 149 player.setCastList([]); |
| 150 } else { | 150 } else { |
| 151 console.error('Unexpected response in onReceiver.', arguments); | 151 console.error('Unexpected response in onReceiver.', arguments); |
| 152 player.setCastList([]); | 152 player.setCastList([]); |
| 153 } | 153 } |
| 154 } | 154 } |
| OLD | NEW |