New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 676995 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 1
Type: Bug



Sign in to add a comment

MediaImage constructor should not be mandatory

Project Member Reported by fbeaufort@chromium.org, Dec 26 2016

Issue description

It would be nice if I could set metadata artwork by simply passing it a dictionary.

WHAT WORKS NOW:

    var image = new MediaImage({ src: 'http://example.com/', sizes: '40x40', type: 'image/png' });
    navigator.mediaSession.metadata.artwork = [ image ];

WHAT SHOULD WORK AS WELL:

    var image = { src: 'http://example.com/', sizes: '40x40', type: 'image/png' };
    navigator.mediaSession.metadata.artwork = [ image ];
 
Cc: krajshree@chromium.org
Labels: Needs-Feedback
fbeaufort@ - Thanks for filing this issue...!!

Could you please provide manual repro steps to reproduce this issue and also the chrome reported version if provided will be more helpful.

Thanks...!!
Cc: zqzh...@chromium.org mlamouri@chromium.org
Chrome version is 57.0.2964.0 (Canary at that time).

I believe Javascript code is enough for mlamouri@ and zqzhang@ to understand what is wrong. Thank you ;)
Cc: -mlamouri@chromium.org
Labels: -Pri-3 -Needs-Feedback M-57 Pri-1
Owner: mlamouri@chromium.org
Status: Started (was: Unconfirmed)
The only solution is to use a dictionary instead of an interface and I see no reason not to do this. I filed a spec bug (https://github.com/WICG/mediasession/issues/161) and wrote a CL (https://codereview.chromium.org/2612003002). zqzhang@ and I will have to figure out a couple of spec details but I think it's a simple enough change for us to do before shipping.

Thanks for the feedback fbeaufort@!
Project Member

Comment 4 by bugdroid1@chromium.org, Jan 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/31c6ef91f565a59348aad61bfadd3c954a3b0552

commit 31c6ef91f565a59348aad61bfadd3c954a3b0552
Author: mlamouri <mlamouri@chromium.org>
Date: Fri Jan 06 17:27:59 2017

Media Session: use dictionary instead of an interface for MediaImage.

Using an interface makes the usage of MediaImage needlessly more
complicated than needed. A dictionary should keep the feature working
roughly the same way and improve developer's ergonomics.

Spec change: https://github.com/WICG/mediasession/pull/162

BUG= 676995 
R=zqzhang@chromium.org

Review-Url: https://codereview.chromium.org/2612003002
Cr-Commit-Position: refs/heads/master@{#441962}

[delete] https://crrev.com/1c53fd3cf915d7700bbb2702061e90845c6a120d/third_party/WebKit/LayoutTests/media/mediasession/mediaimage.html
[modify] https://crrev.com/31c6ef91f565a59348aad61bfadd3c954a3b0552/third_party/WebKit/LayoutTests/media/mediasession/mediasessionmetadata.html
[modify] https://crrev.com/31c6ef91f565a59348aad61bfadd3c954a3b0552/third_party/WebKit/LayoutTests/media/mediasession/mojo/metadata-async.html
[modify] https://crrev.com/31c6ef91f565a59348aad61bfadd3c954a3b0552/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt
[modify] https://crrev.com/31c6ef91f565a59348aad61bfadd3c954a3b0552/third_party/WebKit/Source/modules/mediasession/BUILD.gn
[delete] https://crrev.com/1c53fd3cf915d7700bbb2702061e90845c6a120d/third_party/WebKit/Source/modules/mediasession/MediaImage.cpp
[delete] https://crrev.com/1c53fd3cf915d7700bbb2702061e90845c6a120d/third_party/WebKit/Source/modules/mediasession/MediaImage.h
[modify] https://crrev.com/31c6ef91f565a59348aad61bfadd3c954a3b0552/third_party/WebKit/Source/modules/mediasession/MediaImage.idl
[delete] https://crrev.com/1c53fd3cf915d7700bbb2702061e90845c6a120d/third_party/WebKit/Source/modules/mediasession/MediaImageInit.idl
[modify] https://crrev.com/31c6ef91f565a59348aad61bfadd3c954a3b0552/third_party/WebKit/Source/modules/mediasession/MediaMetadata.cpp
[modify] https://crrev.com/31c6ef91f565a59348aad61bfadd3c954a3b0552/third_party/WebKit/Source/modules/mediasession/MediaMetadata.h
[modify] https://crrev.com/31c6ef91f565a59348aad61bfadd3c954a3b0552/third_party/WebKit/Source/modules/mediasession/MediaMetadata.idl
[modify] https://crrev.com/31c6ef91f565a59348aad61bfadd3c954a3b0552/third_party/WebKit/Source/modules/mediasession/MediaMetadataInit.idl
[modify] https://crrev.com/31c6ef91f565a59348aad61bfadd3c954a3b0552/third_party/WebKit/Source/modules/mediasession/MediaMetadataSanitizer.cpp
[modify] https://crrev.com/31c6ef91f565a59348aad61bfadd3c954a3b0552/third_party/WebKit/Source/modules/modules_idl_files.gni

Status: Fixed (was: Started)

Sign in to add a comment