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

Side by Side Diff: content/browser/resources/media/new/graph_painter.js

Issue 18889006: Removed old media-internals page and rewrote it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved all 'new' media internals files into its own folder for a smooth transition. 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 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5
6 var graphPainter = (function () {
7 "use strict";
8 var graphPainter = {};
9
10 function updateBufferGraph(playerInfo, bufferGraph) {
11 bufferGraph.setWidth(400);
12
13 var p = playerInfo.properties;
14
15 bufferGraph.plot(p.buffer_start, p.buffer_end);
16 bufferGraph.plot(p.buffer_start, p.buffer_current);
17 bufferGraph.draw();
18 }
19
20 graphPainter.paintNew = function (playerInfo, div, options) {
21 removeChildren(div);
22
23 var p = playerInfo.properties;
24
25 // If we can, make a new graph for the buffer status
26 if (p.buffer_start !== undefined && p.buffer_current !== undefined &&
27 p.buffer_end !== undefined && p.total_bytes !== undefined) {
28
29 var bufferGraph = new RangeGraph(p.total_bytes);
30 updateBufferGraph(playerInfo, bufferGraph);
31 bufferGraph.element.setAttribute('id', "buffer-graph");
32 bufferGraph.element.setAttribute('style', "vertical-align:middle;");
33
34
35 div.appendChild(document.createTextNode("Buffer\u00a0"));
36 div.appendChild(bufferGraph.element);
37 }
38
39 };
40 graphPainter.paintExist = function (playerInfo, div, options) {
41 var bufferGraphElem = div.querySelector("#buffer-graph");
42
43 if (bufferGraphElem) {
44 // Use the 'existing' constructor for RangeGraph to
45 // build it off of the existing bufferGraphElem
46 var bufferGraph = new RangeGraph(playerInfo.properties.total_bytes,
47 bufferGraphElem);
48 updateBufferGraph(playerInfo, bufferGraph);
49 }
50 };
51 graphPainter.invalidate = function () {
52 };
53
54 return graphPainter;
55 }());
OLDNEW
« no previous file with comments | « content/browser/resources/media/new/goog.js ('k') | content/browser/resources/media/new/hover.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698