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 a playsinline attribute to <video> #1444

Merged
merged 3 commits into from
Jun 21, 2016
Merged

Add a playsinline attribute to <video> #1444

merged 3 commits into from
Jun 21, 2016

Conversation

domenic
Copy link
Member

@domenic domenic commented Jun 20, 2016

Closes #1237. For most user agents this will be a no-op, but this gives
a standardized pragma for opting into inline behavior in iOS Safari.


#1237 did not contain any implementer objections, and discussions at BlinkOn with @mounirlamouri indicated to me that he would be supportive of implementing this in Blink (as a no-op, although you'd have to add a line to our IDL file for the IDL attribute). @mounirlamouri, I'd appreciate if you'd confirm my impression of your comments though; I don't want to speak on your behalf.

If my impression was correct, that should give us two UAs with intent to implement, and no UAs with objections, which meets the bar for merging this.

/cc @hober @othermaciej @grorg. Also /cc @kentuckyfriedtakahe from Gecko as he was CCed on that thread but did not get a chance to comment.

Closes #1237. For most user agents this will be a no-op, but this gives
a standardized pragma for opting into inline behavior in iOS Safari.
@domenic domenic added the addition/proposal New features or enhancements label Jun 20, 2016
@annevk
Copy link
Member

annevk commented Jun 21, 2016

Gecko supports adding this (per @kentuckyfriedtakahe).

@mounirlamouri
Copy link
Member

mounirlamouri commented Jun 21, 2016

As discussed at BlinkOn, I think this would be fine. I have been pocked multiple times by UX people who wanted to implement some auto-fullscreen behaviour in one way or another. Having an attribute that could be a semantic way to opt out of these behaviour would be good in case of.

@domenic
Copy link
Member Author

domenic commented Jun 21, 2016

Awesome! Will let another editor review for any editorial issues. The phrasing of these type of "hints" is a bit delicate so if anyone finds it unsatisfactory concrete suggestions would be appreciated.

if the <code data-x="attr-media-controls">controls</code> attribute is absent.</p>
<p>User agents may allow users to view the video content in manners more suitable to the user,
such as fullscreen or in an independent resizable window. (User agents may even trigger such a
viewing mode by default upon playing a video, although they should not do so when the <code
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a duplicate "should not" requirement.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have suggestions on how to de-duplicate?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"except as otherwise specified by playsinline"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made a suggestion as a commit. I thought this paragraph was more suitable to have the requirement and the definition of the attribute can talk more abstract.

@domenic
Copy link
Member Author

domenic commented Jun 21, 2016

Thanks @zcorpan, your version seems great. Can I get a LGTM?

playback area.</p>
<p>The <dfn><code data-x="attr-video-playsinline">playsinline</code></dfn> is a <span>boolean
attribute</span>. If present, it serves as a hint to the user agent that the video ought to not be
displayed fullscreen or in an independent resizable window by default, but instead "inline" in the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nor?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nor is only used with neither. It could be "ought to neither be displayed fullscreen nor in an independent..." that does sound a bit better.

@domenic domenic merged commit 6e17d01 into master Jun 21, 2016
@domenic domenic deleted the playsinline branch June 21, 2016 15:23
kisg pushed a commit to paul99/webkit-mips that referenced this pull request Jun 30, 2016
https://bugs.webkit.org/show_bug.cgi?id=159283

Reviewed by Eric Carlson.

Tests: media/video-playsinline.html
       media/video-webkit-playsinline.html

Unprefix the webkit-playsinline content attribute, as an unprefixed version
was added to the HTML spec by <whatwg/html#1444>.
The new 'playsinline' content attribute reflects to a new DOM property of
the same name.

* html/HTMLAttributeNames.in:
* html/HTMLVideoElement.idl:
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@202660 268f45cc-cd09-0410-ab3c-d52691b4dbfc
reaperhulk added a commit to reaperhulk/react that referenced this pull request Aug 18, 2016
The WHATWG has unprefixed `-webkit-playsinline` as `playsinline` (see: whatwg/html#1444) and iOS 10 intends to use it (https://webkit.org/blog/6784/new-video-policies-for-ios/).
zpao pushed a commit to facebook/react that referenced this pull request Aug 23, 2016
The WHATWG has unprefixed `-webkit-playsinline` as `playsinline` (see: whatwg/html#1444) and iOS 10 intends to use it (https://webkit.org/blog/6784/new-video-policies-for-ios/).
zpao pushed a commit to facebook/react that referenced this pull request Sep 15, 2016
The WHATWG has unprefixed `-webkit-playsinline` as `playsinline` (see: whatwg/html#1444) and iOS 10 intends to use it (https://webkit.org/blog/6784/new-video-policies-for-ios/).
(cherry picked from commit 7b11aa9)
@tatusian
Copy link

tatusian commented Aug 1, 2017

Hey, all. Just curious if there's any particular reason playsinline might not work with particular models of phones: noticing that autoplay using playsinline for a project isn't working locally tested on iPhone 5s, but it's great on iPhone 6. Had you encountered that all?

@fpassa
Copy link

fpassa commented Sep 26, 2017

I couldn't get it working on Iphone 7 even by building the ipa as development target = iOS 10.
In my hybrid app I'm using the tag and video starts and always goes full screen. Iphone 7 is running iOS 11. But I've also tested in Iphone X, SE and Iphone 8 on simulator and doesn't work neither. Any clue?

@annevk
Copy link
Member

annevk commented Sep 27, 2017

A better place to raise that would be https://bugs.webkit.org/enter_bug.cgi?product=WebKit (or potentially Stack Overflow, but it sounds like you found a bug in Safari).

ryanhaddad pushed a commit to WebKit/WebKit that referenced this pull request Dec 22, 2020
https://bugs.webkit.org/show_bug.cgi?id=159283

Reviewed by Eric Carlson.

Tests: media/video-playsinline.html
       media/video-webkit-playsinline.html

Unprefix the webkit-playsinline content attribute, as an unprefixed version
was added to the HTML spec by <whatwg/html#1444>.
The new 'playsinline' content attribute reflects to a new DOM property of
the same name.

* html/HTMLAttributeNames.in:
* html/HTMLVideoElement.idl:
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::requiresFullscreenForVideoPlayback):


Canonical link: https://commits.webkit.org/177402@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202660 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addition/proposal New features or enhancements
Development

Successfully merging this pull request may close these issues.

6 participants