Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2415)

Side by Side Diff: content/browser/resources/media/painters/playerListPainter.js

Issue 18889006: Removed old media-internals page and rewrote it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 var playerListPainter = (function () {
2 "use strict";
3 var playerListPainter = {};
4
5 playerListPainter.paintNew = function (playerInfo, div, opt_properties) {
6 var ul = document.createElement('ul');
7 var playerManager = opt_properties.playerManager;
8
9 goog.object.forEach(playerManager.players, function (player, id) {
10 // If we have the opportunity to name it
11 // something human readable, do so.
12
13 var name;
14 // If we have a url, use the file name (but not path) as the
15 // name that is displayed
16 if (player.properties.url) {
17 var split = player.properties.url.split("/");
18 name = split[split.length - 1];
19 }
20
21 name = name || player.properties.name || "player " + id;
22 var li = document.createElement('li');
23 var btn = document.createElement('button');
24
25 btn.onclick = function () {
26 playerManager.selectPlayer(id);
27 };
28
29 btn.appendChild(document.createTextNode(name));
30 li.appendChild(btn);
31 ul.appendChild(li);
32 });
33
34 removeChildren(div);
35 div.appendChild(ul);
36 };
37
38 playerListPainter.paintExist = playerListPainter.paintNew;
39
40 playerListPainter.invalidate = function () {
41 };
42
43 return playerListPainter;
44 }());
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698