Add a playsinline attribute to <video> #1444

Merged
merged 3 commits into from Jun 21, 2016

Conversation

6 participants
@domenic
Member

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.

Add a playsinline attribute to <video>
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.
@annevk

This comment has been minimized.

Show comment
Hide comment
@annevk

annevk Jun 21, 2016

Member

Gecko supports adding this (per @kentuckyfriedtakahe).

Member

annevk commented Jun 21, 2016

Gecko supports adding this (per @kentuckyfriedtakahe).

@mounirlamouri

This comment has been minimized.

Show comment
Hide comment
@mounirlamouri

mounirlamouri Jun 21, 2016

Member

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.

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

This comment has been minimized.

Show comment
Hide comment
@domenic

domenic Jun 21, 2016

Member

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.

Member

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.

source
- 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

This comment has been minimized.

@zcorpan

zcorpan Jun 21, 2016

Member

This is a duplicate "should not" requirement.

@zcorpan

zcorpan Jun 21, 2016

Member

This is a duplicate "should not" requirement.

This comment has been minimized.

@domenic

domenic Jun 21, 2016

Member

Do you have suggestions on how to de-duplicate?

@domenic

domenic Jun 21, 2016

Member

Do you have suggestions on how to de-duplicate?

This comment has been minimized.

@annevk

annevk Jun 21, 2016

Member

"except as otherwise specified by playsinline"

@annevk

annevk Jun 21, 2016

Member

"except as otherwise specified by playsinline"

This comment has been minimized.

@zcorpan

zcorpan Jun 21, 2016

Member

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.

@zcorpan

zcorpan Jun 21, 2016

Member

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

This comment has been minimized.

Show comment
Hide comment
@domenic

domenic Jun 21, 2016

Member

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

Member

domenic commented Jun 21, 2016

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

source
- 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

This comment has been minimized.

@annevk

annevk Jun 21, 2016

Member

nor?

This comment has been minimized.

@domenic

domenic Jun 21, 2016

Member

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 Jun 21, 2016

Member

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

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@domenic domenic deleted the playsinline branch Jun 21, 2016

kisg pushed a commit to paul99/webkit-mips that referenced this pull request Jun 30, 2016

jer.noble@apple.com
Unprefix webkit-playsinline.
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

Add playsInline as an allowed HTML property
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 added a commit to facebook/react that referenced this pull request Aug 23, 2016

Add playsInline as an allowed HTML property (#7519)
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/).

@cvrebert cvrebert referenced this pull request in Fyrd/caniuse Sep 14, 2016

Open

<video> `playsinline` attribute #2811

zpao added a commit to facebook/react that referenced this pull request Sep 15, 2016

Add playsInline as an allowed HTML property (#7519)
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

This comment has been minimized.

Show comment
Hide comment
@Tatusian

Tatusian 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?

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

This comment has been minimized.

Show comment
Hide comment
@fpassa

fpassa 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?

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

This comment has been minimized.

Show comment
Hide comment
@annevk

annevk Sep 27, 2017

Member

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).

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment