Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add poster (big picture / hero image) #79

Closed
johnmellor opened this issue Jul 27, 2016 · 6 comments
Closed

Add poster (big picture / hero image) #79

johnmellor opened this issue Jul 27, 2016 · 6 comments

Comments

@johnmellor
Copy link
Contributor

johnmellor commented Jul 27, 2016

Android, Windows and Chrome OS all support showing a poster image on a notification.

Let's add this feature to Web Notifications:

partial dictionary NotificationOptions {
  USVString poster;
}

As usual, they will be displayed on a best-effort basis. For example, both Android and Windows only display the poster image when the notification is expanded (on Android, the most recent notification is usually expanded, depending on priority; in the Windows 10 Action Center, the most recent notification shown by each app is expanded [source]). Other platforms won't show them at all.

Ideally it would be possible to feature-detect platform support by checking if Notification.prototype contains poster, but that's a subject for another issue. I will note that on Android at least, BigPictureStyle is mutually exclusive with InboxStyle for displaying a list of items (#21), so if we later add lists to Web Notifications we may need some way to indicate that they are mutually exclusive and/or allow web developers to indicate which property is more important, but we can cross that bridge later.

@annevk
Copy link
Member

annevk commented Jul 28, 2016

I like the term "image" better. "poster" is used in the platform to mean the poster frame in videos (<video poster>).

@beverloo
Copy link
Member

beverloo commented Aug 5, 2016

Since we call icons icon (and might go plural once we settle on some sort of IconSet), that works for me.

I think that the feature detection comment is implied, but clarifying what we'd like user agents to do here would be good. I've opened issue #80.

If we're not able to combine certain kinds of presentations, for instance image style (this issue) and an itemized list style, maybe we should consider having a type property? Do non-Android platforms have the capability to create rich compositions?

@annevk
Copy link
Member

annevk commented Aug 8, 2016

Is this shown instead of text, or is that a possibility? Do we need to provide for replacement text?

johnmellor added a commit to beverloo/peter.sh that referenced this issue Aug 16, 2016
johnmellor added a commit to beverloo/peter.sh that referenced this issue Aug 16, 2016
@johnmellor
Copy link
Contributor Author

Is this shown instead of text, or is that a possibility?

I've been testing this on a variety of platforms. It never gets shown instead of text*, however on Android at least the body text of the notification is limited to a single line (ellipsized) when using BigPictureStyle, whereas usually the body text is able to wrap (if you use a BigTextStyle).

Do we need to provide for replacement text?

It seems Windows does support alt text here; Android and Chrome OS do not however. Perhaps for now the spec should just say authors should not rely on the image (even for sighted users, the image is often hidden unless a notification is expanded), and make sure that information is conveyed in another way?

*: (Android N unexpectedly stopped showing the contentText of a notification when it is expanded, but it's possible to work around that by also setting the BigPictureStyle's summaryText to the same string).

@annevk
Copy link
Member

annevk commented Aug 24, 2016

I suppose we can add imageAlt later if developers start using these differently, though at that point it might be too late for some deployed systems… But yeah, we should have some language around this and expected presentation.

@johnmellor
Copy link
Contributor Author

I've updated PR #82 to clarify the expected presentation (lines 99-120) of image (including more concrete definitions of icon and badge for comparison) and to emphasize that authors should not rely on these graphics, but ensure information is conveyed in another way (lines 126-131). Does it look better now?

@annevk annevk closed this as completed in #82 Oct 5, 2016
annevk pushed a commit that referenced this issue Oct 5, 2016
Also clarifies meaning of existing icon and badge properties. Fixes #79.
maxbaxfax pushed a commit to maxbaxfax/peter.sh that referenced this issue Jun 2, 2024
mazl-srlnd pushed a commit to mazl-srlnd/peter.sh that referenced this issue Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants