OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <include src="cache_entry.js"/> | 5 <include src="cache_entry.js"/> |
6 <include src="disjoint_range_set.js"/> | 6 <include src="disjoint_range_set.js"/> |
7 <include src="event_list.js"/> | 7 <include src="event_list.js"/> |
8 <include src="item_store.js"/> | 8 <include src="item_store.js"/> |
9 <include src="media_player.js"/> | 9 <include src="media_player.js"/> |
10 <include src="metrics.js"/> | 10 <include src="metrics.js"/> |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 * Render a single stream as a <li>. | 57 * Render a single stream as a <li>. |
58 * @param {Object} stream The stream to render. | 58 * @param {Object} stream The stream to render. |
59 * @return {HTMLElement} A <li> containing the stream information. | 59 * @return {HTMLElement} A <li> containing the stream information. |
60 */ | 60 */ |
61 function printStream(stream) { | 61 function printStream(stream) { |
62 var out = document.createElement('li'); | 62 var out = document.createElement('li'); |
63 out.id = stream.id; | 63 out.id = stream.id; |
64 out.className = 'audio-stream'; | 64 out.className = 'audio-stream'; |
65 out.setAttribute('status', stream.status); | 65 out.setAttribute('status', stream.status); |
66 | 66 |
| 67 if (typeof stream.tab_title != 'undefined') { |
| 68 out.textContent += '"' + stream.tab_title + '": '; |
| 69 } |
67 out.textContent += 'Audio stream ' + stream.id.split('.')[1]; | 70 out.textContent += 'Audio stream ' + stream.id.split('.')[1]; |
68 out.textContent += ' is ' + (stream.playing ? 'playing' : 'paused'); | 71 out.textContent += ' is ' + (stream.playing ? 'playing' : 'paused'); |
69 if (typeof stream.volume != 'undefined') { | 72 if (typeof stream.volume != 'undefined') { |
70 out.textContent += ' at ' + (stream.volume * 100).toFixed(0); | 73 out.textContent += ' at ' + (stream.volume * 100).toFixed(0); |
71 out.textContent += '% volume.'; | 74 out.textContent += '% volume.'; |
72 } | 75 } |
73 return out; | 76 return out; |
74 } | 77 } |
75 | 78 |
76 var out = document.createElement('ul'); | 79 var out = document.createElement('ul'); |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 onMediaEvent: onMediaEvent | 275 onMediaEvent: onMediaEvent |
273 }; | 276 }; |
274 }); | 277 }); |
275 | 278 |
276 /** | 279 /** |
277 * Initialize everything once we have access to the DOM. | 280 * Initialize everything once we have access to the DOM. |
278 */ | 281 */ |
279 document.addEventListener('DOMContentLoaded', function() { | 282 document.addEventListener('DOMContentLoaded', function() { |
280 media.initialize(); | 283 media.initialize(); |
281 }); | 284 }); |
OLD | NEW |