| 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);
|
| };
|
|
|