Bug 247043 - REGRESSION (Safari 16.1): mediaSession API not showing artwork
Summary: REGRESSION (Safari 16.1): mediaSession API not showing artwork
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Other
Hardware: iPhone / iPad Other
: P2 Minor
Assignee: Jean-Yves Avenard [:jya]
URL: https://googlechrome.github.io/sample...
Keywords: InRadar
: 248737 249961 251782 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-10-25 18:58 PDT by leo.changliao
Modified: 2023-12-06 13:38 PST (History)
8 users (show)

See Also:


Attachments
Working Example on iOS 16.02 (149.35 KB, image/jpeg)
2022-10-27 09:00 PDT, leo.changliao
no flags Details
NOT Working Example on iOS 16.1 (545.79 KB, image/png)
2022-10-27 09:00 PDT, leo.changliao
no flags Details
With fix (127.11 KB, image/png)
2022-12-14 21:09 PST, Jean-Yves Avenard [:jya]
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description leo.changliao 2022-10-25 18:58:14 PDT
After upgrade iOS to 16.1 and MacOS to Ventura 13.0 (Safari 16.1), mediaSession API stopped showing artwork.
Comment 1 Radar WebKit Bug Importer 2022-10-26 11:30:34 PDT
<rdar://problem/101597398>
Comment 2 Alexey Proskuryakov 2022-10-26 11:31:55 PDT
Could you please provide steps to reproduce? Ideally a reduced test case, but any website that used to work and doesn't now would be fine.
Comment 3 leo.changliao 2022-10-26 17:43:21 PDT
Device used:
iPhone 13, iOS 16.02
iPhone 13 Pro Max, iOS 16.1

Browser:
Safari

mediaSession API sample: 
https://googlechrome.github.io/samples/media-session/audio.html

Result:
iOS 16.02 - Lock Screen showing album image while playing music
iOS 16.1 - Lock Screen NOT showing album image while playing music

All other functions are working fine. (ie. next, previous, play, pause etc.)
Comment 4 leo.changliao 2022-10-27 09:00:09 PDT
Created attachment 463272 [details]
Working Example on iOS 16.02
Comment 5 leo.changliao 2022-10-27 09:00:57 PDT
Created attachment 463273 [details]
NOT Working Example on iOS 16.1
Comment 6 Jean-Yves Avenard [:jya] 2022-11-09 06:36:03 PST
Pull request: https://github.com/WebKit/WebKit/pull/4023
Comment 7 Jean-Yves Avenard [:jya] 2022-11-09 06:40:23 PST
Pull request: https://github.com/WebKit/WebKit/pull/6300
Comment 8 EWS 2022-11-13 20:28:20 PST
Committed 256627@main (8f70e6bf626c): <https://commits.webkit.org/256627@main>

Reviewed commits have been landed. Closing PR #6300 and removing active labels.
Comment 9 Jean-Yves Avenard [:jya] 2022-12-08 17:24:17 PST
*** Bug 248737 has been marked as a duplicate of this bug. ***
Comment 10 EWS 2022-12-12 08:24:01 PST
Committed 252432.920@safari-7614-branch (768d89b728fc): <https://commits.webkit.org/252432.920@safari-7614-branch>

Reviewed commits have been landed. Closing PR #245 and removing active labels.
Comment 11 Nick 2022-12-13 20:17:45 PST
macOS 13.1 (22C65)
safari 16.2 (18614.3.7.1.5)
problem stil persist.

Steps to reproduce:

1. Open music.yandex.com
2. Open browser console
3. Paste this code:

navigator.mediaSession.metadata = new MediaMetadata({
    title: "11111111111",
    artist: "222222222",
    album: "3333333333",
    artwork: [
        { src: "https://avatars.yandex.net/get-music-content/5375761/c8e05100.a.19837155-1/200x200" }
    ]});

4. Press Enter
5. Open Now playing widget

Title, artist, album is set correctly. Cover not set.

macOS 12.6.1 Safari 15.6.1 (17613.3.9.1.16) all works as expected.
Comment 12 Jean-Yves Avenard [:jya] 2022-12-14 21:09:56 PST
Created attachment 464053 [details]
With fix

The fix only landed recently. Try with Safari Technology Preview (https://developer.apple.com/safari/technology-preview/)
Comment 13 Nick 2022-12-15 10:27:54 PST
(In reply to Jean-Yves Avenard [:jya] from comment #12)
> Created attachment 464053 [details]
> With fix
> 
> The fix only landed recently. Try with Safari Technology Preview
> (https://developer.apple.com/safari/technology-preview/)

Strange situation. The Safari Technology Preview has been installed and updated. It only worked after a reinstall.
Comment 14 Sam Sneddon [:gsnedders] 2022-12-30 21:47:22 PST
*** Bug 249961 has been marked as a duplicate of this bug. ***
Comment 15 17rxyz 2022-12-31 09:10:01 PST
Has there been a fix found yet for iOS at this point in time?
Comment 16 Sam Sneddon [:gsnedders] 2023-02-06 03:39:47 PST
*** Bug 251782 has been marked as a duplicate of this bug. ***
Comment 17 Sam Sneddon [:gsnedders] 2023-02-06 03:40:05 PST
(In reply to 17rxyz from comment #15)
> Has there been a fix found yet for iOS at this point in time?

I believe the fix for this shipped last month in iOS 16.3.
Comment 18 leo.changliao 2023-02-06 04:07:12 PST
Still not working in iOS 16.3
Comment 19 Dom Christie 2023-03-30 01:50:24 PDT
Unfortunately this still appears to be broken on iOS 16.4. MediaMetadata artwork is only displayed if the src image dimensions are valid. If I specify more than one size, the smaller version is also used (pixelated) where a larger version would be preferable.
Comment 20 Emil 2023-12-01 04:19:58 PST
This seems to still not be working in iOS 17.0 or 17.1.
Comment 21 Jean-Yves Avenard [:jya] 2023-12-04 14:55:23 PST
(In reply to Emil from comment #20)
> This seems to still not be working in iOS 17.0 or 17.1.

Do you mean you have no artwork at all, or that it's only using the first image in the array of image (bug 265824)
Comment 22 Alexey Proskuryakov 2023-12-04 15:10:03 PST
https://googlechrome.github.io/samples/media-session/audio.html does work (showing artwork) for me on an iPhone with iOS 17.2 beta (as mentioned above, expected to work with 16.3 and newer).
Comment 23 Emil 2023-12-06 04:39:48 PST
(In reply to Jean-Yves Avenard [:jya] from comment #21)
> (In reply to Emil from comment #20)
> > This seems to still not be working in iOS 17.0 or 17.1.
> 
> Do you mean you have no artwork at all, or that it's only using the first
> image in the array of image (bug 265824)

It does seem to, in fact, work on a real device. On the iOS 17.0 simulator, the artwork does not show up at all (nor does the Play icon, but it's still clickable).
Thanks!
Comment 24 Alexey Proskuryakov 2023-12-06 13:38:45 PST
Interesting. I don't know if there is a deep reason for this or if it's a simple bug of some sort in the simulator. Would you be willing to file a new bug about that?