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

Unified Diff: content/browser/resources/media/main.js

Issue 68173025: Introduce new interface for MediaInternals updates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix JavaScript test. Use non-exported base. Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/resources/media/client_renderer.js ('k') | content/browser/resources/media/manager.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/resources/media/main.js
diff --git a/content/browser/resources/media/main.js b/content/browser/resources/media/main.js
index 14b9918a2de419ab870ec0b89f3a016b7b431ecf..cb239da2d5448495ab96c902819b3eb47f9c3916 100644
--- a/content/browser/resources/media/main.js
+++ b/content/browser/resources/media/main.js
@@ -40,8 +40,8 @@ var media = (function() {
};
media.onReceiveEverything = function(everything) {
- for (var key in everything.audio_streams) {
- media.updateAudioStream(everything.audio_streams[key]);
+ for (var component in everything) {
+ media.updateAudioComponent(everything[component]);
}
};
@@ -123,31 +123,20 @@ var media = (function() {
});
};
- // For whatever reason, addAudioStream is also called on
- // the removal of audio streams.
- media.addAudioStream = function(event) {
- switch (event.status) {
- case 'created':
- manager.addAudioStream(event.id);
- manager.updateAudioStream(event.id, { 'playing': event.playing });
- break;
+ media.updateAudioComponent = function(component) {
+ var uniqueComponentId = component.owner_id + ':' + component.component_id;
+ switch (component.status) {
case 'closed':
- manager.removeAudioStream(event.id);
+ manager.removeAudioComponent(
+ component.component_type, uniqueComponentId);
+ break;
+ default:
+ manager.updateAudioComponent(
+ component.component_type, uniqueComponentId, component);
break;
}
};
- media.updateAudioStream = function(stream) {
- manager.addAudioStream(stream.id);
- manager.updateAudioStream(stream.id, stream);
- };
-
- media.onItemDeleted = function() {
- // This only gets called when an audio stream is removed, which
- // for whatever reason is also handled by addAudioStream...
- // Because it is already handled, we can safely ignore it.
- };
-
media.onPlayerOpen = function(id, timestamp) {
manager.addPlayer(id, timestamp);
};
« no previous file with comments | « content/browser/resources/media/client_renderer.js ('k') | content/browser/resources/media/manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698